From Wang Rui, "I've found a very covert bug in current VDSM implementation. It makes the computation of positional texgen incorrect if the shadow scene is under one or more child cameras with view/proj offsets. Using current stage instead will fix it."

This commit is contained in:
Robert Osfield
2012-12-03 10:10:46 +00:00
parent e4a42fa65c
commit 7d947d79ff

View File

@@ -2303,9 +2303,8 @@ bool ViewDependentShadowMap::assignTexGenSettings(osgUtil::CullVisitor* cv, osg:
osg::ref_ptr<osg::RefMatrix> refMatrix =
new osg::RefMatrix( camera->getInverseViewMatrix() * (*(cv->getModelViewMatrix())) );
cv->getRenderStage()->getPositionalStateContainer()->addPositionedTextureAttribute( textureUnit, refMatrix.get(), texgen );
osgUtil::RenderStage* currentStage = cv->getCurrentRenderBin()->getStage();
currentStage->getPositionalStateContainer()->addPositionedTextureAttribute( textureUnit, refMatrix.get(), texgen );
return true;
}