From 5a01e7ce0c185f078c3a6fbb1236f3dca76c7118 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 9 Aug 2001 01:41:18 +0000 Subject: [PATCH] fix decals again --- panda/src/dxgsg/dxGraphicsStateGuardian.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index d3eeac554d..dea8c5409c 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx @@ -5043,6 +5043,12 @@ begin_decal(GeomNode *base_geom, AllTransitionsWrapper &attrib) { _d3dDevice->GetRenderState(D3DRENDERSTATE_ZWRITEENABLE, (DWORD *)&_depth_write_enabled); //save cur val _d3dDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE); + // It is also important to update the current state to + // indicate the depth buffer write is off, so that future + // geometry will render correctly. + DepthWriteTransition *dwa = new DepthWriteTransition(DepthWriteTransition::off()); + attrib.set_transition(dwa); + // Now render the base geometry. base_geom->draw(this);