Hi, Wang Rui
 
You cant just blur depth texture (i mean you wont get what you want) neither shadow texture (you should use some kind of edge aware blur to avoid shadow bleeding on unshadowed objects, but then it makes no sense because all point is in blurring shadow edges)
 
One solution is to use Variance shadow maps or something similar, they can be preblurred to remove hard edges\stipples and still make correct shadows, but there are other problems with them. And they can be smoothly integrated with any shadowmap based rendering algo.
15.03.2012, 13:57, "Wang Rui" <[email protected]>:
Hi Robert,
The crash is because of my own fault and don't worry about it now. :-)
I'm still thinking of more ideas about the shadow rendering, for example we could output the shadow texture separately for screen-space blurring or later use in a deferred shading framework. And the light frustum may be divided into small pieces according to the view point instead of light source for efficiency need. I'd like to contribute these in case I implement one or more them in future.
I plan update the osgshadow example to demonstrate/test large scene shadowing work some time later, maybe this weekend.
Wang Rui


2012/3/15 Robert Osfield <[email protected]>
Hi Rui,

The changes look reasonable and are now checked into svn/trunk.

On the topic of the crash I don't have an ideas as to the cause, could
you provide more details on the crash and stack trace for it.

Cheers,
Robert.

On 14 March 2012 08:19, Wang Rui <[email protected]> wrote:
> Hi Robert,
>
> I'd like to submit a slightly modified version of the
> ViewDependentShadowMap. It includes two fixes: one is
> in ComputeLightSpaceBounds::update(), which changes the statement "if
> (v.z()<0.0f)" to "if (v.z()<-1.0f)" as clipping space coordinates should be
> transformed to [-1, 1] and should not be discarded unless they go beyond the
> range; the other is
> in ViewDependentShadowMap::computeShadowCameraSettings(), in which I changed
> the line:
> viewMatrix.makeLookAt(frustum.center+positionedLight.lightDir*zMin,
> frustum.center, lightUp);
> to
> viewMatrix.makeLookAt(frustum.center+positionedLight.lightDir*zMin,
> frustum.center+positionedLight.lightDir*zMax, lightUp);
>
> The reason I've done such a change is that for huge scenes like a city on
> the earth, the values of frustum.center can be extremely large, but zMin may
> be very small (e.g., when model depth in light coords equals the model
> radius by chance) in some cases so the result of (eye - center) might jiggle
> while moving around the shadow scene and thus make the shadow map suddenly
> disappear some time. The small change here also considers the effect of zMax
> to avoid such problems.
>
> Another problem I've encountered while testing shadowed scene within RTT
> cameras is that the program may crash when quitting, but a msleep() in
> the destructor seems to avoid it. I don't know the actual reason but believe
> such an unstable way is not suitable so not going to submit it this time.
> :-)
>
> Cheers,
>
> Wang Rui
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to