-
Textures from Bitmaps
I have a project that creates textures from bitmaps. I'm trying to run on Mac, and when I follow the example code from NeHe Tutorial 6 all my textures show up with only shades of blue. (Note, I'm trying both the MacOS X and Linux versions listed at the bottom.)
-
Advanced Member
Frequent Contributor
Re: Textures from Bitmaps
Probably wrong order of color channels. Try to set value 0x80E0 as the format parameter of function glTexImage2D(), if you are using 3-channel bitmaps, or 0x80E1 for 4-channel bitmaps. Those are the hexadecimal values of predefined constants GL_BGR/GL_BGR_EXT and GL_BGRA/GL_BGRA_EXT respectively.
-
Re: Textures from Bitmaps
I tried swapping the constant for GL_BGR instead of GL_RGB, but it didn't change anything. I did notice a few other things thought. First, if I try to load a texture that for some reason is broken somehow, then the object just shows up in solid blue. Sometimes, however, when there's an issue reading the texture file, I have default colors assigned to the objects, and they show up as a mixture of the texture and the default color for that object (in exactly the same way as with the blue). So it looks like the texture is loading, but the objects are also being displayed with some default color blended together with the texture. I've tried disabling blending with no success.
-
Super Moderator
OpenGL Lord
Re: Textures from Bitmaps
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