1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:19:55 +00:00
openmw-tes3mp/components/sceneutil/shadow.hpp

37 lines
999 B
C++

#ifndef COMPONENTS_SCENEUTIL_SHADOW_H
#define COMPONENTS_SCENEUTIL_SHADOW_H
#include <osgShadow/ViewDependentShadowMap>
#include <components/shader/shadermanager.hpp>
namespace SceneUtil
{
class MWShadow : public osgShadow::ViewDependentShadowMap
{
public:
static const int numberOfShadowMapsPerLight = 3;
static const bool enableShadows = true;
static const bool debugHud = true;
MWShadow();
const static int baseShadowTextureUnit = 8 - numberOfShadowMapsPerLight;
virtual void cull(osgUtil::CullVisitor& cv);
virtual Shader::ShaderManager::DefineMap getShadowDefines();
virtual Shader::ShaderManager::DefineMap getShadowsDisabledDefines();
protected:
const int debugTextureUnit;
std::vector<osg::ref_ptr<osg::Camera>> debugCameras;
osg::ref_ptr<osg::Program> debugProgram;
std::vector<osg::ref_ptr<osg::Node>> debugGeometry;
};
}
#endif //COMPONENTS_SCENEUTIL_SHADOW_H