-
examples textures - help me understand something
I am trying to understand what is going on with textures in the many examples I see online and why my image is blanking out. Below is a typical example of the code I find. When I uncomment the first glBindTexture call with the textureId param the image produced by glTexImage3D goes blank. I'm not sure what I'm binding to what and what that has to do with the following glTexImage3D command and why the binding is fouling the image up. Can anyone explain? Why in the many examples do you bind the texture to zero (0) after the glTexImage3D command?
--- 8< ---
GLuint textureId;
glGenTextures(1, &textureId);
// uncomment to black out image
//glBindTexture(GL_TEXTURE_3D, textureId);
glTexImage3D(GL_TEXTURE_3D, 0,GL_RGBA8 , WIDTH, HEIGHT, DEPTH, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glBindTexture(GL_TEXTURE_3D, 0);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules