texture mapping problem

Every thing that I’ve texture mapped appears white - how can I sort this out?


Sounds like possibly the texture isn’t getting loaded. Some things to check.

  1. The textures should have dimensions that are a power of 2 (i.e. 1,2,4,8,16,32,64,128,256, etc.) If you are using gluBuild2DMipMaps it scales this for you so you don’t have to worry about it.

  2. Make sure you don’t try loading the textures until AFTER you have an initialized window. (All the pixelformat stuff has to come before the glTex* stuff. Or if you are using glut you can’t use the glTex* stuff until after you have called glutCreateWindow.)

  3. Make sure you are setting up your texture coordinates correctly. If you are using the same texcoord for everything, you’re only going to get 1 pixel of your texture mapped to the whole face.

  4. Make sure you are setting up the TexParameters correctly. If you aren’t using mip mapping, then set GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER to GL_LINEAR or GL_NEAREST. (By default these are set to a mipmapping parameter, I believe.) For GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T use either GL_CLAMP or GL_REPEAT)

[This message has been edited by Deiussum (edited 06-08-2001).]

-Do you enable the texture2D capability ?

  • Do you bind it ?
  • What is your texEnv mode ?
  • Is your image power of two ?
    etc, etc…