Fix problems in rendering nodes outside SceneManager caused by new render-per-buffer code

Did no longer render nodes which were rendered in SceneManager + outside SceneManager if they didn't have the per-buffer-rendering enabled.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6491 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2023-05-09 10:11:49 +00:00
parent 79e435d02a
commit 31931b0455
3 changed files with 7 additions and 6 deletions

@ -76,6 +76,11 @@ public:
driver->setMaterial(material); driver->setMaterial(material);
driver->drawMeshBuffer(mb); driver->drawMeshBuffer(mb);
} }
// Resetting after each rendering so direct calls to render() for parent node continue to work
// Assuming each pass only runs once
RenderPass = ESNRP_NONE;
ParentDoesRender = true;
} }
//! Renders the node. //! Renders the node.
@ -84,10 +89,6 @@ public:
video::IVideoDriver* driver = SceneManager->getVideoDriver(); video::IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setTransform(video::ETS_WORLD, MeshNodeParent.getAbsoluteTransformation()); driver->setTransform(video::ETS_WORLD, MeshNodeParent.getAbsoluteTransformation());
renderBuffer(driver); renderBuffer(driver);
// resetting each time so direct calls to render() for parent node continue to work
RenderPass = ESNRP_NONE;
ParentDoesRender = true;
} }
virtual const core::aabbox3d<f32>& getBoundingBox() const IRR_OVERRIDE virtual const core::aabbox3d<f32>& getBoundingBox() const IRR_OVERRIDE

@ -219,7 +219,7 @@ void CMeshSceneNode::render()
} }
} }
if ( bufRenderNode->getRenderPass() == renderPass ) if ( bufRenderNode->getRenderPass() == renderPass || renderPass == ESNRP_NONE)
bufRenderNode->renderBuffer(driver); bufRenderNode->renderBuffer(driver);
} }
} }

@ -1,4 +1,4 @@
Tests finished. 72 tests of 72 passed. Tests finished. 72 tests of 72 passed.
Compiled as DEBUG Compiled as DEBUG
Test suite pass at GMT Mon May 08 14:14:47 2023 Test suite pass at GMT Tue May 09 10:09:52 2023