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-11-22 20:07:07 +00:00
|
|
|
#include <components/shader/shadermanager.hpp>
|
|
|
|
|
2021-10-11 09:27:50 +00:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class StateSet;
|
|
|
|
class Group;
|
|
|
|
}
|
|
|
|
namespace osgShadow
|
|
|
|
{
|
|
|
|
class ShadowSettings;
|
|
|
|
class ShadowedScene;
|
|
|
|
}
|
2018-12-19 23:53:14 +00:00
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
namespace SceneUtil
|
2017-10-03 02:40:23 +00:00
|
|
|
{
|
2021-10-11 09:27:50 +00:00
|
|
|
class MWShadowTechnique;
|
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
|
|
|
|
2019-04-29 16:31:46 +00:00
|
|
|
static Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
|
|
|
|
|
2021-10-11 09:27:50 +00:00
|
|
|
ShadowManager(osg::ref_ptr<osg::Group> sceneRoot, osg::ref_ptr<osg::Group> rootNode, unsigned int outdoorShadowCastingMask, unsigned int indoorShadowCastingMask, unsigned int worldMask, Shader::ShaderManager &shaderManager);
|
|
|
|
~ShadowManager();
|
2017-11-05 14:46:03 +00:00
|
|
|
|
2019-11-17 15:37:38 +00:00
|
|
|
void setupShadowSettings();
|
2018-02-27 14:15:06 +00:00
|
|
|
|
2019-11-17 15:37:38 +00:00
|
|
|
Shader::ShaderManager::DefineMap getShadowDefines();
|
2017-11-22 20:07:07 +00:00
|
|
|
|
2019-11-17 15:37:38 +00:00
|
|
|
void enableIndoorMode();
|
2017-11-22 20:07:07 +00:00
|
|
|
|
2019-11-17 15:37:38 +00:00
|
|
|
void enableOutdoorMode();
|
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;
|
2018-03-03 02:01:03 +00:00
|
|
|
|
|
|
|
unsigned int mOutdoorShadowCastingMask;
|
|
|
|
unsigned int mIndoorShadowCastingMask;
|
2017-10-03 02:40:23 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
#endif //COMPONENTS_SCENEUTIL_SHADOW_H
|