I m trying send some 32 bit float data to a shader, but the results are erratic. If I test with full white (1,1,1,1) the values are all zero. This is my code for creating the texture:
gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA32F_ARB, 512, 512, 0, GL.GL_RGBA, GL.GL_FLOAT, data);
and reading from it in GLSL:
uniform sampler2D u_tex1;
varying vec2 v_uv;
void main()
{
gl_FragColor = texture2D(u_tex1, v_uv);
}
If i set the texture to random values something shows up, but it s not correct. Is this the correct way to read from an RGBA32F texture or am I missing something?