amateur doing shadow maps
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.
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!
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!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement