From 6f62251a3d29ced4193a9a80965f33fe0318d5a0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 22 Jul 2013 10:29:49 -0700 Subject: MATBUG-306 fix alpha knock-on from underwater lightcurve matching --- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 8 ++++---- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 69b29269c7..2eef99dea7 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -288,8 +288,7 @@ void main() diff.rgb = srgb_to_linear(diff.rgb); #ifdef USE_VERTEX_COLOR - diff.rgb *= vertex_color.rgb; - float vertex_color_alpha = vertex_color.a; + float vertex_color_alpha = diff.a * vertex_color.a; #else float vertex_color_alpha = 1.0; #endif @@ -306,8 +305,9 @@ void main() vec4 col = vec4(vary_ambient + dlight, vertex_color_alpha); #endif - vec4 color = gamma_diff * col; - + vec4 color = col; + color.rgb *= gamma_diff.rgb; + color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 7415415290..34189deaad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -186,16 +186,13 @@ void main() color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClip(color.rgb); - //color.a = spec * sunAngle2; + color.a = sunAngle2; //wavef.z *= 0.1f; //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - // this is needed for materials in reflections, but not otherwise - // - //frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse - frag_data[0] = vec4(color.rgb, 0.5); // diffuse + frag_data[0] = vec4(color.rgb, color.a); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), screenspacewavef.z * 0.16, 0.0);// normalxyz, env intensity } -- cgit v1.2.3