mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 08:06:49 +00:00
Make shadows disableable.
This commit is contained in:
parent
0f1e770c53
commit
76f23c28b1
2 changed files with 18 additions and 2 deletions
|
@ -745,6 +745,16 @@ void MWShadowTechnique::cleanSceneGraph()
|
||||||
OSG_INFO<<"MWShadowTechnique::cleanSceneGraph()"<<std::endl;
|
OSG_INFO<<"MWShadowTechnique::cleanSceneGraph()"<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MWShadowTechnique::enableShadows()
|
||||||
|
{
|
||||||
|
_enableShadows = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MWShadowTechnique::enableShadows()
|
||||||
|
{
|
||||||
|
_enableShadows = false;
|
||||||
|
}
|
||||||
|
|
||||||
MWShadowTechnique::ViewDependentData* MWShadowTechnique::createViewDependentData(osgUtil::CullVisitor* /*cv*/)
|
MWShadowTechnique::ViewDependentData* MWShadowTechnique::createViewDependentData(osgUtil::CullVisitor* /*cv*/)
|
||||||
{
|
{
|
||||||
return new ViewDependentData(this);
|
return new ViewDependentData(this);
|
||||||
|
@ -769,11 +779,11 @@ void MWShadowTechnique::update(osg::NodeVisitor& nv)
|
||||||
|
|
||||||
void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
|
void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
|
||||||
{
|
{
|
||||||
/* TODO: if (!enableShadows)
|
if (!_enableShadows)
|
||||||
{
|
{
|
||||||
_shadowedScene->osg::Group::traverse(cv);
|
_shadowedScene->osg::Group::traverse(cv);
|
||||||
return;
|
return;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
OSG_INFO<<std::endl<<std::endl<<"MWShadowTechnique::cull(osg::CullVisitor&"<<&cv<<")"<<std::endl;
|
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.*/
|
/** Clean scene graph from any shadow technique specific nodes, state and drawables.*/
|
||||||
virtual void cleanSceneGraph();
|
virtual void cleanSceneGraph();
|
||||||
|
|
||||||
|
virtual void enableShadows();
|
||||||
|
|
||||||
|
virtual void disableShadows();
|
||||||
|
|
||||||
class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack
|
class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -221,6 +225,8 @@ namespace SceneUtil {
|
||||||
mutable OpenThreads::Mutex _accessUniformsAndProgramMutex;
|
mutable OpenThreads::Mutex _accessUniformsAndProgramMutex;
|
||||||
Uniforms _uniforms;
|
Uniforms _uniforms;
|
||||||
osg::ref_ptr<osg::Program> _program;
|
osg::ref_ptr<osg::Program> _program;
|
||||||
|
|
||||||
|
bool _enableShadows;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue