Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the usual troubleshooting steps for OpenGL textures not showing?

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?

like image 471
Nick Bolton Avatar asked Apr 11 '09 14:04

Nick Bolton


People also ask

How do you show textures in OpenGL?

in display() function : GLuint texture; texture = LoadTexture("bubble. png"); glBindTexture(GL_TEXTURE_2D, texture);

How do OpenGL textures work?

A texture is an OpenGL Object that contains one or more images that all have the same image format. A texture can be used in two ways: it can be the source of a texture access from a Shader, or it can be used as a render target.

What is OpenGL texture mapping?

1.0 Introduction. Texture mapping is a process of stretching a texture onto a 3D object; the applied texture will follow the 3D object as it transforms. Texture mapping is fun and beneficial but it can be challenging for beginners. Texture can also be distorted for a visual effect.

What are texture coordinates used for in OpenGL?

Texture coordinates specify the point in the texture image that will correspond to the vertex you are specifying them for. Think of a rectangular rubber sheet with your texture image printed on it, where the length of each side is normalized to the range 0-1.


1 Answers

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

like image 69
dragonfly Avatar answered Sep 17 '22 04:09

dragonfly