Hi Cyril,
I have finally looked at your example. You set up an omnidirectional light
which was very close to the scene and this case cannot really work well
using single shadow map. Omni directional light may work if it can be
approximated with spot light and set up fairly narrow (< 120) field of view
for shadow camera projection. Fact that it seemed to produce reasonably good
shadows was related to the bug in ShadowCamera projection matrix computation
which was actually computing lower field of view than neccessary. This bug
is inherited from ShadowMap and natually present there as well but nobody
noticed it before.
The lower field of view was working as unexpected clippinig plane you
mention. There might be another bug related to minLightMargin extrusion.
This extrusion should be clipped by light volume in non inifinte light case
to avoid situation where extruded volume will again produce distorted wide
angle projection. In fact it used to be clipped few versions ago but I
turned it off because it was clipping extra minLightMargin room for
ViewBounds techniques. Since the extrusion was not clipped for your case it
might occasionally extend the shadow field of view which was initially too
narrow. I suspect that the effect of narrowing / extending fight could be
interpreted like a dynamic clipping plane changing its position depending on
main camera location.
I could quickly fix first problem but the ohter one will need some thoughtul
consideration. I am not sure if this is worth the effort if Robert is going
to replace the technique anyway...
Cheers,
Wojtek
-----Oryginalna wiadomość-----
From: Cyril Bondue
Sent: Friday, August 12, 2011 11:28 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] OSG 2.8.3 & 3.0.1 view dependent shadow
clippingplane
Hi,
Thanks for taking time when you shouldn't to see my problem ! ^^
The osg::Light is used is the default one :
Code:
_light = new osg::Light();
osg::ref_ptr<osg::LightSource> lightSource = new osg::LightSource();
lightSource->setLight(_light);
_sceneRoot->addChild(lightSource);
I only changed it's ambiant value and it's position, to make it follow the
car.
I tried to setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR),
without result. Changing the minLighMargin afterward didn't solve the
problem either. I tried this on the exemple code i've attached to this post
and the simulation, same result.
Also, I have the same result with MinimalShadowMap or
MinimalCullBoundsShadowMap, have you ever seen such problem? I don't thing
i've done anything special!
That's strange :/
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42018#42018
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org