cube environment mapping

Hi, I am using cube environment mapping using openGL extensions on my Geforce card according to the Nvidia examples.
I noticed that I cannot preload the cube’s textures and “bind” them to the cube later so that different objects have different cube environment maps but I must load the textures from scratch if I want to change the cube.
Is it possible to preload the textures and use glBindTexture later and if not how do I delete the cube’s textures from memory (so that I can load new ones) [or are they automatically replaced by the new ones in memory???]

Thanks in advance

Yes it is possible to pre-load them and just use glBindTexture. Make sure the target for bind texture is the Nvidia extension label for cube maps, not TEXTURE_2D.

The standard method for deleting textures should work fine (AFAIK). I have some sample source code for creating dynamic cube maps. If you want it mail me at

I have tried both GL_TEXTURE_2D and the appropriate Nvidia extension but I get nothing. The only solution is to directly load the texture to memory and this is what nvidia does in the examples.

It is most definitely possible to use glBindTexture for cubemaps. You’ve probably missed something in the code…

  • Matt


You can’t “bind” a cubemap’s images individually. You bind a cubemap texture object, and it restores all cube face images and all mipmap levels.

It sounds like you’re thinking that each face is bound individually, which is definitely not the case.

Hope this helps - but if not, you can contact me offline.


I understand what you mean Cass, but could you gimme some sample code? Should I use glBindTexture for the whole cube and if yes what parameters should I pass?

If you can post your email so that I can contact with you? [Maybe]


Yes, my email address is, and there are some examples on the nvidia developer web site that illustrate using cubemap texture objects. I also have some c++ helper classes for cubemap objects in the glh library that is available with a number of the demos.

Thanks -