Show
Ignore:
Timestamp:
12/16/07 18:41:46 (7 years ago)
Author:
robert
Message:

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. "

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgShadow/ShadowMap.cpp

    r7692 r7703  
    434434 
    435435                // set the position far away along the light direction 
    436                 osg::Vec3 position = lightDir * bb.radius()  * 20; 
     436                osg::Vec3 position = bb.center() + lightDir * bb.radius() * 2; 
    437437 
    438438                float centerDistance = (position-bb.center()).length();