Archived

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

Depth based shadow maps

This topic is 5437 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 understand how to render them with to a depth texture and all but somehow I''m missing how exactly you check per-pixel to see if the depth from the light is greater then the depth stored in the texture, every artical I''ve seen mentions that opengl extension but never how its done in directx?

Share this post


Link to post
Share on other sites
I think you mean Hardware Z shadows,like in the directx nvidia sample(effectbrowser).
They render the view of the light.
Then they set up a Projection matrix for the Texture(is a Z-Buffer) and project it on the scene.
The test is automatic, and the whole trick is in the Projection matrix in the z row, it sets the two spaces equal. So if something is in the way the Z Value in the Scene Z-Buffer is different it is shadowed.

Share this post


Link to post
Share on other sites
I''m still unclear as to how the the depth texture rendered from the view of the light is used in when you render the scene normaly. If you messing with the z row of your projection matrix arn''t you going to mess up the order you polys are rendered? I''m trying to impliment it for a directional sun light in a rts game

Share this post


Link to post
Share on other sites
It is not the rendering projection matrix it is the texture matrix. If you have a geforce3 or geforce4 ti you can look at the sample.
But for other hardware there is a sample from ati for dx8.1 and dx9 hardware.
They use color channels for the deep, because radeon has no Hardware shadowmaps.

Share this post


Link to post
Share on other sites