diff options
author | Graham Linden <graham@lindenlab.com> | 2013-08-12 15:55:25 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-08-12 15:55:25 -0700 |
commit | 51dfcb9c67f7c3464bf3640adfdd87a061f60390 (patch) | |
tree | b7f36fd43a31a961e049c8167c57da81f1210b9b /indra/newview/app_settings | |
parent | 61129c73c97accf297943d6bc5beea3c09579084 (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')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 19 | ||||
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 2 |
2 files changed, 19 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; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index d1eaabf901..506323fdce 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -86,6 +86,8 @@ void main() vec4 norm = texture2D(normalMap, vary_texcoord0.xy); vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + col.rgb = linear_to_srgb(col.rgb); + frag_data[0] = vec4(col.rgb, col.a); frag_data[1] = spec; frag_data[2] = vec4(norm.xy,0,0); |