diff options
author | Dave Parks <davep@lindenlab.com> | 2022-12-16 08:59:02 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-12-16 08:59:02 -0600 |
commit | 57c54ec4b75aac8ba2a4235f88760bd8534f2c7a (patch) | |
tree | 62b278bec6c9c53b491953f85cfc2b486e8aff24 /indra/newview | |
parent | 6f7eeecdb33c14cb3044118a9d6e2eea900af55e (diff) |
SL-18851 Fix for PBR materials sometimes not casting shadows when they should.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl | 4 | ||||
-rw-r--r-- | indra/newview/lldrawpoolpbropaque.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.h | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 1a344045fe..06ebeb8281 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -48,6 +48,8 @@ void main() discard; } +#if !defined(GLTF) + #if !defined(IS_FULLBRIGHT) alpha *= vertex_color.a; #endif @@ -64,7 +66,7 @@ void main() discard; } } - +#endif frag_color = vec4(1,1,1,1); diff --git a/indra/newview/lldrawpoolpbropaque.cpp b/indra/newview/lldrawpoolpbropaque.cpp index d0c588b65a..c39060a326 100644 --- a/indra/newview/lldrawpoolpbropaque.cpp +++ b/indra/newview/lldrawpoolpbropaque.cpp @@ -48,7 +48,7 @@ void LLDrawPoolGLTFPBR::renderDeferred(S32 pass) for (int i = 0; i < 2; ++i) { bool rigged = (i == 1); - LLGLSLShader* shader = LLPipeline::sShadowRender ? &gDeferredShadowAlphaMaskProgram : &gDeferredPBROpaqueProgram; + LLGLSLShader* shader = LLPipeline::sShadowRender ? &gDeferredShadowGLTFAlphaMaskProgram : &gDeferredPBROpaqueProgram; U32 vertex_data_mask = getVertexDataMask(); if (rigged) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index b7e2fd4cb4..757a946fda 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -215,6 +215,7 @@ LLGLSLShader gDeferredShadowProgram; LLGLSLShader gDeferredSkinnedShadowProgram; LLGLSLShader gDeferredShadowCubeProgram; LLGLSLShader gDeferredShadowAlphaMaskProgram; +LLGLSLShader gDeferredShadowGLTFAlphaMaskProgram; LLGLSLShader gDeferredSkinnedShadowAlphaMaskProgram; LLGLSLShader gDeferredShadowFullbrightAlphaMaskProgram; LLGLSLShader gDeferredSkinnedShadowFullbrightAlphaMaskProgram; @@ -1263,6 +1264,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedShadowProgram.unload(); gDeferredShadowCubeProgram.unload(); gDeferredShadowAlphaMaskProgram.unload(); + gDeferredShadowGLTFAlphaMaskProgram.unload(); gDeferredSkinnedShadowAlphaMaskProgram.unload(); gDeferredShadowFullbrightAlphaMaskProgram.unload(); gDeferredSkinnedShadowFullbrightAlphaMaskProgram.unload(); @@ -2584,6 +2586,22 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); llassert(success); } + + + if (success) + { + gDeferredShadowGLTFAlphaMaskProgram.mName = "Deferred Shadow Alpha Mask Shader"; + gDeferredShadowGLTFAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredShadowGLTFAlphaMaskProgram.mShaderFiles.clear(); + gDeferredShadowGLTFAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER)); + gDeferredShadowGLTFAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); + gDeferredShadowGLTFAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gDeferredShadowGLTFAlphaMaskProgram.clearPermutations(); + gDeferredShadowGLTFAlphaMaskProgram.addPermutation("GLTF", "1"); + gDeferredShadowGLTFAlphaMaskProgram.mRiggedVariant = &gDeferredSkinnedShadowAlphaMaskProgram; + success = gDeferredShadowGLTFAlphaMaskProgram.createShader(NULL, NULL); + llassert(success); + } if (success) { diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index d26750f230..9ded72c6a7 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -278,6 +278,7 @@ extern LLGLSLShader gDeferredSoftenWaterProgram; extern LLGLSLShader gDeferredShadowProgram; extern LLGLSLShader gDeferredShadowCubeProgram; extern LLGLSLShader gDeferredShadowAlphaMaskProgram; +extern LLGLSLShader gDeferredShadowGLTFAlphaMaskProgram; extern LLGLSLShader gDeferredShadowFullbrightAlphaMaskProgram; extern LLGLSLShader gDeferredPostProgram; extern LLGLSLShader gDeferredCoFProgram; |