Jump to content
  • Advertisement
Sign in to follow this  
xerodsm

Cube mapping

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!