Improved the update of the shadow volume.

This commit is contained in:
Robert Osfield
2007-02-15 01:23:00 +00:00
parent b7b8e7ed98
commit 6edca062b8

View File

@@ -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"<<std::endl;
_occluder->computeShadowVolumeGeometry(lightpos, *_shadowVolume);
osg::Matrix eyeToWorld;
eyeToWorld.invert(cv.getModelViewMatrix());
_occluder->computeShadowVolumeGeometry(lightpos * eyeToWorld, *_shadowVolume);
}
if (shadowVolumeBin.valid())