From Roger James, "The light position is incorrectly calculated for shadow casting scenes whose bounding box centre is not the origin. This is a one line fix.
"
This commit is contained in:
@@ -207,7 +207,7 @@ void ShadowTexture::cull(osgUtil::CullVisitor& cv)
|
||||
lightDir.normalize();
|
||||
|
||||
// set the position far away along the light direction
|
||||
osg::Vec3 position = lightDir * bb.radius() * 20;
|
||||
osg::Vec3 position = bb.center() + lightDir * bb.radius() * 10.0;
|
||||
|
||||
float centerDistance = (position-bb.center()).length();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user