summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/materialF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl9
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 9b2d308824..8d89485e22 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
@@ -492,7 +493,7 @@ void main()
vec4 final_specular = spec;
#if HAS_SPECULAR_MAP
- vec4 final_normal = vec4(encode_normal(normalize(tnorm)), min(spec.a, 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);