[osg-users] Accessing floating point textures in Fragment Shader

Harash Sharma harashsharma at yahoo.com
Fri Oct 17 00:28:30 PDT 2008


Hi all,
 
    I am facing a problem in accessing the floating point texture within a fragment shader. I have some 2D floating point array that I wish to access within the Fragment Shader. For the purpose, 
1. I have created an image with the pixel format GL_LUMINANCE and data type of GL_FLOAT. 
2. The Array data is copied to the Image data array.
3. The image is bound to a texture and this texture passed as uniform to the Fragment Shader.
 
The output is a totally white screen.
 
However, if I modify the Pixel format to GL_RGBA and the datatype to GL_UNSIGNED_BYTE and convert the values to integer and split the 4 bytes of unsigned int into R,G,B,A, I am able to reconstruct the values within the shader and process the fragment accordingly. 
 
I am using nVidia Quadro Fx 4500 graphics card on Intel Xeon 5160 processor. 
 
Please Guide
 
Regards
 
Harash.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20081017/32abaed2/attachment.htm>


More information about the osg-users mailing list