Having problems with Z-buffer shadows

Started by
-1 comments, last by Gestalthalcyon 20 years ago
I''m trying to implement Z-buffer shadows like they suggest in this article http://www.gamedev.net/reference/articles/article1300.asp . I''m having trouble getting all the projections and unprojections to work out right though. I''m reading the depth buffer from the light''s perspective as well as the projection matrix, modelview matrix, and viewport. After clearing the framebuffer, I then render the scene from the camera''s perspective reading the same data. I need to know how exacally to transform the screen coordinates from one depth buffer to the screen coordinates of the other one so that I can compare them. I''m currently trying to gluUnProject them from one buffer and then gluProject them onto another one, but I think I''m missing a step because it doesn''t work right. If you know the right way to do this please post. Or, if you know where I can find source code to an example that uses this method of shadow, please post that as well. I''m purposly using the method for shadows, so please don''t post suggestions for better and entirly different methods. Thanks for any help.

This topic is closed to new replies.

Advertisement