2020-07-20 13:03:48 +00:00
|
|
|
#ifndef MWVR_VRSHADOW_H
|
|
|
|
#define MWVR_VRSHADOW_H
|
|
|
|
|
|
|
|
#include <osg/Camera>
|
|
|
|
#include <osgViewer/Viewer>
|
|
|
|
|
|
|
|
#include <components/sceneutil/mwshadowtechnique.hpp>
|
|
|
|
|
|
|
|
namespace MWVR
|
|
|
|
{
|
|
|
|
|
|
|
|
class UpdateShadowMapSlaveCallback : public osg::View::Slave::UpdateSlaveCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void updateSlave(osg::View& view, osg::View::Slave& slave) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class VrShadow
|
|
|
|
{
|
|
|
|
using SharedShadowMapConfig = SceneUtil::MWShadowTechnique::SharedShadowMapConfig;
|
|
|
|
public:
|
2020-07-26 11:12:36 +00:00
|
|
|
VrShadow();
|
2020-07-20 13:03:48 +00:00
|
|
|
|
2020-07-26 11:12:36 +00:00
|
|
|
void configureShadowsForCamera(osg::Camera* camera, bool master);
|
2020-07-20 13:03:48 +00:00
|
|
|
|
2020-07-26 11:12:36 +00:00
|
|
|
void updateShadowConfig(osg::View& view);
|
2020-07-20 13:03:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
osg::ref_ptr<SharedShadowMapConfig> mMasterConfig;
|
|
|
|
osg::ref_ptr<SharedShadowMapConfig> mSlaveConfig;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|