Quote:Original post by purpledog
You need to bind the uniform to the active texture as well.
A texture is bound to a "sampler" (I'm not sure of the terminology here), and the sampler is bound to a uniform... And you missing the last step.
In your example, it's going to be something like:
glUniform(locationLeft,0);
glUniform(locationRight,1);
You can get the location using glGetAttribLocation.
Just to make things double clear, you are actually playing with 3 numbers here:
- the texId
- the active texture (or sampler)
- the uniform location
And you "just" need to bind them all (in the darkness if you wish)
I see, thanks for the info. But... it's not working. Shouldn't:
Gl.glActiveTexture(Gl.GL_TEXTURE0);
Gl.glEnable(Gl.GL_TEXTURE_2D);
Gl.glBindTexture(Gl.GL_TEXTURE_2D, leftEye);
Gl.glUniform1i(Gl.glGetAttribLocation(p4, "left"), 0);
Gl.glActiveTexture(Gl.GL_TEXTURE1);
Gl.glEnable(Gl.GL_TEXTURE_2D);
Gl.glBindTexture(Gl.GL_TEXTURE_2D, rightEye);
Gl.glUniform1i(Gl.glGetAttribLocation(p4, "right"), 1);
do it?
/MindWipe