summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl22
1 files changed, 4 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index fc0e6b2388..6e0218cb9c 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -68,22 +68,6 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
-#ifdef SINGLE_FP_ONLY
-vec2 encode_normal(vec3 n)
-{
- vec2 sn;
- sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f);
- return sn;
-}
-
-vec3 decode_normal (vec2 enc)
-{
- vec3 n;
- n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f);
- n.z = sqrt(1.0f - dot(n.xy,n.xy));
- return n;
-}
-#else
vec2 encode_normal(vec3 n)
{
float f = sqrt(8 * n.z + 8);
@@ -100,7 +84,6 @@ vec3 decode_normal (vec2 enc)
n.z = 1-f/2;
return n;
}
-#endif
vec4 correctWithGamma(vec4 col)
{
@@ -332,7 +315,10 @@ void main()
}
}
}
-
+
+ //not sure why, but this line prevents MATBUG-194
+ col = max(col, vec3(0.0));
+
frag_color.rgb = col;
frag_color.a = 0.0;
}