From 317dcdea1ca8d1f540187af47fc23a36ad8232aa Mon Sep 17 00:00:00 2001 From: mobserveur Date: Sat, 30 Aug 2025 01:59:43 +0200 Subject: Performance Optimisations, Bloom effect, Visuals Panel This commit contains performance optimisations in the the pipeline, framebuffer, vertexbuffer, reflection probes, shadows. It also fixes many opengl errors, modifies the opengl debugging, and adds a visuals effects panel. --- indra/newview/llgltfmaterialpreviewmgr.cpp | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp') diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index da1f1a466f..0b792efa1f 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -425,6 +425,8 @@ bool LLGLTFPreviewTexture::render() if (!mShouldRender) { return false; } + LL_WARNS() << "LLGLTFPreviewTexture:render()" << LL_ENDL; + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -520,19 +522,41 @@ bool LLGLTFPreviewTexture::render() // *HACK: Hide mExposureMap from generateExposure gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); + //bool hdr = gPipeline.has_hdr(); + bool hdr = true; + + if (hdr) + { gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); - gPipeline.gammaCorrect(&screen, &gPipeline.mPostMap); + } + + U16 activeRT = 0; + gPipeline.gammaCorrect(&screen, &gPipeline.mPostMaps[activeRT]); + LLVertexBuffer::unbind(); - gPipeline.generateGlow(&gPipeline.mPostMap); - gPipeline.combineGlow(&gPipeline.mPostMap, &screen); - gPipeline.renderDoF(&screen, &gPipeline.mPostMap); - gPipeline.applyFXAA(&gPipeline.mPostMap, &screen); + + gPipeline.generateGlow(&gPipeline.mPostMaps[activeRT]); + gPipeline.combineGlow(&gPipeline.mPostMaps[activeRT], &gPipeline.mPostMaps[1-activeRT]); + activeRT = 1-activeRT; + + if(gPipeline.renderDoF(&gPipeline.mPostMaps[activeRT], &gPipeline.mPostMaps[1-activeRT])) + { + activeRT = 1-activeRT; + } + + if(gPipeline.applyFXAA(&gPipeline.mPostMaps[activeRT], &gPipeline.mPostMaps[1-activeRT])) + { + activeRT = 1-activeRT; + } // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame) gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); + gPipeline.copyRenderTarget(&gPipeline.mPostMaps[activeRT], &screen); + + // Final render gDeferredPostNoDoFProgram.bind(); -- cgit v1.2.3