Binding a zero texture in OpenGL
问题 In my program I use 2 textures: t0 and t1. t1 is additional, needed only in some cases: ..... glActiveTexture ( GL_TEXTURE1 ); if ( mDisplayMode == EDM_DEFAULT ){ glBindTexture( GL_TEXTURE_2D, 0 ); // In this case I don't need t1 }else{ glBindTexture( GL_TEXTURE_2D, mglDegreeTexture ); // In this case t1 will overlap t0 } shader->setUniformValue( "textureId1", 1 ); Shader for drawing: ..... vec4 c1 = texture( textureId0, uv ); vec4 c2 = texture( textureId1, gridUV ); float a = c2.a; gl