mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Allow shadowsbin to optimise clockwise-wound meshes when face culling is off
This commit is contained in:
parent
a36ed5f129
commit
11b4af49ce
3 changed files with 31 additions and 8 deletions
|
@ -870,7 +870,10 @@ void SceneUtil::MWShadowTechnique::enableFrontFaceCulling()
|
|||
_useFrontFaceCulling = true;
|
||||
|
||||
if (_shadowCastingStateSet)
|
||||
{
|
||||
_shadowCastingStateSet->setAttribute(new osg::CullFace(osg::CullFace::FRONT), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
|
||||
_shadowCastingStateSet->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);
|
||||
}
|
||||
}
|
||||
|
||||
void SceneUtil::MWShadowTechnique::disableFrontFaceCulling()
|
||||
|
@ -878,7 +881,10 @@ void SceneUtil::MWShadowTechnique::disableFrontFaceCulling()
|
|||
_useFrontFaceCulling = false;
|
||||
|
||||
if (_shadowCastingStateSet)
|
||||
{
|
||||
_shadowCastingStateSet->removeAttribute(osg::StateAttribute::CULLFACE);
|
||||
_shadowCastingStateSet->setMode(GL_CULL_FACE, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);
|
||||
}
|
||||
}
|
||||
|
||||
void SceneUtil::MWShadowTechnique::setupCastingShader(Shader::ShaderManager & shaderManager)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue