Archived

This topic is now archived and is closed to further replies.

Having problems with Z-buffer shadows

This topic is 5017 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

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.

Share this post


Link to post
Share on other sites