Cube mapping
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.
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.
Having a skybox with 6 different textures? Use the cubemap for that, too.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement