mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Add basic support for distant terrain CLSB
(cherry picked from commit 0f9dc3e65b72e6fff762f7a0933bae6f861e5fd4)
This commit is contained in:
parent
cb6767b4fc
commit
9ec59783ba
@ -282,6 +282,14 @@ namespace SceneUtil
|
|||||||
popCurrentMask();
|
popCurrentMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MWShadow::ComputeLightSpaceBounds::apply(Terrain::QuadTreeWorld & quadTreeWorld)
|
||||||
|
{
|
||||||
|
// For now, just expand the bounds fully as terrain will fill them up and possible ways to detect which terrain definitely won't cast shadows aren't implemented.
|
||||||
|
|
||||||
|
update(osg::Vec3(-1.0, -1.0, 0.0));
|
||||||
|
update(osg::Vec3(1.0, 1.0, 0.0));
|
||||||
|
}
|
||||||
|
|
||||||
void MWShadow::ComputeLightSpaceBounds::apply(osg::Billboard&)
|
void MWShadow::ComputeLightSpaceBounds::apply(osg::Billboard&)
|
||||||
{
|
{
|
||||||
OSG_INFO << "Warning Billboards not yet supported" << std::endl;
|
OSG_INFO << "Warning Billboards not yet supported" << std::endl;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <osgShadow/ShadowSettings>
|
#include <osgShadow/ShadowSettings>
|
||||||
#include <osgShadow/ViewDependentShadowMap>
|
#include <osgShadow/ViewDependentShadowMap>
|
||||||
|
|
||||||
|
#include <components/terrain/quadtreeworld.hpp>
|
||||||
#include <components/shader/shadermanager.hpp>
|
#include <components/shader/shadermanager.hpp>
|
||||||
|
|
||||||
namespace SceneUtil
|
namespace SceneUtil
|
||||||
@ -34,6 +35,8 @@ namespace SceneUtil
|
|||||||
|
|
||||||
void apply(osg::Drawable& drawable);
|
void apply(osg::Drawable& drawable);
|
||||||
|
|
||||||
|
void apply(Terrain::QuadTreeWorld& quadTreeWorld);
|
||||||
|
|
||||||
void apply(osg::Billboard&);
|
void apply(osg::Billboard&);
|
||||||
|
|
||||||
void apply(osg::Projection&);
|
void apply(osg::Projection&);
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <components/sceneutil/shadow.hpp>
|
||||||
|
|
||||||
#include "quadtreenode.hpp"
|
#include "quadtreenode.hpp"
|
||||||
#include "storage.hpp"
|
#include "storage.hpp"
|
||||||
#include "viewdata.hpp"
|
#include "viewdata.hpp"
|
||||||
@ -344,7 +346,12 @@ void loadRenderingNode(ViewData::Entry& entry, ViewData* vd, ChunkManager* chunk
|
|||||||
void QuadTreeWorld::accept(osg::NodeVisitor &nv)
|
void QuadTreeWorld::accept(osg::NodeVisitor &nv)
|
||||||
{
|
{
|
||||||
if (nv.getVisitorType() != osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType() != osg::NodeVisitor::INTERSECTION_VISITOR)
|
if (nv.getVisitorType() != osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType() != osg::NodeVisitor::INTERSECTION_VISITOR)
|
||||||
|
{
|
||||||
|
SceneUtil::MWShadow::ComputeLightSpaceBounds* shadowBoundsVisitor = dynamic_cast<SceneUtil::MWShadow::ComputeLightSpaceBounds *>(&nv);
|
||||||
|
if (shadowBoundsVisitor)
|
||||||
|
shadowBoundsVisitor->apply(*this);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ViewData* vd = mRootNode->getView(nv);
|
ViewData* vd = mRootNode->getView(nv);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user