Archived

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

Maitrek

Realtime shadows

Recommended Posts

Argh - this really annoys me this problem. See - while i have a small clue as to how to do these efficiently in software mode, I still cant see any real effective way of doing it in hardware mode. In fact, I almost see it as more difficult to do in hardware than in software. As far as I can tell in software the best method to do it with perpective correction is to render the scene, preferably with a span buffer/BSP sort to eliminate the need of writing to a z-buffer, from the lights point of view and then basically "mark" the texels that are under shadow. However I don''t see any real way of doing this (or even any benefit from doing this) in hardware mode. Anyone else thought of anything to add to either software or hardware ways of doing realtime dynamic shadows?

Share this post


Link to post
Share on other sites
There are some good examples of realtime shadows that come with the directx api. One example shows how to do volumetric shadows. The other sample shows how to do shadows with a stencil buffer. Also, a while back somebody posted his dissertation on realtime shadow technology on this messageboard, you can search for it.

http://3d.n3.net/

Share this post


Link to post
Share on other sites
Thanks - I''ve recently decided that I''ll just have to use some unoptimised way of doing it in hardware, there doesn''t seem to be an efficient clean way in which to do this - I''ll just have to hit the processor/3d card.

Share this post


Link to post
Share on other sites
Can you explain me your code ?
I don''t see how you do that in software.
(Well it seems that you''re using a combination of stencil buffered shadows and projected textures.)

I know two techs (more than that but it''s not the purpose):
Volumetric shadows: It use stencil buffering and isn''t really good for mid/high geometry world.
(You have to compute the shadows plans equation...)

Projected shadows : You render as the light using only the Zbuffer. The Zbuffer is now a texture in greyscale.
You project the textures from the light sources to the scene.
(See the nvidia site for further details)

I think your software trick is in between the two isn''t it ?

I''m really interested in your solution so please tell me how you do it via email (click on the email icon) or in the forum.
thanks.



-* So many things to do, so few time to spend *-

Share this post


Link to post
Share on other sites