I finally find the reason of my second issue (the shadow disappears some
time, because of the view matrix computation from the light) and already
submit a patch for both problems. Now I'd like to try to work out a more
comfortable shader solution for this great shadow technique and see if it
could make the life better. :-)

Wang Rui


2012/3/14 Wang Rui <[email protected]>

> Hi Robert,
>
> Some comments on my last post. It may not be a projection matrix
> problem... I've found that in the ViewDependentShadowMap.cpp file, 
> implementation
> of class ComputeLightSpaceBounds:
>
>     void update(const osg::Vec3& v)
>     {
>         if (v.z()<0.0f)
>         {
>             //OSG_NOTICE<<"discarding("<<v<<")"<<std::endl;
>             return;
>         }
>         ...
>     }
>
> Should it be "v.z()<-1.0" here as the clipping space coordinates are in
> the range of [-1, 1]? I changed this line and it works for me; otherwise
> the city on earth will be splitted in a strange way as shown in
> the attached snapshot.
>
> But I'm still struggling with another serious problem that the whole
> shadow map may disappear suddenly when I'm looking with a horizontally
> view from the opposite direction of the light vector. I checked the code
> and surprisingly found that the ComputeLightSpaceBounds returns an
> invalid bounding box in such case. That means the entire scene may be
> culled as in the light space frustum? I'm just confused now but will go on
> tomorrow.
>
> Any good ideas about that? :-)
>
> Wang Rui
>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to