views:

692

answers:

3

After making a few changes in my application, my textures are no longer showing. So far I've checked the following:

  • The camera direction hasn't changed.
  • I can see the vectors (when colored instead of textured).

Any usual suspects?

+2  A: 

You may want to check the following:

  • glEnable(GL_TEXTURE_2D); presence

  • glBindTexture(GL_TEXTURE_2D, texture[i]); and glBindTexture(GL_TEXTURE_2D, 0); when you don't need texture anymore

dragonfly
Even though I had both these, the issue still wasn't resolved. After doing some heavy refactoring, it started working again. I suspect it was perhaps a translation issue, but thanks for the suggestions anyway; I have accepted this answer as it has the highest upvotes! :)
nbolton
I did have a problem with my textures, and calling `glEnable(GL_TEXTURE_2D);` fixed my problem. Thank you.
Hooray Im Helping
+1  A: 

A few more things to check:

  • glColorMaterial(...); To make sure colors aren't overwriting the texture
  • glEnable/glDisable(GL_LIGHTING); Sometimes lighting can wash out the texture
  • glDisable(GL_BLEND); Make sure that you're not blending the texture out
  • Make sure the texture coordinates are set properly.
Andrei Krotkov
A: 

Does a glColor3ub(255,255,255) before rendering your textured object help? I think the default OpenGL state multiplies the current glColor by the incoming texel; a stray glColor3ub(0,0,0) will make all your textures look black.

genpfault