Image map shader - max jpg pixel dimensions?

Started by jknow, August 20, 2010, 09:40:24 PM

Previous topic - Next topic

jknow

I'm using jpgs in image map shaders. Can't find any documentation on this commonly used feature.

Will it accept files larger than 8192 x 8192? I can't seem to get any bigger jpgs to load, but perhaps I'm doing something wrong. Or perhaps it accepts other filetypes? Again, the file open dialogue gives no information about which file types are acceptable.

Is it a case of more trial and error, or can someone put me out of my misery and let me know the specs on this shader. Thank you!


gregsandor

Yes it will.  I don't use them larger than that due to my computer's memory and ram though.
I believe that TG uncompresses jpgs on load; try tif and you might have a better picture of how much memory you're using.

jknow

Ah OK. It would seem that after while all imports fail, and I need to restart TG2 and then I can add larger image map shaders. I will keep saving and restart if required.

Your reply prompted me to keep experimenting, and when I went back to 8192 from 10000 and it still raised an error I thought I'd try again. Good. Thanks

gregsandor

I just now substituted LakesMergeclipBig.jpg (17000 px x 17000px) for LD_Region_Ortho_40998m.tif.  Works fine.  

Try turning off the populations and see if that improves things.  (in the node window click the title bar of the group i.e. Group Area Flora and press "d" to disable.  Repeat to re-enable.)

Cyber-Angel

Can I ask why you need to use better then 8k resolution? 4K is used in cinemas which uses 4096×3072 pixel resolution and generally specking 2k (2048×1080) textures are used on many motion picture assets some times 4k for hero peaces. Unless you've some thing else in mind?

You may (If running a 32bit OS) be running into the 2gb buffer imposed for memory by such OS and thus Terragen is giving you an error or it could just be an undocumented bug in need of a fix! ;D

Regards to you.

Cyber-Angel

gregsandor

You can use .tif, .bmp, .png, jpg, and I think .tga at least.

gregsandor

#6
Quote from: Cyber-Angel on August 20, 2010, 10:12:30 PM
Can I ask why you need to use better then 8k resolution?

Because it's awesome.

So you can put the camera anywhere on the ground on a very large terrain and have the texture resolution hold up.
Film texture resolution is often higher than 4096.  It depends on what you're doing with it.  Those other sizes you listed don't sound like texture resolution to me, more like approximate frame dimensions.

Oshyan

There is no specific limit that I'm aware of, although the Free Image library we use may have its own limitations (if so then probably around 32,000x32,000). It is however limited by your system's available memory, and the fact that TG2 is currently a 32 bit application. Greg is also correct that TG "uncompresses" images on load, which is to say that it deals with images in memory uncompressed - as most 3D apps do that I'm aware of - so the absolute file size of your image is not what matters, it's the resolution and bit depth. If you have a 1000x1000 pixel image, there are 1,000,000 pixels in your image. If it is a 24 bit image (8 bits for Red, Green, and Blue), it will be 24 bits divided by 8 bits per byte = 3 bytes per pixel. 3 bytes per pixel times 1 million pixels is 3 million bytes or approximately 3 megabytes in memory (remember that a MB is actually 1024KB). So a 10,000x10,000 pixel image at 24 bit is going to be 100 million pixels, so approximately 300MB in memory. Clearly memory use quickly climbs with higher resolution images, especially when several are used at once. Reducing the size of the subdivision cache and/or number of render threads can help in situations like this, though it will affect rendering performance.

- Oshyan

jknow

Great advice, thanks folks. I don't know why it was failing for me, but the error messages were coming up each time I tried to load a new jpg. After a program restart it's fine.

I think a previous comment was confusing the output image dimensions with the aerial photography that I'm using. An image space / object space confusion methinks.

jknow

So what does this mean in terms of adding more images? Basically will TG2 uncompress them until we hit 2gb and then stop? Ie the bigger my heightfield, the smaller my image maps will need to be until I hit 2gb, is that right?

I can't wait for a 64 bit version. I'm using some BIG aerial photo imagery. I suppose I can created nested layers with the small extents of high res imagery, and larger extents of less high quality imagery as distance from the observer increases.

gregsandor

Quote from: jknow on August 21, 2010, 03:05:45 PM
I suppose I can created nested layers with the small extents of high res imagery, and larger extents of less high quality imagery as distance from the observer increases.

That is exactly right.  Additionally if you are zooming the camera lens to a particular mountain, you can turn on the target location high-res image too. 

jknow

Yes, good point. At the moment I've been putting my camera at the terrain centre and looking outward, but there's no reason the camera can't be floating elsewhere and looking at my highest quality terrain centred around 0,0

I confess I hadn't thought of that till now

gregsandor

If you wanted to use six vantage points, you could place a camera at each of them, and a high res orthophoto centered under the camera.  In the camera node you can copy the coordinates into your image map shader to speed up the process of setting it up.

If you're using Camera1, you can turn off all the other sites photos except Site 1 and the low-res base.  When you render from Camera2, turn on Site2 photo and turn off Site1, and so on.