summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmaterialpreviewmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r--indra/newview/llgltfmaterialpreviewmgr.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp
index cf6b08797d..5ca841f9f1 100644
--- a/indra/newview/llgltfmaterialpreviewmgr.cpp
+++ b/indra/newview/llgltfmaterialpreviewmgr.cpp
@@ -523,31 +523,19 @@ bool LLGLTFPreviewTexture::render()
gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap);
gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap);
gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false);
- gPipeline.gammaCorrect(&screen, &gPipeline.mPostMap);
- LLVertexBuffer::unbind();
- gPipeline.generateGlow(&gPipeline.mPostMap);
- gPipeline.combineGlow(&gPipeline.mPostMap, &screen);
- 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);
+ LLRenderTarget* src = &gPipeline.mPostPingMap;
+ LLRenderTarget* dst = &gPipeline.mPostPongMap;
+ gPipeline.tonemap(&screen, dst);
+ std::swap(src, dst);
// Final render
+ LLVertexBuffer::unbind();
+ gPipeline.generateGlow(src);
+ gPipeline.combineGlow(src, nullptr);
- gDeferredPostNoDoFProgram.bind();
-
- // From LLPipeline::renderFinalize: "Whatever is last in the above post processing chain should _always_ be rendered directly here. If not, expect problems."
- gDeferredPostNoDoFProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, &screen);
- gDeferredPostNoDoFProgram.bindTexture(LLShaderMgr::DEFERRED_DEPTH, mBoundTarget, true);
-
- {
- LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS);
- gPipeline.mScreenTriangleVB->setBuffer();
- gPipeline.mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
- }
-
- gDeferredPostNoDoFProgram.unbind();
+ // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame)
+ gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure);
// Clean up
gPipeline.setupHWLights();