Can I unbind textures? If not, how else can I avoid this problem?

Started by
4 comments, last by Anachronism 21 years, 3 months ago
Hello, I was wondering if there was someway to unbind a texture. When I bind textures to surfaces, and then plot a pixel, that pixel is the color of the texture. For example, if I have a texture that is for the most part solid red... And then I do: glColor3f(1.0f,1.0f,1.0f); glVertex3f(bgstars.x, bgstars.y, -20); The pixel that is plotted will be red. When I specifically set it to white above. The same thing happens with other colored textures I have. The pixels plotted afterwards are the color of the texture… I looked through all the opengl functions and didn''t see anything that would unbind a texture… I did see about 6 functions that cleared things but I didn''t see anything for textures. Help would be appreciated! Thanks! -Dennis </i>
Advertisement
Couldn''t you just disable texturing? glDisable(GL_TEXTURE_2D);


"Im from Canada so they say im slow, eh"
I believe glBindTexture(GL_TEXTURE_2D, 0); also works. Might be faster than Disabling/re-enabling texturing. I''m not sure.

------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
_______________________________________Pixelante Game Studios - Fowl Language
Well... Yeh I suppose I could have done that if I would have thought of it!

Thanks very much for the help.

I appreciate it!

-Dennis
quote:Original post by Anachronism
For example, if I have a texture that is for the most part solid red... And then I do:

glColor3f(1.0f,1.0f,1.0f);
glVertex3f(bgstars.x, bgstars.y, -20);<br><br>The pixel that is plotted will be red. When I specifically set it to white above. </i> <hr height=1 noshade></SPAN></BLOCKQUOTE> <br><br>The thing is, you ARENT telling it that the pixel should be white. Youre telling it that it should use the full colour value from each sample taken from the texture. ie the texel lookup returns rgb 12,34,56 and youre using glColor3f(1,1,1), youre telling it to use rgb 1*12,1*34,1*56 (given that GL_MODULATE is used rather than GL_REPLACE). Therefore OpenGL is doing exactly what you asked it to do.<br><br> <br><br>———————–<br>"When I have a problem &#111;n an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
disabling is better than binding to 0 (defualt texture) which can lead to some unwanted sideffects

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

This topic is closed to new replies.

Advertisement