mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
initial reverse-z depth implementation
This commit is contained in:
parent
10d100f205
commit
70fac33940
46 changed files with 614 additions and 92 deletions
|
@ -5,6 +5,8 @@
|
|||
#include <osg/Material>
|
||||
#include <osg/StateSet>
|
||||
|
||||
#include "util.hpp"
|
||||
|
||||
namespace SceneUtil
|
||||
{
|
||||
// disable nonsense test against a worldsize bb what will always pass
|
||||
|
@ -62,7 +64,7 @@ namespace SceneUtil
|
|||
return waterGeom;
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::StateSet> createSimpleWaterStateSet(float alpha, int renderBin)
|
||||
osg::ref_ptr<osg::StateSet> createSimpleWaterStateSet(float alpha, int renderBin, bool reverseZ)
|
||||
{
|
||||
osg::ref_ptr<osg::StateSet> stateset (new osg::StateSet);
|
||||
|
||||
|
@ -76,7 +78,7 @@ namespace SceneUtil
|
|||
stateset->setMode(GL_BLEND, osg::StateAttribute::ON);
|
||||
stateset->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);
|
||||
|
||||
osg::ref_ptr<osg::Depth> depth (new osg::Depth);
|
||||
auto depth = createDepth(reverseZ);
|
||||
depth->setWriteMask(false);
|
||||
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue