diff options
author | Dave Parks <davep@lindenlab.com> | 2022-12-05 11:48:50 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-12-05 11:48:50 -0600 |
commit | 3c20f0b1d4dd7257dc608823d82b6f798c492b43 (patch) | |
tree | 097a0449791247c160c07fdea2c0a0a438e837f5 /indra/newview/llviewershadermgr.cpp | |
parent | 598e33e2e880388a457a496bea5b5d25bdf2aa28 (diff) |
SL-18692 Fix for fullbright alpha not clipping against water plane (also fixes ultraspace particles).
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ff9f767940..a742264801 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -234,8 +234,11 @@ LLGLSLShader gDeferredSkinnedAlphaWaterProgram; LLGLSLShader gDeferredAvatarEyesProgram; LLGLSLShader gDeferredFullbrightProgram; LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +LLGLSLShader gDeferredFullbrightAlphaMaskAlphaProgram; LLGLSLShader gDeferredFullbrightWaterProgram; LLGLSLShader gDeferredSkinnedFullbrightWaterProgram; +LLGLSLShader gDeferredFullbrightWaterAlphaProgram; +LLGLSLShader gDeferredSkinnedFullbrightWaterAlphaProgram; LLGLSLShader gDeferredFullbrightAlphaMaskWaterProgram; LLGLSLShader gDeferredSkinnedFullbrightAlphaMaskWaterProgram; LLGLSLShader gDeferredEmissiveProgram; @@ -255,6 +258,7 @@ LLGLSLShader gDeferredFullbrightShinyProgram; LLGLSLShader gDeferredSkinnedFullbrightShinyProgram; LLGLSLShader gDeferredSkinnedFullbrightProgram; LLGLSLShader gDeferredSkinnedFullbrightAlphaMaskProgram; +LLGLSLShader gDeferredSkinnedFullbrightAlphaMaskAlphaProgram; LLGLSLShader gNormalMapGenProgram; LLGLSLShader gDeferredGenBrdfLutProgram; @@ -355,14 +359,18 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredSkinnedAlphaWaterProgram); mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredFullbrightAlphaMaskProgram); + mShaderList.push_back(&gDeferredFullbrightAlphaMaskAlphaProgram); mShaderList.push_back(&gDeferredFullbrightWaterProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightWaterProgram); + mShaderList.push_back(&gDeferredFullbrightWaterAlphaProgram); + mShaderList.push_back(&gDeferredSkinnedFullbrightWaterAlphaProgram); mShaderList.push_back(&gDeferredFullbrightAlphaMaskWaterProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightAlphaMaskWaterProgram); mShaderList.push_back(&gDeferredFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightAlphaMaskProgram); + mShaderList.push_back(&gDeferredSkinnedFullbrightAlphaMaskAlphaProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredSkinnedEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); @@ -1273,8 +1281,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaWaterProgram.unload(); gDeferredFullbrightProgram.unload(); gDeferredFullbrightAlphaMaskProgram.unload(); + gDeferredFullbrightAlphaMaskAlphaProgram.unload(); gDeferredFullbrightWaterProgram.unload(); gDeferredSkinnedFullbrightWaterProgram.unload(); + gDeferredFullbrightWaterAlphaProgram.unload(); + gDeferredSkinnedFullbrightWaterAlphaProgram.unload(); gDeferredFullbrightAlphaMaskWaterProgram.unload(); gDeferredSkinnedFullbrightAlphaMaskWaterProgram.unload(); gDeferredEmissiveProgram.unload(); @@ -1296,6 +1307,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedFullbrightShinyProgram.unload(); gDeferredSkinnedFullbrightProgram.unload(); gDeferredSkinnedFullbrightAlphaMaskProgram.unload(); + gDeferredSkinnedFullbrightAlphaMaskAlphaProgram.unload(); gDeferredHighlightProgram.unload(); gDeferredHighlightNormalProgram.unload(); @@ -2213,6 +2225,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightAlphaMaskProgram.mShaderFiles.clear(); gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gDeferredFullbrightAlphaMaskProgram.clearPermutations(); gDeferredFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK","1"); gDeferredFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredFullbrightAlphaMaskProgram, gDeferredSkinnedFullbrightAlphaMaskProgram); @@ -2220,6 +2233,27 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gDeferredFullbrightAlphaMaskAlphaProgram.mName = "Deferred Fullbright Alpha Masking Alpha Shader"; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.hasGamma = true; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.hasTransport = true; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.hasSrgb = true; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.isDeferred = true; + gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredFullbrightAlphaMaskAlphaProgram.mShaderFiles.clear(); + gDeferredFullbrightAlphaMaskAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightAlphaMaskAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gDeferredFullbrightAlphaMaskAlphaProgram.clearPermutations(); + gDeferredFullbrightAlphaMaskAlphaProgram.addPermutation("HAS_ALPHA_MASK", "1"); + gDeferredFullbrightAlphaMaskAlphaProgram.addPermutation("IS_ALPHA", "1"); + gDeferredFullbrightAlphaMaskAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = make_rigged_variant(gDeferredFullbrightAlphaMaskAlphaProgram, gDeferredSkinnedFullbrightAlphaMaskAlphaProgram); + success = success && gDeferredFullbrightAlphaMaskAlphaProgram.createShader(NULL, NULL); + llassert(success); + } + if (success) { gDeferredFullbrightWaterProgram.mName = "Deferred Fullbright Underwater Shader"; @@ -2240,6 +2274,29 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gDeferredFullbrightWaterAlphaProgram.mName = "Deferred Fullbright Underwater Alpha Shader"; + gDeferredFullbrightWaterAlphaProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.hasGamma = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.hasTransport = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.hasWaterFog = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.hasSrgb = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.isDeferred = true; + gDeferredFullbrightWaterAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredFullbrightWaterAlphaProgram.mShaderFiles.clear(); + gDeferredFullbrightWaterAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightWaterAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gDeferredFullbrightWaterAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gDeferredFullbrightWaterAlphaProgram.mShaderGroup = LLGLSLShader::SG_WATER; + gDeferredFullbrightWaterAlphaProgram.clearPermutations(); + gDeferredFullbrightWaterAlphaProgram.addPermutation("WATER_FOG", "1"); + gDeferredFullbrightWaterAlphaProgram.addPermutation("IS_ALPHA", "1"); + success = make_rigged_variant(gDeferredFullbrightWaterAlphaProgram, gDeferredSkinnedFullbrightWaterAlphaProgram); + success = success && gDeferredFullbrightWaterAlphaProgram.createShader(NULL, NULL); + llassert(success); + } + if (success) { gDeferredFullbrightAlphaMaskWaterProgram.mName = "Deferred Fullbright Underwater Alpha Masking Shader"; |