1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 08:49:55 +00:00
openmw-tes3mp/apps/openmw/mwvr/vrshadow.hpp
Mads Buvik Sandvei e0b51af395 Sharing shadow maps across eyes.
Does not yet expand frustum.
2020-07-20 13:03:48 +00:00

38 lines
996 B
C++

#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:
VrShadow(osgViewer::Viewer* viewer, int renderOrder = 0);
void configureShadowsForCamera(osg::Camera* camera);
void configureShadows(bool enabled);
private:
osgViewer::Viewer* mViewer;
int mRenderOrder;
osg::ref_ptr<osg::Camera> mShadowMapCamera;
osg::ref_ptr< UpdateShadowMapSlaveCallback > mUpdateCallback;
osg::ref_ptr<SharedShadowMapConfig> mMasterConfig;
osg::ref_ptr<SharedShadowMapConfig> mSlaveConfig;
};
}
#endif