diff options
author | Dave Parks <davep@lindenlab.com> | 2022-09-17 01:12:52 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-09-17 01:12:52 -0500 |
commit | b2cf07f53ca9f0ab82d466063af8307631c50f31 (patch) | |
tree | b0d9d4709ca926cbb49b53f4483bdf6b5bad62ff /indra/newview/pipeline.cpp | |
parent | dc1ed195119d9ccc2b21111ea16663ffce4942c8 (diff) |
WIP - switch PBR implementations
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7f42fb71e4..f07d809495 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1182,6 +1182,8 @@ void LLPipeline::releaseLUTBuffers() LLImageGL::deleteTextures(1, &mLightFunc); mLightFunc = 0; } + + mPbrBrdfLut.release(); } void LLPipeline::releaseShadowBuffers() @@ -1363,6 +1365,21 @@ void LLPipeline::createLUTBuffers() delete [] ls; } + + mPbrBrdfLut.allocate(512, 512, GL_RGB16, false, false); + mPbrBrdfLut.bindTarget(); + gDeferredGenBrdfLutProgram.bind(); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.vertex2f(-1, -1); + gGL.vertex2f(-1, 1); + gGL.vertex2f(1, -1); + gGL.vertex2f(1, 1); + gGL.end(); + gGL.flush(); + + gDeferredGenBrdfLutProgram.unbind(); + mPbrBrdfLut.flush(); } } @@ -8165,6 +8182,13 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ deferred_target->bindTexture(3, channel, LLTexUnit::TFO_POINT); // frag_data[3] } + channel = shader.enableTexture(LLShaderMgr::DEFERRED_BRDF_LUT, LLTexUnit::TT_TEXTURE); + if (channel > -1) + { + mPbrBrdfLut.bindTexture(0, channel); + } + + channel = shader.enableTexture(LLShaderMgr::DEFERRED_DEPTH, deferred_depth_target->getUsage()); if (channel > -1) { @@ -8304,7 +8328,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ } bindReflectionProbes(shader); - + if (gAtmosphere) { // bind precomputed textures necessary for calculating sun and sky luminance @@ -9212,6 +9236,7 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) shader.disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, deferred_target->getUsage()); shader.disableTexture(LLShaderMgr::DEFERRED_SPECULAR, deferred_target->getUsage()); shader.disableTexture(LLShaderMgr::DEFERRED_EMISSIVE, deferred_target->getUsage()); + shader.disableTexture(LLShaderMgr::DEFERRED_BRDF_LUT); shader.disableTexture(LLShaderMgr::DEFERRED_DEPTH, deferred_depth_target->getUsage()); shader.disableTexture(LLShaderMgr::DEFERRED_LIGHT, deferred_light_target->getUsage()); shader.disableTexture(LLShaderMgr::DIFFUSE_MAP); |