diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2024-02-21 12:53:10 -0800 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2024-02-21 12:53:10 -0800 |
commit | 589910f445efa9690b543a37b9e2e14792a0e133 (patch) | |
tree | 1764a2b2f9e5e81e5101e6b59422f4a4e06868aa /indra/newview/llgltfmaterialpreviewmgr.cpp | |
parent | bbc7d63a79b9744acaff51315e5e9a9d7299bd12 (diff) |
secondlife/viewer-issues#72: Fix material preview affecting exposure on main screen
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index 36bd552c31..1c39f1ae7d 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -517,9 +517,12 @@ BOOL LLGLTFPreviewTexture::render() screen.flush(); } + // *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); + gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); gPipeline.gammaCorrect(&screen, &gPipeline.mPostMap); LLVertexBuffer::unbind(); gPipeline.generateGlow(&gPipeline.mPostMap); @@ -527,6 +530,9 @@ BOOL LLGLTFPreviewTexture::render() gPipeline.renderDoF(&screen, &gPipeline.mPostMap); gPipeline.applyFXAA(&gPipeline.mPostMap, &screen); + // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame) + gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); + // Final render gDeferredPostNoDoFProgram.bind(); |