3

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
  • I am new with OpenGL, and I have the same problem as author with the same tutorial. I don't understande everything about what you wrote, and I would like to ask you for help with this issue. Could some one send me a simple source code how to use textures for example for floor in this tutorial. Thanks Regards
    – user1094785
    Dec 19, 2011 at 3:14

2 Answers 2

1

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.

2
  • 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?
    – okami
    Apr 17, 2009 at 3:10
  • 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
    Apr 17, 2009 at 15:24
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.