I am trying to use a 1D array as a lookup table in my vertex shader. Therefore when i call
texture1D(tex,gl_TexCoord[0].s);
does it return vec4? I mean, I know what he does, but what are the 4 meanings? All I want is a single value from a coordinate based texture.
Since 1D texture can / have RGBA values (red, green, blue, alpha). If you save 1D texture data on the red channel (GL_RED), you can access this data with:
texture1D(tex,gl_TexCoord[0].s) .r;
texture1D(tex,gl_TexCoord[0].s)
.r