amateur doing shadow maps

Started by
2 comments, last by dpadam450 18 years ago
Don't have CG classes until next year but I would hope to do some shadows in a game this summer. Does anyone know of any good documentation on how depth buffers work/ how they are layed out in memory? Does each pixel have a depth? Let me know if I'm wrong about this but it sounds like I project the depth buffer from the lights source onto the depth buffer from the users point of view.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Advertisement
there are many many examples on this.

0) clear screen
1) render scene from the light source
2) copy depth into texture (glCopyTexImage2D with GL_DEPTH as source)
3) clear screen
4) google for projective texturing - transform matrices,
5) setup texturing with the depth texture
6) enable shadowfuncs or do the compare part in a shader
7) render original scene

you can speedup the depth tex thing with fbos.

google for it and the red book has an excellent example on this!
There is a great tutorial about Shadow Mapping :)
--
OK I've probably spent like 2 hours looking at this shit. Now when I save the lights view as a depth texture, each pixel in the texture holds info on how far it is from the light. Do I take that vector and transform it into the cameras depth buffer for every single pixel?

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement