I load a texture with grayscale image using GL_LUMINANCE format.
when i use float NP = texture2D(input1, textureCoordinate).r; in the fragment shader the program fails.
is it possible to read the pixel grayscale value or am i limited to work with 4 channels only?
Sure. Here is some GL code the loads a “height map” (grays levels stored as
float‘s).The texture is stored in unit 0.
Here is the pertinent code from my vertex shader. The uniform
HeightMapis 0 (unit 0).Works like a charm.