From e454c3d48cbefd37de0564a5ba85e0d127850456 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 5 Jun 2013 12:31:55 -0500 Subject: NORSPEC-238, NORSPEC-225 Fix for specular map alpha channel being improperly used and glossiness bludgeoning environment intensity. Reviewed/written by Graham. --- .../newview/app_settings/shaders/class1/deferred/materialF.glsl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/materialF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index bb8d26c9dc..9c79f3a51f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -419,7 +419,7 @@ VARYING vec2 vary_texcoord2; #endif uniform float env_intensity; -uniform vec4 specular_color; +uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) uniform float minimum_alpha; @@ -461,9 +461,10 @@ void main() #endif #if HAS_SPECULAR_MAP - vec4 spec = texture2D(specularMap, vary_texcoord2.xy)*specular_color; + vec4 spec = texture2D(specularMap, vary_texcoord2.xy); + spec.rgb *= specular_color.rgb; #else - vec4 spec = specular_color; + vec4 spec = vec4(specular_color.rgb, 1.0); #endif #if HAS_NORMAL_MAP @@ -495,7 +496,7 @@ void main() //final_color.rgb *= 1 - spec.a * env_intensity; //final_specular.rgb *= specular_color.rgb; - vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); + vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0); final_specular.a = specular_color.a * norm.a; #else vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); -- cgit v1.2.3