Archived

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

ImNotTheOne

zbuffer shadows

Recommended Posts

ImNotTheOne    122
Well I think my previous post was too hard to read and mostly crap so I decided to write a new one: algorithm for zbuffer shadows: Render the scene from lights point of view and store the z values in depthbuffer. Then render the scene from the camera view. But for each pixel do: Trasform it''s position to the lights view space. Compare transfromed positions zvalue and the value in the sameplace previously written to depthbuffer. If the value is further than the one in depthbuffer this pixel is in shadow. I''m doing this in direct3d. I have the stored z info in textures alpha channel. Then I need to do the second part. By using D3DTSS_TCI_CAMERASPACEPOSITION we can get the coordinates of the vertex to r, s, t. But what is the texturematrix that traslates these to 2d coords that can be used to index that depthmap the right way? If I''m still confusing you out, just ask and I''ll try to explain.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
This is really intresting!
Maybe any working samples or sources???

Share this post


Link to post
Share on other sites
ImNotTheOne    122
Anonym:
You can find documents about zbuffer shadows
for example from flipcode. There is also a working opengl sample
at nvidias developer page.

btw. It seems that the hardaware implementation of this technique is called shadow mapping.

Share this post


Link to post
Share on other sites