[gameprogrammer] Re: culled objects and shadow volumes

On Tuesday 28 April 2009 18:42:11 Alan Wolfe wrote:
> That is some pretty good advice, thanks Sami.
>
> I found this late last night and this technique talks about expanding the
> view frustum and then doing regular object culling so you don't have to
> create the shadow volumes or test which direction the shadows will be cast.
>
> http://www.gamedev.net/columns/hardcore/shadowcast/
>
> I'm going to have to look at the pros and cons of your method vs this
> method and see which makes more sense for my game cause I was thinking this
> article was the best way, but now im not so sure (:

It really depends on the light positions and types of the lights you use. If 
all the lights have short intencity fallout radius then adding that maximum 
radius to the frustum is enough and this is easier to the CPU, but it will 
stress the GPU more.
If the light sources are always quite a bit higer than the objects then 
extending the frustum might be an option regardless of the intencity fallout 
radius.

The thoughest cases are the ones where long shadows are generated from the 
objects that are nearly in the same level as the lights. the toughest example 
would be sun set and sun rise. Also all kinds of columns are potential long 
shadow producers.


Also consider that the idea of checking the smallest distance to the frustum 
position on the OL line is not full proof when the OL line is nearly parallel 
with the frustum. In the extreme case the OL line can even go away from the 
frustum and still the shadow volume would intersect the frustum. But these 
cases can be handled separately if such cases exist. These come in to play 
when the light source is near an object as this heavily alters the shape of 
the objects shadow volume. This can be solved by simply calculating the same 
condition used in the single test individually for the furthest and the 
nearest point in the OL line that has a perpendicular point in the frustum.
If either test is true then the shadow volume will intersect the frustum. The 
nearest position of course can't be closer to the light source L than the 
object O itself.
Also there might be extreme cases where the whole frustum is inside the 
objects shadow volume. This means simply that we don't use the light source 
for this scene.


So it might be better to implement both methods and use one of them depending 
on the combination of the light source and the object.

> Thanks!

Clad that I could help you.


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: