tags:

views:

741

answers:

2

There is this tutorial about shadow mapping: http://www.paulsprojects.net/tutorials/smt/smt.html

Ok, but I did not realize how to make a scene with multitexture.

If in the third pass of shadow mapping It is need to bind the shadow mapping projected texture to perform depth comparison, HOW can I bind another textures if I need to bind the shadow mapping texture?

Must I set shadow mapping as a separate texture to be bind? Something like this:

  1. Active shadow mapping texture
  2. Active texture 1
  3. Active texture 2

I tried that but it did not work (maybe I've done something wrong).

+1  A: 

Just to clarify, you have a pre-existing multi-textured scene you want to shadowmap?

If so, activating all your texture units should work (if you have enough, I think the OpenGL 1.4/1.5 spec only calls for a minimum of two; check GL_MAX_TEXTURE_UNITS_ARB via glGetIntegerv()). If you don't have enough texture units you'll have to use multi-pass rendering/blending.

genpfault
Yes I have a multi-texutre scene and I want a shadowmap, but the doubt is not about the max supported (my card supports 4), but about the shadow mapping application itself.Must I active the shadowmapping in a separate texture unit?If so, this shadomapping tex unit, must be the first or the last?
Ah, got it. I'm pretty sure the shadowmap texture needs a separate texture unit, and that it should come after the other texture units.So in order, Active Texture 1, Active Texture 2, Active Shadowmap Texture
genpfault
A: 

yes, for the depth comparison pass, the shadowmap should be bound on a separate texture unit. don't forget to also enable/disable texturing after activating the unit.

clamp