Hello Keyan,

On 11/29/2011 08:14 AM, Keyan wrote:
> I have the following problem. In my application, the object of interest may 
> move from the center of origin far enough, to leave the area in which the 
> ShadowStage operates as desired. The shadow map size is set to 1024, the 
> objects are created small enough, such that the rendering works properly 
> around the center of origin.
>
> Here is an image of what happens, when the object moves to far from the 
> center:
>
> http://www.picpaste.com/screenshot-67ldo1Ma.png
>
> If it moves faster, it enters a region, in which everything is covered by a 
> shadow. Right before that, the shadows are projected into infinity (this can 
> be seen in the image). This area is left, no shadow is calculated anymore. I 
> guess this is because the shadow map is created around the center.

when generating the shadow map it should pick a projection that is large 
enough to contain the entire scene (that is: all children of the 
ShadowStage).
What type of light source (point, directional, spot) are you using? Is 
any part your scene not a child of the ShadowStage?

> So my question is, can I move it with the camera, such that the shadow is 
> only casted in the camera frustum?

IIRC it uses the bounding volume of the ShadowStage's children to 
calculate the projection. One thing you could try is marking that 
bounding box as static and then set it manually to contain the camera 
frustum.
One problem with algorithms that focus the shadow map on the camera 
frustum in this way is that shadow edges become very noisy. The 
projection changes all the time so instead of usual steady jagged (or 
somewhat blurred) outline you get one that is constantly changing which 
is quite unpleasant.
The article "Practical Cascaded Shadow Maps" in the book Shader X7 has a 
solution: it ensures that changes between frames essentially happen in 
"whole pixels" of the shadow map so that the rasterization does not 
change radically between frames.

        Cheers,
                Carsten

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to