Cube mapping

Started by
2 comments, last by dpadam450 17 years, 1 month ago
I've done quite a bit of reading on the subject and I definitely understand the concept and how it should all work. The problem I'm having is that the 6 textures that I'm using for the cube map are already loaded into GLuints as textures and that's how I use them to draw the cube map and such. Well, of all the sample code I've seen in regards to cubemaps I tend to see this bit of code: glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); Where NULL is the data set for the texture info. Well my problem is I already have the textures loaded up so is there any way I can set the GL_TEXTURE_CUBE_MAP_POSITIVE_X to my texture? I tried glBindTexture(GL_TEXTURE_CUBE_MAP_POSITIVE_X,Sky::instance()->textures[0]); but that didn't work, unless I am doing something else wrong.
Advertisement
AFAIK you can't bind a texture object to a cubemap face. If you need to use a cubemap why don't you load the textures into the cubemap's faces instead?

Having a skybox with 6 different textures? Use the cubemap for that, too.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Do you possibly have a link to a tutorial or something on cube mapping? I'm not quite sure how to load up my image into a cube map as you suggested.

Thanks
http://developer.nvidia.com/object/cube_map_ogl_tutorial.html

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement