From fbbbb80752e91deff0bbaf5893210fddff53eb13 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 24 Apr 2013 05:16:02 -0400 Subject: Fix for overbrigtened alpha blended objects in deferred. Linearize diffuse surface color in the vertex shader before passing it to the fragment shader. --- indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 4c26621a88..6a1bfd5bef 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -172,17 +172,19 @@ void main() //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - vary_pointlight_col = diffuse_color.rgb; + vec3 diff = pow(diffuse_color.rgb, vec3(2.2)); + + vary_pointlight_col = diff; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb*diffuse_color.rgb; + vary_ambient = col.rgb*diff; vary_directional.rgb = atmosAffectDirectionalLight(1); - col.rgb = col.rgb*diffuse_color.rgb; + col.rgb = col.rgb*diff; #if INDEX_MODE != NON_INDEXED_NO_COLOR vertex_color = col; #endif -- cgit v1.2.3