mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-15 17:09:49 +00:00
NiZBufferProperty: handle depth test flag (bug #5902)
This commit is contained in:
parent
3736cd45cd
commit
952b31ac5c
2 changed files with 8 additions and 2 deletions
|
@ -109,6 +109,7 @@
|
||||||
Bug #5871: The console appears if you type the Russian letter "Ё" in the name of the enchantment
|
Bug #5871: The console appears if you type the Russian letter "Ё" in the name of the enchantment
|
||||||
Bug #5877: Effects appearing with empty icon
|
Bug #5877: Effects appearing with empty icon
|
||||||
Bug #5899: Visible modal windows and dropdowns crashing game on exit
|
Bug #5899: Visible modal windows and dropdowns crashing game on exit
|
||||||
|
Bug #5902: NiZBufferProperty is unable to disable the depth test
|
||||||
Feature #390: 3rd person look "over the shoulder"
|
Feature #390: 3rd person look "over the shoulder"
|
||||||
Feature #832: OpenMW-CS: Handle deleted references
|
Feature #832: OpenMW-CS: Handle deleted references
|
||||||
Feature #1536: Show more information about level on menu
|
Feature #1536: Show more information about level on menu
|
||||||
|
|
|
@ -1725,11 +1725,16 @@ namespace NifOsg
|
||||||
case Nif::RC_NiZBufferProperty:
|
case Nif::RC_NiZBufferProperty:
|
||||||
{
|
{
|
||||||
const Nif::NiZBufferProperty* zprop = static_cast<const Nif::NiZBufferProperty*>(property);
|
const Nif::NiZBufferProperty* zprop = static_cast<const Nif::NiZBufferProperty*>(property);
|
||||||
// VER_MW doesn't support a DepthFunction according to NifSkope
|
osg::StateSet* stateset = node->getOrCreateStateSet();
|
||||||
|
// Depth test flag
|
||||||
|
stateset->setMode(GL_DEPTH_TEST, zprop->flags&1 ? osg::StateAttribute::ON
|
||||||
|
: osg::StateAttribute::OFF);
|
||||||
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
|
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
|
||||||
|
// Depth write flag
|
||||||
depth->setWriteMask((zprop->flags>>1)&1);
|
depth->setWriteMask((zprop->flags>>1)&1);
|
||||||
|
// Morrowind ignores depth test function
|
||||||
depth = shareAttribute(depth);
|
depth = shareAttribute(depth);
|
||||||
node->getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// OSG groups the material properties that NIFs have separate, so we have to parse them all again when one changed
|
// OSG groups the material properties that NIFs have separate, so we have to parse them all again when one changed
|
||||||
|
|
Loading…
Reference in a new issue