From 6edca062b86fa5fb26a393070e3164d049ce6349 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 15 Feb 2007 01:23:00 +0000 Subject: [PATCH] Improved the update of the shadow volume. --- src/osgShadow/ShadowVolume.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osgShadow/ShadowVolume.cpp b/src/osgShadow/ShadowVolume.cpp index fdfefd4ea..1e21f46ef 100644 --- a/src/osgShadow/ShadowVolume.cpp +++ b/src/osgShadow/ShadowVolume.cpp @@ -411,8 +411,11 @@ void ShadowVolume::cull(osgUtil::CullVisitor& cv) if (_lightpos != lightpos && _dynamicShadowVolumes) { _lightpos = lightpos; - osg::notify(osg::NOTICE)<<"Need to update ShadowVolume and project the lightpos into the shadow volumes coordinate frame"<computeShadowVolumeGeometry(lightpos, *_shadowVolume); + + osg::Matrix eyeToWorld; + eyeToWorld.invert(cv.getModelViewMatrix()); + + _occluder->computeShadowVolumeGeometry(lightpos * eyeToWorld, *_shadowVolume); } if (shadowVolumeBin.valid())