Hi, Im trying to reach float values from a texture in GLSL using
texture(sampler2d, texCoord).x
I use luminance16, clamp to edge and nearest filter before I send it to the shader. I create the texture in this way
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
if(x == 25 && y == 25)
texData[y*width + x] = static_cast<GLubyte>(1.0);
else
texData[y*width + x] = static_cast<GLubyte>(0.0);
}
}
and then I try to reach the value 1.0 by
texture(sampler2d, vec2(25)).x
is it possible to do it this way or am I missing something.
Thanks in advance!