Merging r6488 through r6491 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6492 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2023-05-13 12:25:10 +00:00
parent 1670db617b
commit 1de0ec5459
14 changed files with 90 additions and 31 deletions

View File

@ -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<f32>& getBoundingBox() const IRR_OVERRIDE

View File

@ -9,6 +9,7 @@
#include "IVideoDriver.h"
#include "IAnimatedMesh.h"
#include "IMesh.h"
#include "IMeshBuffer.h"
#include "os.h"
#include "IGUISkin.h"

View File

@ -11,6 +11,7 @@
#include "IWriteFile.h"
#include "IXMLWriter.h"
#include "IMesh.h"
#include "IMeshBuffer.h"
#include "IAttributes.h"
namespace irr

View File

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

View File

@ -21,6 +21,7 @@
#include "SVertexIndex.h"
#include "SLight.h"
#include "SExposedVideoData.h"
#include "SOverrideMaterial.h"
#ifdef _MSC_VER
#pragma warning( disable: 4996)

View File

@ -573,10 +573,14 @@ void COpenGLSLMaterialRenderer::startUseProgram()
void COpenGLSLMaterialRenderer::stopUseProgram()
{
// Not going to reset irrGlUseProgram/extGlUseProgramObject as it shouldn't really matter
// Necessary as fixed function pipeline breaks if programs are not reset to 0
if (Program)
Driver->extGlUseProgramObject(0);
if (Program2)
Driver->irrGlUseProgram(0);
// Force reset of material to ensure OnSetMaterial will be called or we can miss
// the next UseProgram call
// the next UseProgram call as stopUseProgram can be called from anywhere
Driver->DoResetRenderStates();
}

View File

@ -5,6 +5,7 @@
#include "CParticleAnimatedMeshSceneNodeEmitter.h"
#include "IAnimatedMeshSceneNode.h"
#include "IMesh.h"
#include "IMeshBuffer.h"
#include "os.h"
namespace irr

View File

@ -7,6 +7,7 @@
#include "IVideoDriver.h"
#include "IFileSystem.h"
#include "SAnimatedMesh.h"
#include "SOverrideMaterial.h"
#include "CMeshCache.h"
#include "IXMLWriter.h"
#include "ISceneUserDataSerializer.h"