Jump to content
  • Advertisement
Sign in to follow this  
dpadam450

amateur doing shadow maps

This topic is 4459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!