From a5b48225c75c3398fc9dfa31dbb3047c0e71662b Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 29 Jul 2015 10:14:19 -0500 Subject: [PATCH] Corrected the terrain issue caused by unwanted early-outing due to prior changes. --- .../renderInstance/renderPrePassMgr.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Engine/source/renderInstance/renderPrePassMgr.cpp b/Engine/source/renderInstance/renderPrePassMgr.cpp index 35bbbaf07..326f346a0 100644 --- a/Engine/source/renderInstance/renderPrePassMgr.cpp +++ b/Engine/source/renderInstance/renderPrePassMgr.cpp @@ -202,20 +202,20 @@ void RenderPrePassMgr::addElement( RenderInst *inst ) if ( isMeshInst || isDecalMeshInst ) matInst = static_cast(inst)->matInst; - // Skip decals if they don't have normal maps. - if (!matInst || isDecalMeshInst && !matInst->hasNormalMap()) - return; - - // If its a custom material and it refracts... skip it. - if ( matInst->isCustomMaterial() && - static_cast( matInst->getMaterial() )->mRefract ) - return; - - // Make sure we got a prepass material. - if ( matInst ) + if (matInst) { - matInst = getPrePassMaterial( matInst ); - if ( !matInst || !matInst->isValid() ) + // Skip decals if they don't have normal maps. + if (isDecalMeshInst && !matInst->hasNormalMap()) + return; + + // If its a custom material and it refracts... skip it. + if (matInst->isCustomMaterial() && + static_cast(matInst->getMaterial())->mRefract) + return; + + // Make sure we got a prepass material. + matInst = getPrePassMaterial(matInst); + if (!matInst || !matInst->isValid()) return; } @@ -240,7 +240,7 @@ void RenderPrePassMgr::addElement( RenderInst *inst ) elem.key = *((U32*)&invSortDistSq); // Next sort by pre-pass material if its a mesh... use the original sort key. - if ( isMeshInst ) + if (isMeshInst && matInst) elem.key2 = matInst->getStateHint(); else elem.key2 = originalKey;