diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-07 11:40:56 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-07 11:40:56 -0600 |
commit | b52699091da791a1349daf66d405f27ca2568ea9 (patch) | |
tree | c8c140c4691f3f4d53274bbaf7d8a734dec2d330 /indra/newview/app_settings/shaders/class1/environment | |
parent | c8fb3ad4de0575a0538b9532e819319f655613d1 (diff) |
SL-19147 Water quality pass. Remove gl_FragDepth writes from sky rendering (optimization). Incidental decruft.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/environment')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/waterF.glsl | 34 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl | 17 |
2 files changed, 45 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl new file mode 100644 index 0000000000..075397d96c --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -0,0 +1,34 @@ +/** + * @file waterF.glsl + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, 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$ + */ + + // error fallback on compilation failure + +out vec4 frag_color; + +void main() +{ + frag_color = vec4(1,0,1,1); +} + diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl index e1cdeddcea..5765e04014 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl @@ -72,13 +72,8 @@ vec4 applyWaterFogView(vec3 pos, vec4 color) return color; } -vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit) +vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit) { - if (dot(pos, waterPlane.xyz) + waterPlane.w > 0.0) - { - return color; - } - vec3 view = normalize(pos); //normalize view vector float es = -(dot(view, waterPlane.xyz)); @@ -118,6 +113,16 @@ vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit) return color; } +vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit) +{ + if (dot(pos, waterPlane.xyz) + waterPlane.w > 0.0) + { + return color; + } + + return applyWaterFogViewLinearNoClip(pos, color, sunlit); +} + vec4 applyWaterFogViewLinear(vec3 pos, vec4 color) { return applyWaterFogViewLinear(pos, color, vec3(1)); |