TX files

Started by digitalguru, July 27, 2021, 04:58:12 PM

Previous topic - Next topic

digitalguru

I discovered by accident that Terragen reads .tx image files (generated in Maya/Arnold from .png)

Does that mean Terragen can take advantage of .tx files that are mipmapped for memory management?

WAS

Isn't .tx just an arbitrary format? It holds the data for either JPG/PNG/BMP/EXR/TIFF with their respective format headers? So Terragen is just reading a "PNG" image for example.

Similar to if you renamed image.jpeg to image.notaimage it's still going to look for the appropriate header information, which is JPEG, and load that info.

digitalguru

#2
Quote from: WAS on July 27, 2021, 07:18:47 PMIsn't .tx just an arbitrary format? It holds the data for either JPG/PNG/BMP/EXR/TIFF with their respective format headers? So Terragen is just reading a "PNG" image for example.

Similar to if you renamed image.jpeg to image.notaimage it's still going to look for the appropriate header information, which is JPEG, and load that info.

You're absolutely right, but the conversion to .tx also mip-maps the texture - so it stores decreasing levels of resolution by powers of two - so when rendered an DCC renderer (Arnold for instance) can pick a lower rez version of the texture depending on the distance from the camera - textures then load faster and take up less memory. This could be very useful for populations for instance.
I'm tending to think Terragen doesn't do this or it might be listed as a feature. It may be that Terragen has other methods of managing texture memory that might exclude this being useful.

I'm currently writing an app that (amongst other things) converts Maya shaders to the Terragen default shader - if there is no advantage to keeping the .tx file attached to a shader, then I'll include a function to hunt for the original file the .tx was converted from (as keeping a .tx raises other issues)

Matt

At the moment (Terragen 4.5) we don't have dedicated support for .tx files. I wasn't aware that Terragen could load them. Maybe they are handled by the FreeImage library that we use. If that's true, mipmapping would be ignored and the tiled memory layout would be lost when converting to our internal texture representation which is currently flat. But perhaps it would be useful to do some benchmarks on very large files to see if there are other advantages to .tx over other formats.
Just because milk is white doesn't mean that clouds are made of milk.

digitalguru

Thanks Matt, that's good to know.

That's not a problem, if a .tx was passed to Terragen it would almost certainly be linearised and I just want to pipe it into a Default Shader. If there was a performance gain from loading the .tx - it would be worth setting up an image map shader to keep the color .tx maps linear.

Easier to just find the original sRGB file instead, which was the original plan.