From 51dfcb9c67f7c3464bf3640adfdd87a061f60390 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 15:55:25 -0700 Subject: NORSPEC-342 WIP MATBUG-347 make impostor rendering not contribute to depth for mostly-transparent buffer pixels, aka hair in ALM only --- .../app_settings/shaders/class1/deferred/alphaF.glsl | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl') 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); @@ -600,6 +613,8 @@ void main() #ifdef WATER_FOG color = applyWaterFogDeferred(pos.xyz, color); +#endif + #endif frag_color = color; -- cgit v1.2.3