1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 04:15:31 +00:00

Fix ripple particles z-fighting with the water surface

This commit is contained in:
scrawl 2015-10-28 23:34:37 +01:00
parent d394b0793f
commit 9b8e45fc01
2 changed files with 6 additions and 1 deletions

View file

@ -2,6 +2,7 @@
#include <iomanip>
#include <osg/PolygonOffset>
#include <osg/Geode>
#include <osg/Texture2D>
#include <osg/Material>
@ -55,6 +56,11 @@ namespace
depth->setWriteMask(false);
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);
osg::ref_ptr<osg::PolygonOffset> polygonOffset (new osg::PolygonOffset);
polygonOffset->setUnits(-1);
polygonOffset->setFactor(-1);
stateset->setAttributeAndModes(polygonOffset, osg::StateAttribute::ON);
stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
osg::ref_ptr<osg::Material> mat (new osg::Material);

View file

@ -526,7 +526,6 @@ void Water::createShaderWaterStateSet(osg::Node* node, Reflection* reflection, R
shaderStateset->setTextureAttributeAndModes(3, refraction->getRefractionDepthTexture(), osg::StateAttribute::ON);
shaderStateset->addUniform(new osg::Uniform("refractionMap", 2));
shaderStateset->addUniform(new osg::Uniform("refractionDepthMap", 3));
// FIXME: zfighting with ripples
shaderStateset->setRenderBinDetails(MWRender::RenderBin_Default, "RenderBin");
}
else