1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:23:54 +00:00
openmw/components/sceneutil/shadow.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.7 KiB
C++
Raw Normal View History

2017-11-08 01:44:49 +00:00
#ifndef COMPONENTS_SCENEUTIL_SHADOW_H
#define COMPONENTS_SCENEUTIL_SHADOW_H
#include <components/shader/shadermanager.hpp>
namespace osg
{
class StateSet;
class Group;
}
namespace osgShadow
{
class ShadowSettings;
class ShadowedScene;
}
namespace Settings
{
struct ShadowsCategory;
}
2017-11-08 01:44:49 +00:00
namespace SceneUtil
{
class MWShadowTechnique;
2018-02-26 22:27:09 +00:00
class ShadowManager
{
public:
static Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
static const ShadowManager& instance();
explicit ShadowManager(osg::ref_ptr<osg::Group> sceneRoot, osg::ref_ptr<osg::Group> rootNode,
unsigned int outdoorShadowCastingMask, unsigned int indoorShadowCastingMask, unsigned int worldMask,
const Settings::ShadowsCategory& settings, Shader::ShaderManager& shaderManager);
~ShadowManager();
void setupShadowSettings(const Settings::ShadowsCategory& settings, Shader::ShaderManager& shaderManager);
2018-02-27 14:15:06 +00:00
void disableShadowsForStateSet(osg::StateSet& stateset) const;
Shader::ShaderManager::DefineMap getShadowDefines(const Settings::ShadowsCategory& settings) const;
void enableIndoorMode(const Settings::ShadowsCategory& settings);
void enableOutdoorMode();
2022-09-22 18:26:05 +00:00
protected:
static ShadowManager* sInstance;
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-11-08 01:44:49 +00:00
#endif // COMPONENTS_SCENEUTIL_SHADOW_H