From Wojiech Lewandowski, "There was a bug in ShadowMap camera view matrix computation. View matrix was wrong when light was directional and shadowed scene was not centered at zero coord. I fixed that and also modified cast distance to much smaller value. With former range it was possible to generate shadows with lowest LODs. "
This commit is contained in:
parent
f1154f99bf
commit
b76b85770f
@ -433,7 +433,7 @@ void ShadowMap::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() * 2;
|
||||
|
||||
float centerDistance = (position-bb.center()).length();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user