Skip to main content
GameDev.net gamedev.net
🔒 Locked

Cube mapping

Started by xerodsm Mar 1, 2007 at 2:22 PM 2 replies 700+ views
Original Post
xerodsm
xerodsm
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.
Lord_Evil
Lord_Evil
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!
xerodsm
xerodsm
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
dpadam450
dpadam450
http://developer.nvidia.com/object/cube_map_ogl_tutorial.html
NBA2K, Madden, Maneater, Killing Floor, Sims 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.