   Disabe Textures in GLSL
  I am writing a shader to do per fragment lighting.  Everything is working well except that I can't turn textures off.App Code:glEnable(GL_TEXTURE_2D);glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);glActiveTexture(GL_TEXTURE0);glBindTexture(GL_TEXTURE_2D, texture.TexName());DrawTorus(...);glDisable(GL_TEXTURE_2D);DrawTorus(...);When rendering with the fixed pipe, I get a textured torus and a torus with the previously defined material.in my shader, I get two textured tori.  I tried adding the lineglBindTexture(GL_TEXTURE_2D, 0);before my second torus call, but my shader spit out a black torus.here is the code in my fragment shader, ala Rost:// calculate diffuse with multiple lightsdiffuse *= texture2D(Tex, gl_TexCoord[0].st);I would like to query the current state from my shader to determine if 2D textures are enabled.Any ideas?TIAJ   
  You can't do that. You'll have to make your own variable, and pass it into the shader.   ;  You should be able to query the state of the FF setup in a shader, but I forget the exact syntax (and I havn't got my orange book on me). However you might want to look at this.;  glEnable(GL_TEXTURE_2D); + disable are ignored with glsl, ie u cant enable or disable texture units (if u dont wanna use one then dont access it) Quote:I would like to query the current state from my shader to determine if 2D textures are enabled.u will have to pass this info to the shader yourself as a uniform   ;  I too faced with the same problem of accessing texture state in the shader. For the time being i'm using uniforms for that purpose.