Re: Using float values for textures

Posted by Scyla on
URL: https://forum.jogamp.org/Using-float-values-for-textures-tp4025119p4025218.html

Tanks for your post Sven and I'm sorry I couldn't respond earlier because I was not at work.

I think my problem needs further explanation.

You’re right I about the half data-type but there is no OpenExr library for Java so I wrote a dll that gives me the pixel values as floats because I cast them in the c++ program from half to float (which is lossless according to the OpenExr docs). So now I have already a FloatBuffer with the pixel values as Java floats (they range from 0.0f to 1.0f).

The question is: how to tell jogl to use this data from the FloatBuffer as pixel-data for a texture?

If I do understand your post correctly then the nvidia example casts the half values into an unsigned short. So is there a way to use the float values directly or do I have to use short values?

I would rather not use a short buffer because then I lose the benefits of having HDR-images as texture-data (i.e. a greater dynamic range). I guess I would still have some advantage over byte values because of the larger range of the values but I would prefer to use float.

Thanks for your efforts in advance.

Greetings