diff options
author | Graham Linden <graham@lindenlab.com> | 2019-07-12 14:45:15 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-07-12 14:45:15 -0700 |
commit | afdda55b8f6ad58c3e57185d3c352a923f4893aa (patch) | |
tree | 31c4738a8947cf7e0a5704fbd3031ebbee986208 /indra/newview | |
parent | 11331604767b2dcf50c7a84f24843ce8e531a409 (diff) |
SL-11588
Make avatar alpha shader ignore vertex color again.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 8 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 10 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 5 |
3 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 759c49a0fa..0c4707098b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -53,7 +53,9 @@ VARYING vec3 vary_position; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; +#ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; +#endif uniform mat4 proj_mat; uniform mat4 inv_proj; @@ -203,9 +205,13 @@ void main() vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir; - float final_alpha = diffuse_linear.a * vertex_color.a; + float final_alpha = diffuse_linear.a; + +#ifdef USE_VERTEX_COLOR + final_alpha *= vertex_color.a; diffuse_srgb.rgb *= vertex_color.rgb; diffuse_linear.rgb *= vertex_color.rgb; +#endif vec3 sunlit; vec3 amblit; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 619c4e9738..506118d381 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -40,7 +40,11 @@ void passTextureIndex(); #endif ATTRIBUTE vec3 normal; + +#ifdef USE_VERTEX_COLOR ATTRIBUTE vec4 diffuse_color; +#endif + ATTRIBUTE vec2 texcoord0; #ifdef HAS_SKIN @@ -53,7 +57,11 @@ mat4 getSkinnedTransform(); VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; + +#ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; +#endif + VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -110,7 +118,9 @@ void main() vary_norm = norm; vary_position = pos.xyz; +#ifdef USE_VERTEX_COLOR vertex_color = diffuse_color; +#endif #ifdef HAS_SKIN vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 5297e59e18..c874b3cf59 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1485,6 +1485,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.clearPermutations(); gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); + gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); if (use_sun_shadow) { @@ -1951,7 +1952,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.clearPermutations(); - + gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); if (use_sun_shadow) { @@ -2012,6 +2013,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaImpostorProgram.clearPermutations(); gDeferredAlphaImpostorProgram.addPermutation("USE_INDEXED_TEX", "1"); gDeferredAlphaImpostorProgram.addPermutation("FOR_IMPOSTOR", "1"); + gDeferredAlphaImpostorProgram.addPermutation("USE_VERTEX_COLOR", "1"); if (use_sun_shadow) { @@ -2060,6 +2062,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaWaterProgram.clearPermutations(); gDeferredAlphaWaterProgram.addPermutation("USE_INDEXED_TEX", "1"); gDeferredAlphaWaterProgram.addPermutation("WATER_FOG", "1"); + gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1"); if (use_sun_shadow) { gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", "1"); |