diff options
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
| -rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index da1f1a466f..4712b5a5e0 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); @@ -462,7 +464,7 @@ bool LLGLTFPreviewTexture::render() // Set up camera and viewport const LLVector3 origin(0.0, 0.0, 0.0); camera.lookAt(origin, object_position); - camera.setAspect((F32)(mFullHeight / mFullWidth)); + camera.setAspect((F32)(mFullWidth / mFullHeight)); const LLRect texture_rect(0, mFullHeight, mFullWidth, 0); camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f); @@ -520,19 +522,50 @@ 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); +/* + gPipeline.gammaCorrect(&screen, &gPipeline.mPostPingMap); +*/ + } + + 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.mPostPingMap); + gPipeline.combineGlow(&gPipeline.mPostPingMap, &screen); + gPipeline.renderDoF(&screen, &gPipeline.mPostPingMap); + gPipeline.applyFXAA(&gPipeline.mPostPingMap, &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(); |
