summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-15 09:31:43 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-15 09:31:43 -0700
commit07aed1e18646fa788ad79320aaa3e2ff3c7a3f60 (patch)
treeefa26f27eac0b6d1a83a9e25a5396efa7cb0e637 /indra/newview/app_settings/shaders
parent5dedf6d75389772b88c140695ac421699b24fd81 (diff)
parent3305fbe1cf5fe3faa6dc5479aa29e6c891ee943f (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583-glossy-ssr
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaBlendF.glsl56
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl3
3 files changed, 58 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaBlendF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaBlendF.glsl
new file mode 100644
index 0000000000..79425ad716
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaBlendF.glsl
@@ -0,0 +1,56 @@
+/**
+ * @file pbrShadowAlphaBlendF.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$
+ */
+
+out vec4 frag_color;
+
+uniform sampler2D diffuseMap;
+
+in vec4 post_pos;
+in float target_pos_x;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
+uniform float minimum_alpha;
+
+void main()
+{
+ float alpha = texture(diffuseMap,vary_texcoord0.xy).a;
+
+ alpha *= vertex_color.a;
+
+ if (alpha < 0.05) // treat as totally transparent
+ {
+ discard;
+ }
+
+ if (alpha < 0.88) // treat as semi-transparent
+ {
+ if (fract(0.5*floor(target_pos_x / post_pos.w )) < 0.25)
+ {
+ discard;
+ }
+ }
+
+ frag_color = vec4(1,1,1,1);
+}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
index e06f3a5f44..1d1545be7e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
@@ -35,7 +35,7 @@ uniform float minimum_alpha;
void main()
{
- float alpha = diffuseLookup(vary_texcoord0.xy).a;
+ float alpha = texture(diffuseMap,vary_texcoord0.xy).a;
if (alpha < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 815069bb6a..ac2e359769 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -429,13 +429,12 @@ void main()
LIGHT_LOOP(6)
LIGHT_LOOP(7)
- light *= 1.0-emissive;
color += light;
glare *= 1.0-emissive;
glare = min(glare, 1.0);
float al = max(diffcol.a, glare) * vertex_color.a;
-
+
frag_color = max(vec4(color, al), vec4(0));
#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer