2017-11-08 01:44:49 +00:00
|
|
|
#ifndef COMPONENTS_SCENEUTIL_SHADOW_H
|
|
|
|
#define COMPONENTS_SCENEUTIL_SHADOW_H
|
2017-10-03 03:40:23 +01:00
|
|
|
|
2017-10-11 20:47:19 +01:00
|
|
|
#include <osgShadow/ViewDependentShadowMap>
|
2017-10-03 03:40:23 +01:00
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
namespace SceneUtil
|
2017-10-03 03:40:23 +01:00
|
|
|
{
|
2017-10-11 20:47:19 +01:00
|
|
|
class MWShadow : public osgShadow::ViewDependentShadowMap
|
2017-10-03 03:40:23 +01:00
|
|
|
{
|
2017-10-11 20:47:19 +01:00
|
|
|
public:
|
2017-11-07 20:34:48 +00:00
|
|
|
static const int numberOfShadowMapsPerLight = 3;
|
2017-11-07 00:32:04 +00:00
|
|
|
static const bool debugHud = true;
|
|
|
|
|
2017-10-11 20:47:19 +01:00
|
|
|
MWShadow();
|
|
|
|
|
2017-11-07 16:34:51 +00:00
|
|
|
const static int baseShadowTextureUnit = 8 - numberOfShadowMapsPerLight;
|
2017-11-05 14:46:03 +00:00
|
|
|
|
2017-10-11 20:47:19 +01:00
|
|
|
virtual void cull(osgUtil::CullVisitor& cv);
|
2017-10-03 03:40:23 +01:00
|
|
|
protected:
|
2017-11-03 14:33:06 +00:00
|
|
|
const int debugTextureUnit;
|
|
|
|
|
2017-11-07 00:32:04 +00:00
|
|
|
std::vector<osg::ref_ptr<osg::Camera>> debugCameras;
|
2017-10-11 20:47:19 +01:00
|
|
|
|
|
|
|
osg::ref_ptr<osg::Program> debugProgram;
|
|
|
|
|
2017-11-07 00:32:04 +00:00
|
|
|
std::vector<osg::ref_ptr<osg::Node>> debugGeometry;
|
2017-10-03 03:40:23 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-08 01:44:49 +00:00
|
|
|
#endif //COMPONENTS_SCENEUTIL_SHADOW_H
|