Using float values for textures
Posted by
Scyla on
URL: https://forum.jogamp.org/Using-float-values-for-textures-tp4025119.html
Hi there,
In my jogl application I want to use pixel data I get from OpenExr Images (16 or 32 bit float values). I already wrote an application that stores the values in a java.nio.FloatBuffer in the order red, green, blue, alpha, red... and so on and so forth.
From there on I would like to create a texture as show in this example:
http://http.developer.nvidia.com/GPUGems/gpugems_ch26.htmlBut It wont work properly with this jogl call:
gl.glTexImage2D(GL2.GL_TEXTURE_2D, 0, GL2.GL_FLOAT_RGBA32_NV, textureHDR.getWidth(), textureHDR.getHeight(), 0, GL2.GL_RGBA, GL2.GL_HALF_FLOAT, textureHDR.getPixels());
I'm sorry if this is a stupid question but it seems that people rarely use FloatBuffer for the pixel data so I found no example how to do it correctly.
Unfortunately I can't include a working example because the loading of the pixel data is done via a dll that I wrote to access the ILM OpenExr library from a java program but I will add the java files to this post.
Greetings
OpenExrTextureTest.javaJoglApp.javaOpenExrReaderMain.java