summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-08-12 15:55:25 -0700
committerGraham Linden <graham@lindenlab.com>2013-08-12 15:55:25 -0700
commit51dfcb9c67f7c3464bf3640adfdd87a061f60390 (patch)
treeb7f36fd43a31a961e049c8167c57da81f1210b9b /indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
parent61129c73c97accf297943d6bc5beea3c09579084 (diff)
NORSPEC-342 WIP MATBUG-347 make impostor rendering not contribute to depth for mostly-transparent buffer pixels, aka hair in ALM only
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaF.glsl19
1 files changed, 17 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 d0c7cc9dde..f35ff25dcb 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -531,6 +531,19 @@ void main()
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
#endif
+#if FOR_IMPOSTOR
+ vec4 color;
+ color.rgb = diff.rgb;
+ color.a = diff.a;
+
+ // Insure we don't pollute depth with invis pixels in impostor rendering
+ //
+ if (color.a < 0.01)
+ {
+ discard;
+ }
+#else
+
#ifdef USE_VERTEX_COLOR
float final_alpha = diff.a * vertex_color.a;
diff.rgb *= vertex_color.rgb;
@@ -538,6 +551,7 @@ void main()
float final_alpha = diff.a;
#endif
+
vec4 gamma_diff = diff;
diff.rgb = srgb_to_linear(diff.rgb);
@@ -567,11 +581,10 @@ void main()
ambient = (1.0-ambient);
color.rgb *= ambient;
-
color.rgb += atmosAffectDirectionalLight(final_da);
color.rgb *= gamma_diff.rgb;
- color.rgb = mix(diff.rgb, color.rgb, final_alpha);
+ //color.rgb = mix(diff.rgb, color.rgb, final_alpha);
color.rgb = atmosLighting(color.rgb);
color.rgb = scaleSoftClip(color.rgb);
@@ -602,6 +615,8 @@ void main()
color = applyWaterFogDeferred(pos.xyz, color);
#endif
+#endif
+
frag_color = color;
}