From 869bb7f16ae3e931f11840332ab00715a4ef27af Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 21 Aug 2023 05:15:48 -0700 Subject: Readd occlusion culling for hero probes. DRTVWR-583 --- indra/newview/llheroprobemanager.cpp | 19 ++----------------- indra/newview/pipeline.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 1773dffa8b..33a54c797e 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -132,23 +132,8 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face) gPipeline.mRT = &gPipeline.mAuxillaryRT; mLightScale = 1.f; - static LLCachedControl max_local_light_ambiance(gSavedSettings, "RenderReflectionProbeMaxLocalLightAmbiance", 8.f); - if (probe->getAmbiance() > max_local_light_ambiance) - { - mLightScale = max_local_light_ambiance / probe->getAmbiance(); - } - { - gPipeline.pushRenderTypeMask(); - - //only render sky, water, terrain, and clouds - gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_AVATAR, LLPipeline::END_RENDER_TYPES); - - probe->update(mRenderTarget.getWidth(), face); - - gPipeline.popRenderTypeMask(); - } + probe->update(mRenderTarget.getWidth(), face); gPipeline.mRT = &gPipeline.mMainRT; @@ -401,7 +386,7 @@ void LLHeroProbeManager::initReflectionMaps() { mReset = false; mReflectionProbeCount = count; - mProbeResolution = nhpo2(llclamp(gSavedSettings.getU32("RenderHeroProbeResolution"), (U32)128, (U32)1024)); + mProbeResolution = nhpo2(1024); mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1 mTexture = new LLCubeMapArray(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9f8cd2c7fd..4c951a9dea 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2443,6 +2443,26 @@ void LLPipeline::doOcclusion(LLCamera& camera) gGL.setColorMask(true, true); } + + if (sReflectionProbesEnabled && sUseOcclusion > 1 && !LLPipeline::sShadowRender && !gCubeSnapshot) + { + gGL.setColorMask(false, false); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + LLGLDisable cull(GL_CULL_FACE); + + gOcclusionCubeProgram.bind(); + + if (mCubeVB.isNull()) + { //cube VB will be used for issuing occlusion queries + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX); + } + mCubeVB->setBuffer(); + + mHeroProbeManager.doOcclusion(); + gOcclusionCubeProgram.unbind(); + + gGL.setColorMask(true, true); + } if (LLPipeline::sUseOcclusion > 1 && (sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck)) -- cgit v1.2.3