summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-12 14:45:15 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-12 14:45:15 -0700
commitafdda55b8f6ad58c3e57185d3c352a923f4893aa (patch)
tree31c4738a8947cf7e0a5704fbd3031ebbee986208 /indra/newview/app_settings/shaders
parent11331604767b2dcf50c7a84f24843ce8e531a409 (diff)
SL-11588
Make avatar alpha shader ignore vertex color again.
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl10
2 files changed, 17 insertions, 1 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);