mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Make shadows disableable.
This commit is contained in:
parent
0f1e770c53
commit
76f23c28b1
@ -745,6 +745,16 @@ void MWShadowTechnique::cleanSceneGraph()
|
||||
OSG_INFO<<"MWShadowTechnique::cleanSceneGraph()"<<std::endl;
|
||||
}
|
||||
|
||||
void MWShadowTechnique::enableShadows()
|
||||
{
|
||||
_enableShadows = true;
|
||||
}
|
||||
|
||||
void MWShadowTechnique::enableShadows()
|
||||
{
|
||||
_enableShadows = false;
|
||||
}
|
||||
|
||||
MWShadowTechnique::ViewDependentData* MWShadowTechnique::createViewDependentData(osgUtil::CullVisitor* /*cv*/)
|
||||
{
|
||||
return new ViewDependentData(this);
|
||||
@ -769,11 +779,11 @@ void MWShadowTechnique::update(osg::NodeVisitor& nv)
|
||||
|
||||
void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
|
||||
{
|
||||
/* TODO: if (!enableShadows)
|
||||
if (!_enableShadows)
|
||||
{
|
||||
_shadowedScene->osg::Group::traverse(cv);
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
OSG_INFO<<std::endl<<std::endl<<"MWShadowTechnique::cull(osg::CullVisitor&"<<&cv<<")"<<std::endl;
|
||||
|
||||
|
@ -61,6 +61,10 @@ namespace SceneUtil {
|
||||
/** Clean scene graph from any shadow technique specific nodes, state and drawables.*/
|
||||
virtual void cleanSceneGraph();
|
||||
|
||||
virtual void enableShadows();
|
||||
|
||||
virtual void disableShadows();
|
||||
|
||||
class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack
|
||||
{
|
||||
public:
|
||||
@ -221,6 +225,8 @@ namespace SceneUtil {
|
||||
mutable OpenThreads::Mutex _accessUniformsAndProgramMutex;
|
||||
Uniforms _uniforms;
|
||||
osg::ref_ptr<osg::Program> _program;
|
||||
|
||||
bool _enableShadows;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user