2017-11-08 01:44:49 +00:00
|
|
|
#ifndef COMPONENTS_SCENEUTIL_SHADOW_H
|
|
|
|
#define COMPONENTS_SCENEUTIL_SHADOW_H
|
2017-10-03 02:40:23 +00:00
|
|
|
|
2017-12-27 02:32:17 +00:00
|
|
|
#include <osgShadow/ShadowSettings>
|
2017-10-03 02:40:23 +00:00
|
|
|
|
2018-02-05 23:03:18 +00:00
|
|
|
#include <components/terrain/quadtreeworld.hpp>
|
2017-11-22 20:07:07 +00:00
|
|
|
#include <components/shader/shadermanager.hpp>
|
|
|
|
|
2018-02-26 22:27:09 +00:00
|
|
|
#include "mwshadowtechnique.hpp"
|
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
namespace SceneUtil
|
2017-10-03 02:40:23 +00:00
|
|
|
{
|
2018-02-26 22:27:09 +00:00
|
|
|
class ShadowManager
|
2017-10-03 02:40:23 +00:00
|
|
|
{
|
2017-10-11 19:47:19 +00:00
|
|
|
public:
|
2017-12-27 02:32:17 +00:00
|
|
|
static void disableShadowsForStateSet(osg::ref_ptr<osg::StateSet> stateSet);
|
2017-10-11 19:47:19 +00:00
|
|
|
|
2018-02-26 22:27:09 +00:00
|
|
|
ShadowManager(osg::ref_ptr<osg::Group> sceneRoot, osg::ref_ptr<osg::Group> rootNode);
|
2017-11-05 14:46:03 +00:00
|
|
|
|
2018-02-26 22:27:09 +00:00
|
|
|
virtual void setupShadowSettings(int castsShadowMask);
|
2017-11-22 20:07:07 +00:00
|
|
|
|
|
|
|
virtual Shader::ShaderManager::DefineMap getShadowDefines();
|
|
|
|
|
|
|
|
virtual Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
|
2017-10-03 02:40:23 +00:00
|
|
|
protected:
|
2018-02-26 23:52:46 +00:00
|
|
|
bool mEnableShadows;
|
2018-02-26 22:27:09 +00:00
|
|
|
|
|
|
|
osg::ref_ptr<osgShadow::ShadowedScene> mShadowedScene;
|
2018-02-26 23:52:46 +00:00
|
|
|
osg::ref_ptr<osgShadow::ShadowSettings> mShadowSettings;
|
2018-02-26 22:27:09 +00:00
|
|
|
osg::ref_ptr<MWShadowTechnique> mShadowTechnique;
|
2017-10-03 02:40:23 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
#endif //COMPONENTS_SCENEUTIL_SHADOW_H
|