Archived

This topic is now archived and is closed to further replies.

Anachronism

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

Recommended Posts

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[i].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

Share this post


Link to post
Share on other sites
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..."

Share this post


Link to post
Share on other sites
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[i].y, -20);

The pixel that is plotted will be red. When I specifically set it to white above.



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.



-----------------------
"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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites