From ed3b5184990822162840e1e7611d338a880e67a6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 3 Jul 2013 10:42:03 -0700 Subject: NORSPEC-295 make a deferred path version of fullbright alpha mask shader so we can included gamma ops --- indra/newview/lldrawpoolsimple.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 2cf9d833c6..e219769a0c 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -625,14 +625,16 @@ S32 LLDrawPoolFullbright::getNumPasses() void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) { - gObjectFullbrightAlphaMaskProgram.bind(); + if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred) { + gObjectFullbrightAlphaMaskProgram.bind(); gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f); } else { - gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + gDeferredFullbrightAlphaMaskProgram.bind(); + gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); } } @@ -646,7 +648,14 @@ void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) { - gObjectFullbrightAlphaMaskProgram.unbind(); + if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred) + { + gObjectFullbrightAlphaMaskProgram.unbind(); + } + else + { + gDeferredFullbrightAlphaMaskProgram.unbind(); + } LLRenderPass::endRenderPass(pass); } -- cgit v1.2.3 From 8712086a4bcf1f0f7527a916baafc9e65667e4e8 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 18 Jul 2013 06:37:22 -0700 Subject: NORSPEC-314 work-around mystery mac GeForce crash from new shader for nspec 295 --- indra/newview/lldrawpoolsimple.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index e219769a0c..87fbeaf2c0 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -633,8 +633,15 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) } else { +#if LL_DARWIN + // the OS X 10.6.8 GeForce driver is a real POS + // this is a work-around for NORSPEC-314 + gObjectFullbrightAlphaMaskProgram.bind(); + gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#else gDeferredFullbrightAlphaMaskProgram.bind(); gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#endif } } @@ -654,7 +661,11 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) } else { +#if LL_DARWIN + gObjectFullbrightAlphaMaskProgram.unbind(); +#else gDeferredFullbrightAlphaMaskProgram.unbind(); +#endif } LLRenderPass::endRenderPass(pass); } -- cgit v1.2.3 From caefe0e74cf553de41c6c8748dd2ea5ef4d82c06 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sun, 21 Jul 2013 14:28:54 -0700 Subject: NORSPEC-311 fix alpha / opaque lighting diffs --- indra/newview/lldrawpoolsimple.cpp | 48 ++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 87fbeaf2c0..d51b84cfbc 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -111,7 +111,14 @@ void LLDrawPoolGlow::render(S32 pass) LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; shader->bind(); - shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f); + if (LLPipeline::sRenderDeferred) + { + shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } + else + { + shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f); + } LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); @@ -536,7 +543,15 @@ void LLDrawPoolFullbright::prerender() void LLDrawPoolFullbright::beginPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.bind(); + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightWaterProgram.bind(); + } + else + { + gDeferredFullbrightProgram.bind(); + } + } void LLDrawPoolFullbright::renderPostDeferred(S32 pass) @@ -550,7 +565,14 @@ void LLDrawPoolFullbright::renderPostDeferred(S32 pass) void LLDrawPoolFullbright::endPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.unbind(); + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightWaterProgram.unbind(); + } + else + { + gDeferredFullbrightProgram.unbind(); + } LLRenderPass::endRenderPass(pass); } @@ -633,15 +655,17 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) } else { -#if LL_DARWIN - // the OS X 10.6.8 GeForce driver is a real POS - // this is a work-around for NORSPEC-314 - gObjectFullbrightAlphaMaskProgram.bind(); - gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); -#else - gDeferredFullbrightAlphaMaskProgram.bind(); - gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); -#endif + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightAlphaMaskWaterProgram.bind(); + gDeferredFullbrightAlphaMaskWaterProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } + else + { + gDeferredFullbrightAlphaMaskProgram.bind(); + gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } + } } -- cgit v1.2.3 From fa74313e7db1132cd76313864d72aac27902a126 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 23 Jul 2013 04:52:59 -0700 Subject: NORSPEC-314 WIP make work-around easier to flip and add 9800M as an evil mac --- indra/newview/lldrawpoolsimple.cpp | 40 ++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index d51b84cfbc..06e8a3537a 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -37,6 +37,7 @@ #include "llviewershadermgr.h" #include "llrender.h" +#define GE_FORCE_WORKAROUND LL_DARWIN static LLGLSLShader* simple_shader = NULL; static LLGLSLShader* fullbright_shader = NULL; @@ -654,7 +655,20 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f); } else - { + { + +#if GE_FORCE_WORKAROUND + // Work-around until we can figure out why the right shader causes + // the GeForce driver to go tango uniform on OS X 10.6.8 only + // + if (gGLManager.mIsMobileGF) + { + gObjectFullbrightAlphaMaskProgram.bind(); + gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + return; + } +#endif + if (LLPipeline::sUnderWaterRender) { gDeferredFullbrightAlphaMaskWaterProgram.bind(); @@ -665,7 +679,6 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) gDeferredFullbrightAlphaMaskProgram.bind(); gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); } - } } @@ -685,11 +698,26 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) } else { -#if LL_DARWIN - gObjectFullbrightAlphaMaskProgram.unbind(); -#else - gDeferredFullbrightAlphaMaskProgram.unbind(); + +#if GE_FORCE_WORKAROUND + // Work-around until we can figure out why the right shader causes + // the GeForce driver to go tango uniform on OS X 10.6.8 only + // + if (gGLManager.mIsMobileGF) + { + gObjectFullbrightAlphaMaskProgram.unbind(); + } + else #endif + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightAlphaMaskWaterProgram.unbind(); + } + else + { + gDeferredFullbrightAlphaMaskProgram.unbind(); + } + } LLRenderPass::endRenderPass(pass); } -- cgit v1.2.3 From b411179bd0cffdf02b3109b72c7b79e4f7a5a2e3 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 23 Jul 2013 13:48:57 -0700 Subject: NORSPEC-314 make work-around apply to all Macs for now --- indra/newview/lldrawpoolsimple.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 06e8a3537a..aee9d19d19 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -657,18 +657,13 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) else { +// Work-around until we can figure out why the right shader causes +// the GeForce driver to go tango uniform on OS X 10.6.8 only +// #if GE_FORCE_WORKAROUND - // Work-around until we can figure out why the right shader causes - // the GeForce driver to go tango uniform on OS X 10.6.8 only - // - if (gGLManager.mIsMobileGF) - { - gObjectFullbrightAlphaMaskProgram.bind(); - gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); - return; - } -#endif - + gObjectFullbrightAlphaMaskProgram.bind(); + gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#else if (LLPipeline::sUnderWaterRender) { gDeferredFullbrightAlphaMaskWaterProgram.bind(); @@ -679,7 +674,9 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) gDeferredFullbrightAlphaMaskProgram.bind(); gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); } +#endif } + } void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) @@ -699,16 +696,12 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) else { -#if GE_FORCE_WORKAROUND - // Work-around until we can figure out why the right shader causes - // the GeForce driver to go tango uniform on OS X 10.6.8 only - // - if (gGLManager.mIsMobileGF) - { - gObjectFullbrightAlphaMaskProgram.unbind(); - } - else -#endif +// Work-around until we can figure out why the right shader causes +// the GeForce driver to go tango uniform on OS X 10.6.8 only +// +#if GE_FORCE_WORKAROUND + gObjectFullbrightAlphaMaskProgram.unbind(); +#else if (LLPipeline::sUnderWaterRender) { gDeferredFullbrightAlphaMaskWaterProgram.unbind(); @@ -717,6 +710,7 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) { gDeferredFullbrightAlphaMaskProgram.unbind(); } +#endif } LLRenderPass::endRenderPass(pass); -- cgit v1.2.3 From a43a762c0ddf3ecac2056b36d0ede1f99e71231e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 17:22:47 -0700 Subject: NORSPEC-342 fix blocky hair in ALM from writing depth for transparent pixels in impostor rendering --- indra/newview/lldrawpoolsimple.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolsimple.cpp') diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index aee9d19d19..8926f64c64 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -156,7 +156,11 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_SIMPLE); - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gObjectSimpleImpostorProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gObjectSimpleWaterProgram; } -- cgit v1.2.3