From 0afe2491ab6a05bf62a2fce438dfdbbaf0b191df Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 17 Mar 2010 22:22:02 -0500
Subject: [PATCH] CTS-110 Remove soft alpha in deferred pipeline (breaks some
 content).  Will revisit soft alpha in materials project.

---
 .../app_settings/shaders/class1/deferred/alphaF.glsl  | 11 -----------
 .../shaders/class1/deferred/fullbrightF.glsl          | 11 -----------
 .../app_settings/shaders/class2/deferred/alphaF.glsl  | 11 -----------
 indra/newview/pipeline.cpp                            |  1 -
 4 files changed, 34 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 4fb109d6870..fea2e160908 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -24,8 +24,6 @@ varying vec3 vary_fragcoord;
 varying vec3 vary_position;
 varying vec3 vary_light;
 
-uniform float alpha_soften;
-
 uniform mat4 inv_proj;
 
 vec4 getPosition(vec2 pos_screen)
@@ -57,15 +55,6 @@ void main()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	if (samp_pos.z != 0.0 && gl_Color.a < 1.0)
-	{
-		float dist_factor = alpha_soften;
-		float a = gl_Color.a;
-		a *= a;
-		dist_factor *= 1.0/(1.0-a);
-		color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0);
-	}
-	
 	//gl_FragColor = gl_Color;
 	gl_FragColor = color;
 	//gl_FragColor = vec4(1,0,1,1);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index e518bddb984..0db9586a88d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -23,8 +23,6 @@ varying vec4 vary_position;
 varying vec3 vary_normal;
 varying vec3 vary_fragcoord;
 
-uniform float alpha_soften;
-
 uniform mat4 inv_proj;
 
 vec4 getPosition(vec2 pos_screen)
@@ -56,15 +54,6 @@ void main()
 
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 
-	if (samp_pos.z != 0.0 && color.a < 1.0)
-	{
-		float dist_factor = alpha_soften;
-		float a = color.a;
-		a *= a;
-		dist_factor *= 1.0/(1.0-a);
-		color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0);
-	}
-
 	//gl_FragColor = gl_Color;
 	gl_FragColor = color;
 	//gl_FragColor = vec4(1,0,1,1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index ad16de6d816..665fe16b439 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -29,8 +29,6 @@ varying vec3 vary_fragcoord;
 varying vec3 vary_position;
 varying vec3 vary_light;
 
-uniform float alpha_soften;
-
 uniform float shadow_bias;
 
 uniform mat4 inv_proj;
@@ -115,15 +113,6 @@ void main()
 
 	color.rgb = scaleSoftClip(color.rgb);
 
-	if (samp_pos.z != 0.0 && gl_Color.a < 1.0)
-	{
-		float dist_factor = alpha_soften;
-		float a = gl_Color.a;
-		a *= a;
-		dist_factor *= 1.0/(1.0-a);
-		color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0);
-	}
-	
 	//gl_FragColor = gl_Color;
 	gl_FragColor = color;
 	//gl_FragColor = vec4(1,0,1,1)*shadow;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e65c8b9af8b..ee5ed32a830 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -6249,7 +6249,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen
 
 	shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight());
 	shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f);
-	shader.uniform1f("alpha_soften", gSavedSettings.getF32("RenderDeferredAlphaSoften"));
 	shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset"));
 	shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias"));
 	shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale"));
-- 
GitLab