PDA

View Full Version : Accessing texture data



yossi
05-17-2004, 02:13 AM
Hello all,
It is my first question in this forum (I am a newbie in shaders) so excuse me if this was asked before or if it sounds stupid.

I define a luminance 16 bits texture and render it OK.
The problem is that I want to make some process on the 'raw' 16 bits data of the texture. When accessing the data through texture2D API I get the gray level color (vec4) and not the 'raw' data of the texture.
Is there a way to get this data? Is my understanding totally wrong about this texture issue?
Many thanks,
Yossi

V-man
05-17-2004, 08:46 AM
You should have a look at the document at 3dlabs pages for GLSL, and also the gl 1.5 spec

texture2D and the others return vec4, which means the components are always scaled within 0.0 to 1.0 except for float textures.

In the case of luminance, the red component will have the luminance value.