increase water fudge to get rid of artifacts

pull/299/head
Miloslav Číž 7 years ago
parent e6caacec04
commit 2346c5338e

@ -112,7 +112,7 @@ class ClipCullNode : public osg::Group
} }
// move the plane back along its normal a little bit to prevent bleeding at the water shore // move the plane back along its normal a little bit to prevent bleeding at the water shore
const float clipFudge = -5; const float clipFudge = -30;
modelViewMatrix->preMultTranslate(mCullPlane->getNormal() * clipFudge); modelViewMatrix->preMultTranslate(mCullPlane->getNormal() * clipFudge);
cv->pushModelViewMatrix(modelViewMatrix, osg::Transform::RELATIVE_RF); cv->pushModelViewMatrix(modelViewMatrix, osg::Transform::RELATIVE_RF);
@ -336,8 +336,7 @@ public:
void setWaterLevel(float waterLevel) void setWaterLevel(float waterLevel)
{ {
setViewMatrix(osg::Matrix::translate(0,0,-waterLevel) * osg::Matrix::scale(1,1,-1) * osg::Matrix::translate(0,0,waterLevel)); setViewMatrix(osg::Matrix::scale(1,1,-1) * osg::Matrix::translate(0,0,2 * waterLevel));
mClipCullNode->setPlane(osg::Plane(osg::Vec3d(0,0,1), osg::Vec3d(0,0,waterLevel))); mClipCullNode->setPlane(osg::Plane(osg::Vec3d(0,0,1), osg::Vec3d(0,0,waterLevel)));
} }

Loading…
Cancel
Save