View Full Version : working with floating point textures

Ehsan Kamrani
02-14-2007, 12:37 AM
I sent this question to the beginner forum and gamedev forum. But I didn't get a good response. I know that OpenEXR format support 16 or 32 bits per channel and it has a plugin for Photoshop. However I can not use the Photoshop tools when I set the image to 16 bits/channel. If there's no editing tool to generate floating point images, why does OpenGL support floating point textures?Is it for future? Someone said me that processing the floating point textures is very slow.Is it correct? Has it worth to use floating point textures while a computer monitor support 8 bits/channel?

02-14-2007, 02:34 AM
Ehsan, floating point textures as images have their use only when you use HDR techniques. They are also useful if you want to represent non-image data with high range. Processing of such textures is slow, because they are much larger and often support no filtering. About your Photoshop issue, I can't help you, as I never used it...

02-14-2007, 02:59 AM
FP16 textures are normally used as render targets as it allows for better post processing than 8 bit, it is also not that slow as you might think.
FP32 textures will be used as render targets in the future, but for now they are normally used for passing floats to and from the shaders.

Photoshop does have a tool for making 16 and 32 bit images(at least in cs2), and the clone brush still works.
Photoshop cs3 that will be released in the near future(read: any minute now) will have full 16 and 32 bit compatibility for all tools.

But until cameras start taking HDR images, 8 bit textures will still dominate a while longer.

Ehsan Kamrani
02-14-2007, 05:52 AM
In Photoshop we have a technique called "Merge to HDR". We should work with 32 bit channels to merge the images together and then convert the final image to a RGB8 file( 8 bits per channel ).
It has worth to work with floating point images in Photoshop. But what about the games? In games we don't need to merge different images with different exposures together. The final texture is converted to a 8bits/channel. So has it worth to use floating point textures? What techniques does it offer?

02-14-2007, 06:09 AM
Google for HDR :-/

02-14-2007, 06:12 AM
Visit developer.nvidia.com and download the SDK or the individual examples.
Alternatively, try games like HL2 whih do HDR. Download the Lost Coast map.

02-14-2007, 07:11 AM
Imagine you render sky with sun and some white airplane and then you cover it with lot's of smoke with 90% alpha.
If you render that to 8-bit screen, then when applying smoke both objects are the same (both white) and after applying smoke they are still the same (dark gray). In real life, airplane would be barely visible, but sun would still be bright.

When rendering to floating point render target you can make the sun be 100 times brighter than white. After covering it in 90% by smoke it remains 10*white.

That's the whole idea of HDR - not restricting ourselves to black-white range.

Floating point textures are also usefull for simulations running on GPU (fluid dynamics, particle systems).

Ehsan Kamrani
02-14-2007, 07:54 AM
Thank you. It was a great example. Now I understand the meaning of the floating point textures :-)