From bdb53fd56d56c659941e7e63f83cefc366acef6d Mon Sep 17 00:00:00 2001
From: RunitaiLinden <davep@lindenlab.com>
Date: Thu, 16 Nov 2023 16:46:12 -0600
Subject: SL-20611 Make haze effect local lights -- move sky and water haze to
 their own passes and unify sky and water haze in forward rendering shaders.

---
 indra/llrender/llshadermgr.cpp | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 0e7f9e1331..f14216f3d8 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -81,14 +81,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 	// NOTE order of shader object attaching is VERY IMPORTANT!!!
 	if (features->calculatesAtmospherics)
 	{
-		if (features->hasWaterFog)
-		{
-			if (!shader->attachVertexObject("windlight/atmosphericsVarsWaterV.glsl"))
-			{
-				return FALSE;
-			}
-		}
-        else if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl"))
+		if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl"))
 		{
 			return FALSE;
 		}
@@ -201,14 +194,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 
 	if(features->calculatesAtmospherics || features->hasGamma || features->isDeferred)
 	{
-		if (features->hasWaterFog)
-		{
-			if (!shader->attachFragmentObject("windlight/atmosphericsVarsWaterF.glsl"))
-			{
-				return FALSE;
-			}
-		}
-        else if (!shader->attachFragmentObject("windlight/atmosphericsVarsF.glsl"))
+		if (!shader->attachFragmentObject("windlight/atmosphericsVarsF.glsl"))
 		{
 			return FALSE;
 		}
@@ -292,7 +278,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 	}
 	
 	// NOTE order of shader object attaching is VERY IMPORTANT!!!
-	if (features->hasWaterFog)
+	if (features->hasWaterFog || features->hasAtmospherics)
 	{
         if (!shader->attachFragmentObject("environment/waterFogF.glsl"))
 		{
-- 
cgit v1.2.3


From 964f9e74d5e97fc46fc74d6afff97dad5c6381c3 Mon Sep 17 00:00:00 2001
From: RunitaiLinden <davep@lindenlab.com>
Date: Fri, 17 Nov 2023 10:10:58 -0600
Subject: SL-20611 followup -- remove now unused glsl files.  Fix transparent
 water.

---
 indra/llrender/llglslshader.h  |  1 -
 indra/llrender/llshadermgr.cpp | 74 +++++++++---------------------------------
 2 files changed, 16 insertions(+), 59 deletions(-)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index b8071248e2..43d095f73a 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -41,7 +41,6 @@ public:
     bool hasLighting = false; // implies no transport (it's possible to have neither though)
     bool isAlphaLighting = false; // indicates lighting shaders need not be linked in (lighting performed directly in alpha shader to match deferred lighting functions)
     bool isSpecular = false;
-    bool hasWaterFog = false; // implies no gamma
     bool hasTransport = false; // implies no lighting (it's possible to have neither though)
     bool hasSkinning = false;
     bool hasObjectSkinning = false;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index f14216f3d8..f78be910d2 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -278,7 +278,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 	}
 	
 	// NOTE order of shader object attaching is VERY IMPORTANT!!!
-	if (features->hasWaterFog || features->hasAtmospherics)
+	if (features->hasAtmospherics)
 	{
         if (!shader->attachFragmentObject("environment/waterFogF.glsl"))
 		{
@@ -288,82 +288,40 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
 	
 	if (features->hasLighting)
 	{
-		if (features->hasWaterFog)
+		if (features->disableTextureIndex)
 		{
-			if (features->disableTextureIndex)
+			if (features->hasAlphaMask)
 			{
-				if (features->hasAlphaMask)
+                if (!shader->attachFragmentObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
 				{
-                    if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl"))
-					{
-						return FALSE;
-					}
-				}
-				else
-				{
-                    if (!shader->attachFragmentObject("lighting/lightWaterNonIndexedF.glsl"))
-					{
-						return FALSE;
-					}
+					return FALSE;
 				}
 			}
-			else 
+			else
 			{
-				if (features->hasAlphaMask)
+                if (!shader->attachFragmentObject("lighting/lightNonIndexedF.glsl"))
 				{
-                    if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskF.glsl"))
-					{
-						return FALSE;
-					}
-				}
-				else
-				{
-                    if (!shader->attachFragmentObject("lighting/lightWaterF.glsl"))
-					{
-						return FALSE;
-					}
+					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
 		}
-		
-		else
+		else 
 		{
-			if (features->disableTextureIndex)
+			if (features->hasAlphaMask)
 			{
-				if (features->hasAlphaMask)
-				{
-                    if (!shader->attachFragmentObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
-					{
-						return FALSE;
-					}
-				}
-				else
+                if (!shader->attachFragmentObject("lighting/lightAlphaMaskF.glsl"))
 				{
-                    if (!shader->attachFragmentObject("lighting/lightNonIndexedF.glsl"))
-					{
-						return FALSE;
-					}
+					return FALSE;
 				}
 			}
-			else 
+			else
 			{
-				if (features->hasAlphaMask)
-				{
-                    if (!shader->attachFragmentObject("lighting/lightAlphaMaskF.glsl"))
-					{
-						return FALSE;
-					}
-				}
-				else
+                if (!shader->attachFragmentObject("lighting/lightF.glsl"))
 				{
-                    if (!shader->attachFragmentObject("lighting/lightF.glsl"))
-					{
-						return FALSE;
-					}
+					return FALSE;
 				}
-				shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 			}
+			shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
 		}
 	}
 	
-- 
cgit v1.2.3