From 31931b0455b53be44247ecf4d5ebbec607a8614d Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 9 May 2023 10:11:49 +0000 Subject: [PATCH] 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 --- source/Irrlicht/CBufferRenderNode.h | 9 +++++---- source/Irrlicht/CMeshSceneNode.cpp | 2 +- tests/tests-last-passed-at.txt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Irrlicht/CBufferRenderNode.h b/source/Irrlicht/CBufferRenderNode.h index 923434fa..a309275b 100644 --- a/source/Irrlicht/CBufferRenderNode.h +++ b/source/Irrlicht/CBufferRenderNode.h @@ -76,6 +76,11 @@ public: driver->setMaterial(material); 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. @@ -84,10 +89,6 @@ public: video::IVideoDriver* driver = SceneManager->getVideoDriver(); driver->setTransform(video::ETS_WORLD, MeshNodeParent.getAbsoluteTransformation()); 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& getBoundingBox() const IRR_OVERRIDE diff --git a/source/Irrlicht/CMeshSceneNode.cpp b/source/Irrlicht/CMeshSceneNode.cpp index 7e3a6b9f..c3176048 100644 --- a/source/Irrlicht/CMeshSceneNode.cpp +++ b/source/Irrlicht/CMeshSceneNode.cpp @@ -219,7 +219,7 @@ void CMeshSceneNode::render() } } - if ( bufRenderNode->getRenderPass() == renderPass ) + if ( bufRenderNode->getRenderPass() == renderPass || renderPass == ESNRP_NONE) bufRenderNode->renderBuffer(driver); } } diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index ebc23e54..2fc244f3 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ Tests finished. 72 tests of 72 passed. 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