Turning texturing off.

Started by
5 comments, last by Mulligan 22 years, 1 month ago
Here is what I want to do: 1) Render a quad using a texture 2) Render another quad without any texture What I run into when I try to do this is that the texture I assigned to the first quad also applies itself to the second. Is there some glTurnTextureOff function that I can use to turn texturing off when rendering some polygons?
Advertisement
glBindTexture(GL_TEXTURE_2D,0); will "unbind" the texture.

You could also call glDisable(GL_TEXTURE_2D), then re-enable it after.

I''m not sure if there''s a significant performance difference between the two approaches, but they both work.
"There is only one everything"
glDisable(GL_TEXTURE_2D) is better than glBindTexture(GL_TEXTURE_2D,0);

in fact i discourage binding to texture 0


http://uk.geocities.com/sloppyturds/gotterdammerung.html
why is that?
Because that tells the graphics card "I'm done with that texture, you can unload it if you wish (i.e. if you need the memory)". Which can give you a performance hit as the card loads/unloads the texture every frame (extreme case, but could perfectly happen).

Disabling the texturing with glDisable() is much faster : you tell the card to just skip the texturing phase which reduces the processing required.

Edited by - Fruny on February 26, 2002 4:33:17 PM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
also if u wanna disable texturing which seems the more logical to use
also perhaps texture 0 will not always remain a plain white texture perhaps (like i do) if u pass an invalid texture u get a checkered pattern texture which really sticks out
(not explained well by me)

http://uk.geocities.com/sloppyturds/gotterdammerung.html
Ah, very helpful. Thanks.
-Dan

This topic is closed to new replies.

Advertisement