diff --git a/src/osgShadow/LightSpacePerspectiveShadowMap.cpp b/src/osgShadow/LightSpacePerspectiveShadowMap.cpp index 89216fee7..99224f3bc 100644 --- a/src/osgShadow/LightSpacePerspectiveShadowMap.cpp +++ b/src/osgShadow/LightSpacePerspectiveShadowMap.cpp @@ -16,6 +16,7 @@ #include +#include #include #include @@ -27,6 +28,8 @@ #define LISPSM_ALGO DIRECTIONAL_ADAPTED //#define LISPSM_ALGO DIRECTIONAL_AND_SPOT +#define ROBERTS_TEST_CHANGES 1 + #define PRINT_COMPUTED_N_OPT 0 using namespace osgShadow; @@ -279,8 +282,13 @@ void LightSpacePerspectiveShadowMapAlgorithm::operator() m.makeLookAt( eye, center, up ); osg::BoundingBox bb = hullShadowedView->computeBoundingBox( mvpLight * m ); - if( !bb.valid() ) + if( !bb.valid() ) + { +#if ROBERTS_TEST_CHANGES + OSG_NOTICE<<"LightSpacePerspectiveShadowMapAlgorithm::operator() invalid bb A"<computeBoundingBox( mvpLight * lightView ); - if( !bb.valid() ) + if( !bb.valid() ) + { +#if ROBERTS_TEST_CHANGES + OSG_NOTICE<<"LightSpacePerspectiveShadowMapAlgorithm::operator() invalid bb B"<setProjectionMatrix ( cameraShadow->getProjectionMatrix() * lightView * lispProjection ); + + //OSG_NOTICE<<"LightSpacePerspectiveShadowMapAlgorithm::operator() normal case dotProd="<