summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-02-03 17:18:39 -0600
committerDave Parks <davep@lindenlab.com>2023-02-03 17:18:39 -0600
commit830cb6b66551025285120fb628f0b5ebf3841756 (patch)
tree668e10bab4f075bca49f006017e7dfccfd8096ce /indra/newview/app_settings
parent4259ea79535e88ef6d8ec8415c53c28d0c2d89ac (diff)
SL-19148 Decruft some forward shaders and drawpools. Fix HUDs being in wrong color space.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl78
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyF.glsl33
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyV.glsl78
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl33
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleV.glsl34
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/transportF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/transportF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl55
25 files changed, 64 insertions, 388 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 4a12d239ed..bbf04a6889 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10073,17 +10073,6 @@
<key>Value</key>
<real>1.3</real>
</map>
- <key>RenderGround</key>
- <map>
- <key>Comment</key>
- <string>Determines whether we can render the ground pool or not</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
<key>DisableAllRenderTypes</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 73e5b401c0..afe504743d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -27,19 +27,15 @@
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
#if !defined(HAS_DIFFUSE_LOOKUP)
uniform sampler2D diffuseMap;
#endif
-VARYING vec3 vary_position;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_position;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
#ifdef WATER_FOG
vec4 applyWaterFogView(vec3 pos, vec4 color);
@@ -68,7 +64,7 @@ void main()
#ifdef HAS_DIFFUSE_LOOKUP
vec4 color = diffuseLookup(vary_texcoord0.xy);
#else
- vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 color = texture(diffuseMap, vary_texcoord0.xy);
#endif
float final_alpha = color.a * vertex_color.a;
@@ -91,7 +87,10 @@ void main()
color.a = final_alpha;
#endif
- frag_color.rgb = srgb_to_linear(color.rgb);
+#ifndef IS_HUD
+ color.rgb = srgb_to_linear(color.rgb);
+#endif
+ frag_color.rgb = color.rgb;
frag_color.a = color.a;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
index f693323d45..850f7ebb38 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
@@ -22,85 +22,13 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-
-#ifndef HAS_DIFFUSE_LOOKUP
-uniform sampler2D diffuseMap;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-VARYING vec3 vary_position;
-
-uniform samplerCube environmentMap;
+//debug stub
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass()
-uniform int no_atmo;
-
-vec3 fullbrightShinyAtmosTransport(vec3 light);
-vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
-vec3 fullbrightScaleSoftClip(vec3 light);
-
-void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao);
-
-vec3 linear_to_srgb(vec3 c);
-vec3 srgb_to_linear(vec3 c);
+out vec4 frag_color;
-// See:
-// class1\deferred\fullbrightShinyF.glsl
-// class1\lighting\lightFullbrightShinyF.glsl
void main()
{
-#ifdef HAS_DIFFUSE_LOOKUP
- vec4 color = diffuseLookup(vary_texcoord0.xy);
-#else
- vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
-#endif
-
- color.rgb *= vertex_color.rgb;
-
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
- vec3 sunlit;
- vec3 amblit;
- vec3 additive;
- vec3 atten;
- vec3 pos = vary_position.xyz;
-
- calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
-
- vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
- float env_intensity = vertex_color.a;
-
- //color.rgb = srgb_to_linear(color.rgb);
- color.rgb = mix(color.rgb, envColor.rgb, env_intensity);
- color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
- }
-
-/*
- // NOTE: HUD objects will be full bright. Uncomment if you want "some" environment lighting effecting these HUD objects.
- else
- {
- vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
- float env_intensity = vertex_color.a;
- color.rgb = mix(color.rgb, envColor.rgb, env_intensity);
- }
-*/
-
- color.a = 1.0;
-
- //color.rgb = linear_to_srgb(color.rgb);
-
- frag_color = color;
+ frag_color = vec4(0.25, 0.5, 0, 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
index 0bb48061e0..b2c83a0f44 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -31,9 +31,6 @@ out vec4 frag_color;
uniform float minimum_alpha;
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO;
-uniform int no_atmo;
-
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
@@ -51,12 +48,8 @@ void default_lighting()
color *= vertex_color;
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
- color.rgb = atmosLighting(color.rgb);
- color.rgb = scaleSoftClip(color.rgb);
- }
+ color.rgb = atmosLighting(color.rgb);
+ color.rgb = scaleSoftClip(color.rgb);
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
index ad2170bbd3..00749213db 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
@@ -32,9 +32,6 @@ out vec4 frag_color;
uniform float minimum_alpha;
uniform float texture_gamma; // either 1.0 or 2.2; see: "::TEXTURE_GAMMA"
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass()
-uniform int no_atmo;
-
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -54,16 +51,8 @@ void fullbright_lighting()
color.rgb = pow(color.rgb, vec3(texture_gamma));
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
- color.rgb = fullbrightAtmosTransport(color.rgb);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
- }
-
- //*TODO: Are we missing an inverse pow() here?
- // class1\lighting\lightFullbrightF.glsl has:
- // color.rgb = pow(color.rgb, vec3(1.0/texture_gamma));
+ color.rgb = fullbrightAtmosTransport(color.rgb);
+ color.rgb = fullbrightScaleSoftClip(color.rgb);
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index 89be8195f0..b9dc332043 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -34,9 +34,6 @@ VARYING vec2 vary_texcoord0;
uniform float texture_gamma;
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO;
-uniform int no_atmo;
-
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -46,12 +43,8 @@ void fullbright_lighting()
color.rgb = pow(color.rgb, vec3(texture_gamma));
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
- color.rgb = fullbrightAtmosTransport(color.rgb);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
- }
+ color.rgb = fullbrightAtmosTransport(color.rgb);
+ color.rgb = fullbrightScaleSoftClip(color.rgb);
color.rgb = pow(color.rgb, vec3(1.0/texture_gamma));
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index 5e966293c6..092a7088da 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -35,9 +35,6 @@ VARYING vec3 vary_texcoord1;
uniform samplerCube environmentMap;
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass()
-uniform int no_atmo;
-
vec3 fullbrightShinyAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -49,23 +46,11 @@ void fullbright_shiny_lighting()
vec4 color = diffuseLookup(vary_texcoord0.xy);
color.rgb *= vertex_color.rgb;
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low
color.rgb = fullbrightShinyAtmosTransport(color.rgb);
color.rgb = fullbrightScaleSoftClip(color.rgb);
- }
-/*
- // NOTE: HUD objects will be full bright. Uncomment if you want "some" environment lighting effecting these HUD objects.
- else
- {
- vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
- color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low
- }
-*/
color.a = 1.0;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index f621a00785..cbbb206bc1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -23,15 +23,10 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
+in vec3 vary_texcoord1;
uniform samplerCube environmentMap;
@@ -39,7 +34,7 @@ vec3 scaleSoftClip(vec3 light);
vec3 atmosLighting(vec3 light);
vec4 applyWaterFog(vec4 color);
-void shiny_lighting()
+vec4 shiny_lighting()
{
vec4 color = diffuseLookup(vary_texcoord0.xy);
color.rgb *= vertex_color.rgb;
@@ -51,6 +46,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = 1.0;
- frag_color = color;
+ return color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
index 2b6f414005..f2a4665514 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl
@@ -23,15 +23,10 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
+in vec3 vary_texcoord1;
uniform samplerCube environmentMap;
uniform sampler2D diffuseMap;
@@ -52,6 +47,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = 1.0;
- frag_color = color;
+ return color;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
deleted file mode 100644
index f8f88e2577..0000000000
--- a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * @file shinyF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-
-void shiny_lighting();
-
-void main()
-{
- shiny_lighting();
-}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
deleted file mode 100644
index 3ad7bcaa50..0000000000
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file shinyV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-uniform mat3 normal_matrix;
-uniform mat4 texture_matrix0;
-uniform mat4 texture_matrix1;
-uniform mat4 modelview_matrix;
-uniform mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-void passTextureIndex();
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-
-vec4 calcLighting(vec3 pos, vec3 norm, vec4 color);
-
-void calcAtmospherics(vec3 inPositionEye);
-
-uniform vec4 origin;
-
-#ifdef HAS_SKIN
-mat4 getObjectSkinnedTransform();
-uniform mat4 projection_matrix;
-#endif
-
-void main()
-{
- //transform vertex
- vec4 vert = vec4(position.xyz,1.0);
- passTextureIndex();
-
-#ifdef HAS_SKIN
- mat4 mat = getObjectSkinnedTransform();
- mat = modelview_matrix * mat;
- vec4 pos = mat * vert;
- gl_Position = projection_matrix * pos;
- vec3 norm = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz);
-#else
- vec4 pos = (modelview_matrix * vert);
- gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- vec3 norm = normalize(normal_matrix * normal);
-#endif
- vec3 ref = reflect(pos.xyz, -norm);
-
- vary_texcoord0 = (texture_matrix0*vec4(texcoord0,0,1)).xy;
- vary_texcoord1 = (texture_matrix1 * vec4(ref,1.0)).xyz;
-
- calcAtmospherics(pos.xyz);
-
- vertex_color = calcLighting(pos.xyz, norm, diffuse_color);
-}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl
deleted file mode 100644
index 1e72e23eef..0000000000
--- a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * @file shinyWaterF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-
-void shiny_lighting_water();
-
-void main()
-{
- shiny_lighting_water();
-}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index 2025174f7d..ad8179af29 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -28,9 +28,6 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass()
-uniform int no_atmo;
-
ATTRIBUTE vec3 position;
void passTextureIndex();
ATTRIBUTE vec2 texcoord0;
@@ -58,30 +55,21 @@ void main()
passTextureIndex();
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
- // SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 1)
- {
- vertex_color = diffuse_color;
- gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- }
- else
- {
+
#ifdef HAS_SKIN
- mat4 mat = getObjectSkinnedTransform();
- mat = modelview_matrix * mat;
+ mat4 mat = getObjectSkinnedTransform();
+ mat = modelview_matrix * mat;
- vec4 pos = mat * vert;
- vec3 norm = normalize((mat*vec4(normal.xyz+vert.xyz,1.0)).xyz-pos.xyz);
+ vec4 pos = mat * vert;
+ vec3 norm = normalize((mat*vec4(normal.xyz+vert.xyz,1.0)).xyz-pos.xyz);
- gl_Position = projection_matrix * pos;
+ gl_Position = projection_matrix * pos;
#else
- vec4 pos = (modelview_matrix * vert);
- vec3 norm = normalize(normal_matrix * normal);
- gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
+ vec4 pos = (modelview_matrix * vert);
+ vec3 norm = normalize(normal_matrix * normal);
+ gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
#endif
- calcAtmospherics(pos.xyz);
-
- vertex_color = calcLighting(pos.xyz, norm, diffuse_color);
- }
+ calcAtmospherics(pos.xyz);
+ vertex_color = calcLighting(pos.xyz, norm, diffuse_color);
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
index 206a51db27..fd69165945 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl
@@ -25,11 +25,9 @@
uniform vec4 sunlight_color;
uniform vec4 light_ambient;
-uniform int no_atmo;
vec3 atmosAmbient()
{
- if (no_atmo == 1) return vec3(0.16);
return light_ambient.rgb;
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
index c266f9732f..4179eaa9eb 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl
@@ -25,11 +25,9 @@
uniform vec4 sunlight_color;
uniform vec4 light_ambient;
-uniform int no_atmo;
vec3 atmosAmbient()
{
- if (no_atmo == 1) return vec3(0.66);
return light_ambient.rgb;
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
index fc51e81177..b1db147572 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-uniform int no_atmo;
-
vec3 scaleSoftClipFrag(vec3 light)
{
// For compatibility with lower cards. Do nothing.
diff --git a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl
index a937d9fa99..fb864d1951 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-uniform int no_atmo;
-
vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
{
/* stub function for fallback compatibility on class1 hardware */
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 7435f1c0e1..e2694e060e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -300,6 +300,9 @@ void main()
#endif // #else // FOR_IMPOSTOR
+#ifdef IS_HUD
+ color.rgb = linear_to_srgb(color.rgb);
+#endif
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 1463d507bc..6668a00841 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -27,17 +27,11 @@ vec3 getAdditiveColor();
vec3 getAtmosAttenuation();
vec3 scaleSoftClipFrag(vec3 light);
-uniform int no_atmo;
-
vec3 srgb_to_linear(vec3 col);
vec3 linear_to_srgb(vec3 col);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
{
- if (no_atmo == 1)
- {
- return light;
- }
light *= atten.r;
light += additive;
return light * 2.0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
index ba02070e45..f9f625ecdb 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
@@ -45,7 +45,6 @@ uniform float max_y;
uniform vec3 glow;
uniform float scene_light_strength;
uniform mat3 ssao_effect_mat;
-uniform int no_atmo;
uniform float sun_moon_glow_factor;
float getAmbientClamp() { return 1.0f; }
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
index 5788871744..800d08047a 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl
@@ -26,11 +26,9 @@
// Output variables
uniform float scene_light_strength;
-uniform int no_atmo;
vec3 atmosFragAmbient(vec3 light, vec3 amblit)
{
- if (no_atmo == 1) return light;
return amblit + light / 2.0;
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
index 9c42b84eca..257a76c663 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl
@@ -33,11 +33,9 @@ vec3 getAtmosAttenuation();
vec3 getPositionEye();
uniform float scene_light_strength;
-uniform int no_atmo;
vec3 atmosAmbient()
{
- if (no_atmo == 1) return vec3(0.16);
return getAmblitColor();
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
index a32a572461..9a9b179e6a 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
@@ -23,7 +23,6 @@
* $/LicenseInfo$
*/
uniform float gamma;
-uniform int no_atmo;
vec3 getAtmosAttenuation();
vec3 getAdditiveColor();
@@ -33,10 +32,6 @@ vec3 linear_to_srgb(vec3 col);
vec3 scaleSoftClipFragLinear(vec3 light)
{ // identical to non-linear version and that's probably close enough
- if (no_atmo == 1)
- {
- return light;
- }
//soft clip effect:
light = 1. - clamp(light, vec3(0.), vec3(1.));
light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side
@@ -45,10 +40,6 @@ vec3 scaleSoftClipFragLinear(vec3 light)
vec3 scaleSoftClipFrag(vec3 light)
{
- if (no_atmo == 1)
- {
- return light;
- }
//soft clip effect:
light = 1. - clamp(light, vec3(0.), vec3(1.));
light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side
diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
index ecf0430a88..c509d865ba 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
@@ -30,8 +30,6 @@
vec3 getAdditiveColor();
vec3 getAtmosAttenuation();
-uniform int no_atmo;
-
vec3 srgb_to_linear(vec3 col);
vec3 linear_to_srgb(vec3 col);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
index 160d360256..b90de7609b 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
@@ -43,9 +43,6 @@ VARYING vec3 vary_position;
uniform samplerCube environmentMap;
-// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass()
-uniform int no_atmo;
-
vec3 fullbrightShinyAtmosTransport(vec3 light);
vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -59,12 +56,8 @@ vec3 srgb_to_linear(vec3 c);
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity);
-void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
-// See:
-// class1\deferred\fullbrightShinyF.glsl
-// class1\lighting\lightFullbrightShinyF.glsl
void main()
{
#ifdef HAS_DIFFUSE_LOOKUP
@@ -76,32 +69,32 @@ void main()
color.rgb *= vertex_color.rgb;
// SL-9632 HUDs are affected by Atmosphere
- if (no_atmo == 0)
- {
- vec3 sunlit;
- vec3 amblit;
- vec3 additive;
- vec3 atten;
- vec3 pos = vary_position;
- calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
-
- float env_intensity = vertex_color.a;
-
- vec3 ambenv;
- vec3 glossenv;
- vec3 legacyenv;
- vec3 norm = normalize(vary_texcoord1.xyz);
- vec4 spec = vec4(0,0,0,0);
- sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity);
- applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity);
-
- color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
- }
+#ifndef IS_HUD
+
+ vec3 sunlit;
+ vec3 amblit;
+ vec3 additive;
+ vec3 atten;
+ vec3 pos = vary_position;
+ calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
+
+ float env_intensity = vertex_color.a;
+
+ vec3 ambenv;
+ vec3 glossenv;
+ vec3 legacyenv;
+ vec3 norm = normalize(vary_texcoord1.xyz);
+ vec4 spec = vec4(0,0,0,0);
+ sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity);
+ applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity);
+
+ color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
+ color.rgb = fullbrightScaleSoftClip(color.rgb);
+ color.rgb = srgb_to_linear(color.rgb);
+#endif
color.a = 1.0;
-
- color.rgb = srgb_to_linear(color.rgb);
+
frag_color = color;
}