Sign in to follow this  
xerodsm

Cube mapping

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this