How do you combine the shadow map with image textures?


I’ve got a shadow map working on some objects and they successfully cast shadows on each other. However, when I try to add image textures to the objects the images seem to override the shadow textures. For example, I initially call:

glBindTexture(GL_TEXTURE_2D, shadow_map_texture);

but when I call:


the shadows disappear. I am new to shadow mapping. Any ideas would help. Thanks!

If you wish to use 2 textures simultaneously you have to bind to different texture units. With fixed function code you use

glBindTexture(); //  - texture 1
glBindTexture(); //  - bind texture 2