Skip to content

Commit

Permalink
From Wang Rui, "I've found a very covert bug in current VDSM implemen…
Browse files Browse the repository at this point in the history
…tation. 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."
  • Loading branch information
robertosfield committed Dec 3, 2012
1 parent d3501dc commit a11ad85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/osgShadow/ViewDependentShadowMap.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit a11ad85

Please sign in to comment.