mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +00:00
fix shadowsglitch by bounds overflow
Signed-off-by: Bret Curtis <psi29a@gmail.com>
This commit is contained in:
parent
00e56ae862
commit
77b92aee9c
@ -171,8 +171,6 @@ void QuadTreeNode::setBoundingBox(const osg::BoundingBox &boundingBox)
|
|||||||
{
|
{
|
||||||
mBoundingBox = boundingBox;
|
mBoundingBox = boundingBox;
|
||||||
mValidBounds = boundingBox.valid();
|
mValidBounds = boundingBox.valid();
|
||||||
dirtyBound();
|
|
||||||
getBound();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const osg::BoundingBox &QuadTreeNode::getBoundingBox() const
|
const osg::BoundingBox &QuadTreeNode::getBoundingBox() const
|
||||||
@ -180,11 +178,6 @@ const osg::BoundingBox &QuadTreeNode::getBoundingBox() const
|
|||||||
return mBoundingBox;
|
return mBoundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::BoundingSphere QuadTreeNode::computeBound() const
|
|
||||||
{
|
|
||||||
return osg::BoundingSphere(mBoundingBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
float QuadTreeNode::getSize() const
|
float QuadTreeNode::getSize() const
|
||||||
{
|
{
|
||||||
return mSize;
|
return mSize;
|
||||||
|
@ -91,8 +91,6 @@ namespace Terrain
|
|||||||
const osg::BoundingBox& getBoundingBox() const;
|
const osg::BoundingBox& getBoundingBox() const;
|
||||||
bool hasValidBounds() const { return mValidBounds; }
|
bool hasValidBounds() const { return mValidBounds; }
|
||||||
|
|
||||||
virtual osg::BoundingSphere computeBound() const;
|
|
||||||
|
|
||||||
/// size in cell coordinates
|
/// size in cell coordinates
|
||||||
float getSize() const;
|
float getSize() const;
|
||||||
|
|
||||||
|
@ -140,6 +140,8 @@ public:
|
|||||||
addChildren(mRootNode);
|
addChildren(mRootNode);
|
||||||
|
|
||||||
mRootNode->initNeighbours();
|
mRootNode->initNeighbours();
|
||||||
|
float cellWorldSize = mStorage->getCellWorldSize();
|
||||||
|
mRootNode->setInitialBound(osg::BoundingSphere(osg::BoundingBox(osg::Vec3(mMinX*cellWorldSize, mMinY*cellWorldSize, 0), osg::Vec3(mMaxX*cellWorldSize, mMaxY*cellWorldSize, 0))));
|
||||||
}
|
}
|
||||||
|
|
||||||
void addChildren(QuadTreeNode* parent)
|
void addChildren(QuadTreeNode* parent)
|
||||||
|
@ -826,8 +826,8 @@ enable debug hud = false
|
|||||||
# Enable the debug overlay to see where each shadow map affects.
|
# Enable the debug overlay to see where each shadow map affects.
|
||||||
enable debug overlay = false
|
enable debug overlay = false
|
||||||
|
|
||||||
# Attempt to better use the shadow map by making them cover a smaller area. May have a minor to major performance impact.
|
# Attempt to better use the shadow map by making them cover a smaller area. May have a major performance impact.
|
||||||
compute tight scene bounds = true
|
compute tight scene bounds = false
|
||||||
|
|
||||||
# How large to make the shadow map(s). Higher values increase GPU load, but can produce better-looking results. Power-of-two values may turn out to be faster on some GPU/driver combinations.
|
# How large to make the shadow map(s). Higher values increase GPU load, but can produce better-looking results. Power-of-two values may turn out to be faster on some GPU/driver combinations.
|
||||||
shadow map resolution = 1024
|
shadow map resolution = 1024
|
||||||
|
Loading…
x
Reference in New Issue
Block a user