diff options
author | mobserveur <mobserveur@gmail.com> | 2025-08-30 01:59:43 +0200 |
---|---|---|
committer | mobserveur <mobserveur@gmail.com> | 2025-08-30 01:59:43 +0200 |
commit | 7f0c81918575d3f05e4eadc160b600eaa8b383d1 (patch) | |
tree | 4c6bb40e93e38bb8a32964380f97ac2a06490b11 /indra/newview/llgltfmaterialpreviewmgr.cpp | |
parent | 03140ed619c5d49eb3851284ae53bbea73a8b831 (diff) |
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.
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index da1f1a466f..daa3d62efe 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); - gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); - gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); - gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); - gPipeline.gammaCorrect(&screen, &gPipeline.mPostMap); + //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); + } + + 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(); |