Hi,
I’m experiencing troubles when trying to bind a texture unit… this is very basic code
This works IF I leave glActiveTexture(GL_TEXTURE1_ARB) before glActiveTexture(GL_TEXTURE0_ARB) ; black screen if I don’t.
glActiveTexture(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, depth_tex);
glActiveTexture(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, depth_tex);
glEnable(GL_TEXTURE_2D);
this produces a black screen :
glActiveTexture(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, color_tex);
glActiveTexture(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, depth_tex);
glEnable(GL_TEXTURE_2D);
So I thought this was a problem during the initialisation of color_tex ( which is, btw, rendered to in a previous pass ), but I can’t see anything wrong ( maybe the internal format, but it doesn’t changes anything ) :
glBindTexture (GL_TEXTURE_2D, color_tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,512,512,0,GL_RGBA,GL_FLOAT,0 );
I don’t know if it changes anything, but I’m rendering a VBO without any texture coordinates into a FBO ( this is also the way I rendered color_tex & depth_tex )
Does anyone see something I’m doing wrong ?
Thanks !