Hi Mike Thanks for your suggestion for the clipping distance. It is more ore less the same approach like the one proposed in the submission of Wang Rui (see http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2012-April/009292.html) .
It basically works form me, but there is a problem I noticed. When I look +/- into light direction, I have good looking shadows, when I turn away from light, my shadows drop heavily in resolution. This happens also with standard clipping implementation. Do you you have any ideas? There is a drawback in the current implementation of ViewDependentShadowMap. It has a couple of local classes defined in the .cpp file, like VDSMCameraCullCallback and ComputeLightSpaceBounds. When I want to derive my own class from ViewDependentShadowMap, and overwrite cull method, I end up copying all these classes aswell into my derived implementation. @Robert : please move the definition of these classes into the header file, this makes life much easier ! Regards Daniel Von: [email protected] [mailto:[email protected]] Im Auftrag von Mike Connell Gesendet: Montag, 16. April 2012 10:07 An: OpenSceneGraph Users Betreff: Re: [osg-users] ViewDependentShadowMap On 11 April 2012 15:35, Daniel Schmid <[email protected]<mailto:[email protected]>> wrote: Hi all Somehow I feel pretty alone out here working with VDSM... I have a huge paged terrain, and shadow looks awesome unless that as soon as I change my viewpoint (move camera), the shadows start to flicker and fuzz. I need somehow to limit the shadow distance... similar to MinimalShadowMap where you can set min max clip plane. I tried to modify computeShadowCameraSettings method by setting the xyzMinMax values fort he projectionMatrix to fix values, but this didn't bring much success. Does anybody have a modified or advanced version of VDSM with a clipping limit ? Regards Daniel _______________________________________________ osg-users mailing list [email protected]<mailto:[email protected]> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Daniel I replied to you on the forum last week but I see my post never got through. I have done this, although I don't have a copy against the current VDSM source. I haven't tested this code, but it was working for me when I used it, so what you want to do is certainly possible. What I did was to override the VDSM::cull method and then after the first scenegraph traversal I had code like this: // 1. Traverse main scene graph cv.pushStateSet( _shadowRecievingPlaceholderStateSet.get() ); osg::ref_ptr<osgUtil::StateGraph> decoratorStateGraph = cv.getCurrentStateGraph(); cullShadowReceivingScene(&cv); cv.popStateSet(); if (cv.getComputeNearFarMode()!=osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR) { OSG_INFO<<"Just done main subgraph traversak"<<std::endl; // make sure that the near plane is computed correctly so that any projection matrix computations are all done correctly. cv.computeNearPlane(); } maxZFar=osg::minimum( maxZFar , (double)_maxFarDistance ); // <<-- The change Frustum frustum(&cv, minZNear, maxZFar); Where _maxFarDistance was my cutoff value. I'm currently playing with Wang Rui's updates which look good - at least the PSSM implementation works well, but VSM is failing for me atm. We still have major clipping problems with directional lights so are using positional instead. best wishes Mike
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

