summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/interface
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/interface')
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/clipF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/clipV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/copyF.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl)23
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/copyV.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl)23
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl41
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/debugF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/debugV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl65
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl69
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl59
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl)39
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl)20
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl167
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl)26
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl (renamed from indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl)21
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/uiF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/uiV.glsl10
43 files changed, 335 insertions, 474 deletions
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index f520f301d9..a46e91c394 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -23,26 +23,22 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
uniform float minimum_alpha;
-VARYING vec2 vary_texcoord0;
-VARYING vec4 vertex_color;
+in vec2 vary_texcoord0;
+in vec4 vertex_color;
void main()
{
- vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = vertex_color*texture(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha)
{
discard;
}
- frag_color = col;
+ frag_color = max(col, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl
index 3580d1f27b..a8dac55130 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl
@@ -26,12 +26,12 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl
index 1936e0dcaa..06b19c22c9 100644
--- a/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl
@@ -23,17 +23,13 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
-VARYING vec2 tc0;
+in vec2 tc0;
void main()
{
- frag_color = texture2D(diffuseMap, tc0);
+ frag_color = texture(diffuseMap, tc0);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl
index 7beb20ede4..cbcc6bef97 100644
--- a/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 tc0;
+out vec2 tc0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl
index ac2bc8703b..ee2d652f32 100644
--- a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl
@@ -23,16 +23,12 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform vec4 color;
uniform vec4 clip_plane;
-VARYING vec3 vary_position;
+in vec3 vary_position;
void main()
@@ -42,5 +38,5 @@ void main()
discard;
}
- frag_color = color;
+ frag_color = max(color, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/clipV.glsl b/indra/newview/app_settings/shaders/class1/interface/clipV.glsl
index e376b25a71..7dd2ef593f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/clipV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/clipV.glsl
@@ -26,9 +26,9 @@
uniform mat4 modelview_projection_matrix;
uniform mat4 modelview_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec3 vary_position;
+out vec3 vary_position;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl
index 415181126b..65d3c20091 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl
@@ -1,9 +1,9 @@
/**
- * @file onetexturenocolorF.glsl
+ * @file copyF.glsl
*
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2005, Linden Research, Inc.
+ * 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
@@ -23,17 +23,18 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
+in vec2 tc;
-uniform sampler2D tex0;
+uniform sampler2D depthMap;
+uniform sampler2D diffuseMap;
-VARYING vec2 vary_texcoord0;
+out vec4 frag_color;
void main()
{
- frag_color = texture2D(tex0, vary_texcoord0.xy);
+ frag_color = texture(diffuseMap, tc);
+#if defined(COPY_DEPTH)
+ gl_FragDepth = texture(depthMap, tc).r;
+#endif
}
+
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/copyV.glsl
index 3c2f297f7f..ace5da6578 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/copyV.glsl
@@ -1,9 +1,9 @@
/**
- * @file twotextureaddV.glsl
+ * @file copyV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
+ * 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
@@ -22,20 +22,13 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+in vec3 position;
+out vec2 tc;
-void main()
+void main()
{
- gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_texcoord0 = texcoord0;
- vary_texcoord1 = texcoord1;
+ tc = position.xy * 0.5 + 0.5;
+ gl_Position = vec4(position, 1.0);
}
-
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
deleted file mode 100644
index 890474d6d8..0000000000
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * @file customalphaV.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 mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void main()
-{
- gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_texcoord0 = texcoord0;
- vertex_color = diffuse_color;
-}
-
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index 67c6baddbb..cefa429639 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -23,15 +23,11 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform vec4 color;
void main()
{
- frag_color = color;
+ frag_color = max(color, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
index 153998f1d5..2e32863109 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
@@ -25,7 +25,7 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl
deleted file mode 100644
index f8efd7cb4a..0000000000
--- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file debugF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, 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$
- */
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-
-uniform sampler2D depthMap;
-
-VARYING vec2 tc0;
-VARYING vec2 tc1;
-VARYING vec2 tc2;
-VARYING vec2 tc3;
-VARYING vec2 tc4;
-VARYING vec2 tc5;
-VARYING vec2 tc6;
-VARYING vec2 tc7;
-VARYING vec2 tc8;
-
-void main()
-{
- vec4 depth1 =
- vec4(texture2D(depthMap, tc0).r,
- texture2D(depthMap, tc1).r,
- texture2D(depthMap, tc2).r,
- texture2D(depthMap, tc3).r);
-
- vec4 depth2 =
- vec4(texture2D(depthMap, tc4).r,
- texture2D(depthMap, tc5).r,
- texture2D(depthMap, tc6).r,
- texture2D(depthMap, tc7).r);
-
- depth1 = min(depth1, depth2);
- float depth = min(depth1.x, depth1.y);
- depth = min(depth, depth1.z);
- depth = min(depth, depth1.w);
- depth = min(depth, texture2D(depthMap, tc8).r);
-
- gl_FragDepth = depth;
-}
diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl
deleted file mode 100644
index cff8d9d50f..0000000000
--- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * @file debugF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, 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$
- */
-
-#extension GL_ARB_texture_rectangle : enable
-
-/*[EXTRA_CODE_HERE]*/
-
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-
-uniform sampler2DRect depthMap;
-
-VARYING vec2 tc0;
-VARYING vec2 tc1;
-VARYING vec2 tc2;
-VARYING vec2 tc3;
-VARYING vec2 tc4;
-VARYING vec2 tc5;
-VARYING vec2 tc6;
-VARYING vec2 tc7;
-VARYING vec2 tc8;
-
-void main()
-{
- vec4 depth1 =
- vec4(texture2DRect(depthMap, tc0).r,
- texture2DRect(depthMap, tc1).r,
- texture2DRect(depthMap, tc2).r,
- texture2DRect(depthMap, tc3).r);
-
- vec4 depth2 =
- vec4(texture2DRect(depthMap, tc4).r,
- texture2DRect(depthMap, tc5).r,
- texture2DRect(depthMap, tc6).r,
- texture2DRect(depthMap, tc7).r);
-
- depth1 = min(depth1, depth2);
- float depth = min(depth1.x, depth1.y);
- depth = min(depth, depth1.z);
- depth = min(depth, depth1.w);
- depth = min(depth, texture2DRect(depthMap, tc8).r);
-
- gl_FragDepth = depth;
-}
diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl
deleted file mode 100644
index 71d80911d6..0000000000
--- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file debugV.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, 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 mat4 modelview_projection_matrix;
-
-ATTRIBUTE vec3 position;
-
-uniform vec2 screen_res;
-
-uniform vec2 delta;
-
-VARYING vec2 tc0;
-VARYING vec2 tc1;
-VARYING vec2 tc2;
-VARYING vec2 tc3;
-VARYING vec2 tc4;
-VARYING vec2 tc5;
-VARYING vec2 tc6;
-VARYING vec2 tc7;
-VARYING vec2 tc8;
-
-void main()
-{
- gl_Position = vec4(position, 1.0);
-
- vec2 tc = (position.xy*0.5+0.5)*screen_res;
- tc0 = tc+vec2(-delta.x,-delta.y);
- tc1 = tc+vec2(0,-delta.y);
- tc2 = tc+vec2(delta.x,-delta.y);
- tc3 = tc+vec2(-delta.x,0);
- tc4 = tc+vec2(0,0);
- tc5 = tc+vec2(delta.x,0);
- tc6 = tc+vec2(-delta.x,delta.y);
- tc7 = tc+vec2(0,delta.y);
- tc8 = tc+vec2(delta.x,delta.y);
-}
-
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl
index f6b31a5956..eca591d387 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl
@@ -1,9 +1,9 @@
/**
- * @file customalphaF.glsl
+ * @file gaussianF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
+ * 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
@@ -23,24 +23,31 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-uniform sampler2D diffuseMap;
+uniform sampler2D diffuseRect;
-uniform float custom_alpha;
+uniform float resScale;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+// texture direction, will be <1, 0> or <0, 1>
+uniform vec2 direction;
+
+in vec2 vary_texcoord0;
+
+// get linear depth value given a depth buffer sample d and znear and zfar values
+float linearDepth(float d, float znear, float zfar);
void main()
{
- vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
- color.rgb = pow(color.rgb, vec3(0.45));
- color.rgb *= vertex_color.rgb;
- color.a *= max(custom_alpha, vertex_color.a);
- frag_color = color;
+ vec3 col = vec3(0,0,0);
+
+ float w[9] = float[9]( 0.0002, 0.0060, 0.0606, 0.2417, 0.3829, 0.2417, 0.0606, 0.0060, 0.0002 );
+
+ for (int i = 0; i < 9; ++i)
+ {
+ vec2 tc = vary_texcoord0 + (i-4)*direction*resScale;
+ col += texture(diffuseRect, tc).rgb * w[i];
+ }
+
+ frag_color = max(vec4(col, 0.0), vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index b5bbbb5c73..fa8aa5c7fe 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -23,24 +23,16 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-uniform sampler2D glowMap;
-uniform sampler2DRect screenMap;
+uniform sampler2D diffuseRect;
+uniform sampler2D emissiveRect;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+in vec2 tc;
void main()
{
- frag_color = texture2D(glowMap, vary_texcoord0.xy) +
- texture2DRect(screenMap, vary_texcoord1.xy);
+ frag_color = texture(diffuseRect, tc) + texture(emissiveRect, tc);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index a9e7ea1de8..3d4035620f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -23,24 +23,19 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-uniform sampler2DRect diffuseRect;
+uniform sampler2D diffuseRect;
uniform vec2 screen_res;
-VARYING vec2 vary_tc;
+
+in vec2 vary_tc;
void main()
{
- vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb;
-
- frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
+ vec3 col = texture(diffuseRect, vary_tc).rgb;
+
+ frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
index 058f3b1b82..fa67b13e4d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -23,15 +23,14 @@
* $/LicenseInfo$
*/
-uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_tc;
+out vec2 vary_tc;
void main()
{
- vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
+ vec4 pos = vec4(position.xyz, 1.0);
gl_Position = pos;
vary_tc = pos.xy*0.5+0.5;
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index f7970b7f78..8fa08a18c3 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -25,17 +25,13 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
+in vec3 position;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+out vec2 tc;
void main()
{
- gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_texcoord0 = texcoord0;
- vary_texcoord1 = texcoord1;
+ gl_Position = vec4(position.xyz, 1.0);
+ tc = position.xy * 0.5 + 0.5;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 6cc9bbbea2..9bba1b2e18 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -23,18 +23,14 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform vec4 color;
uniform sampler2D diffuseMap;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy);
+ frag_color = max(color*texture(diffuseMap, vary_texcoord0.xy), vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl
index 947c2b0065..0253c7236d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl
@@ -26,12 +26,12 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
-ATTRIBUTE vec2 texcoord2;
+in vec3 position;
+in vec2 texcoord0;
+in vec2 texcoord1;
+in vec2 texcoord2;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl
index c5d102b739..9f7ff8337a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl
@@ -26,12 +26,12 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
-ATTRIBUTE vec2 texcoord2;
+in vec3 position;
+in vec2 texcoord0;
+in vec2 texcoord1;
+in vec2 texcoord2;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index 0b362cf46c..481b7a3b1d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -26,10 +26,10 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl
index 6b9986c8d7..633c928e6b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl
@@ -1,9 +1,9 @@
/**
- * @file onetexturenocolorV.glsl
+ * @file irradianceGenV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
+ * Copyright (C) 2011, 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
@@ -22,17 +22,17 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+uniform mat4 modelview_matrix;
-VARYING vec2 vary_texcoord0;
+in vec3 position;
+
+out vec3 vary_dir;
void main()
{
- gl_Position = modelview_projection_matrix * vec4(position, 1);
- vary_texcoord0 = texcoord0;
+ gl_Position = vec4(position, 1.0);
+
+ vary_dir = vec3(modelview_matrix * vec4(position, 1.0)).xyz;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl
index 5c479d27a9..75ff19e470 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl
@@ -25,7 +25,7 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
uniform vec3 box_center;
uniform vec3 box_size;
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
index db130e456c..f5d2804c7f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl
@@ -23,13 +23,13 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
+out vec4 frag_data[4];
void main()
{
- frag_color = vec4(1,1,1,1);
+ // emissive red PBR material for debugging
+ frag_data[0] = vec4(0, 0, 0, 0);
+ frag_data[1] = vec4(0, 0, 0, 0);
+ frag_data[2] = vec4(1, 0, 0, GBUFFER_FLAG_HAS_PBR);
+ frag_data[3] = vec4(1, 0, 0, 0);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl
index 7305065a05..1ff9c347b6 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl
@@ -26,7 +26,7 @@
uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index c26fa08ddc..b44c746fa7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
@@ -25,7 +25,7 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl
index f1400c9b44..a85d055a5b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl
@@ -23,20 +23,16 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D tex0;
uniform float tolerance;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- frag_color = texture2D(tex0, vary_texcoord0.xy);
+ frag_color = texture(tex0, vary_texcoord0.xy);
if(frag_color[0] + frag_color[1] + frag_color[2] < tolerance)
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl
index a33ef7e92c..1b8411603a 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl
@@ -25,10 +25,10 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl
index 7379360e17..fac22be6de 100644
--- a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl
@@ -23,13 +23,9 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-VARYING vec4 vertex_color;
+in vec4 vertex_color;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl
index 19fa607307..4f08df839d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl
@@ -25,10 +25,10 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
+in vec3 position;
+in vec4 diffuse_color;
-VARYING vec4 vertex_color;
+out vec4 vertex_color;
uniform float tint;
uniform float alpha_scale;
diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
index 91f252cf1e..9e77927cb8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl
@@ -25,11 +25,11 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
-VARYING vec4 vertex_color;
+out vec4 vertex_color;
uniform float tint;
uniform float ambiance;
diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
new file mode 100644
index 0000000000..9ecdf0bf77
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
@@ -0,0 +1,167 @@
+/**
+ * @file radianceGenF.glsl
+ *
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2022, 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$
+ */
+
+
+/*[EXTRA_CODE_HERE]*/
+
+out vec4 frag_color;
+
+uniform samplerCubeArray reflectionProbes;
+uniform int sourceIdx;
+
+in vec3 vary_dir;
+
+//uniform float roughness;
+
+uniform float mipLevel;
+uniform int u_width;
+uniform float max_probe_lod;
+
+
+// =============================================================================================================
+// Parts of this file are (c) 2018 Sascha Willems
+// SNIPPED FROM https://github.com/SaschaWillems/Vulkan-glTF-PBR/blob/master/data/shaders/prefilterenvmap.frag
+/*
+MIT License
+
+Copyright (c) 2018 Sascha Willems
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+// =============================================================================================================
+
+const float PI = 3.1415926536;
+
+// Based omn http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
+float random(vec2 co)
+{
+ float a = 12.9898;
+ float b = 78.233;
+ float c = 43758.5453;
+ float dt= dot(co.xy ,vec2(a,b));
+ float sn= mod(dt,3.14);
+ return fract(sin(sn) * c);
+}
+
+vec2 hammersley2d(uint i, uint N)
+{
+ // Radical inverse based on http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
+ uint bits = (i << 16u) | (i >> 16u);
+ bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
+ bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
+ bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
+ bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
+ float rdi = float(bits) * 2.3283064365386963e-10;
+ return vec2(float(i) /float(N), rdi);
+}
+
+// Based on http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_slides.pdf
+vec3 importanceSample_GGX(vec2 Xi, float roughness, vec3 normal)
+{
+ // Maps a 2D point to a hemisphere with spread based on roughness
+ float alpha = roughness * roughness;
+ float phi = 2.0 * PI * Xi.x + random(normal.xz) * 0.1;
+ float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (alpha*alpha - 1.0) * Xi.y));
+ float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
+ vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
+
+ // Tangent space
+ vec3 up = abs(normal.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
+ vec3 tangentX = normalize(cross(up, normal));
+ vec3 tangentY = normalize(cross(normal, tangentX));
+
+ // Convert to world Space
+ return normalize(tangentX * H.x + tangentY * H.y + normal * H.z);
+}
+
+// Normal Distribution function
+float D_GGX(float dotNH, float roughness)
+{
+ float alpha = roughness * roughness;
+ float alpha2 = alpha * alpha;
+ float denom = dotNH * dotNH * (alpha2 - 1.0) + 1.0;
+ return (alpha2)/(PI * denom*denom);
+}
+
+vec4 prefilterEnvMap(vec3 R)
+{
+ vec3 N = R;
+ vec3 V = R;
+ vec4 color = vec4(0.0);
+ float totalWeight = 0.0;
+ float envMapDim = float(textureSize(reflectionProbes, 0).s);
+ float roughness = mipLevel/max_probe_lod;
+ int numSamples = max(int(32*roughness), 1);
+
+ float numMips = max_probe_lod+1;
+
+ for(uint i = 0u; i < numSamples; i++) {
+ vec2 Xi = hammersley2d(i, numSamples);
+ vec3 H = importanceSample_GGX(Xi, roughness, N);
+ vec3 L = 2.0 * dot(V, H) * H - V;
+ float dotNL = clamp(dot(N, L), 0.0, 1.0);
+ if(dotNL > 0.0) {
+ // Filtering based on https://placeholderart.wordpress.com/2015/07/28/implementation-notes-runtime-environment-map-filtering-for-image-based-lighting/
+
+ float dotNH = clamp(dot(N, H), 0.0, 1.0);
+ float dotVH = clamp(dot(V, H), 0.0, 1.0);
+
+ // Probability Distribution Function
+ float pdf = D_GGX(dotNH, roughness) * dotNH / (4.0 * dotVH) + 0.0001;
+ // Slid angle of current smple
+ float omegaS = 1.0 / (float(numSamples) * pdf);
+ // Solid angle of 1 pixel across all cube faces
+ float omegaP = 4.0 * PI / (6.0 * envMapDim * envMapDim);
+ // Biased (+1.0) mip level for better result
+ float mipLevel = roughness == 0.0 ? 0.0 : clamp(0.5 * log2(omegaS / omegaP) + 1.0, 0.0f, max_probe_lod);
+ color += textureLod(reflectionProbes, vec4(L, sourceIdx), mipLevel) * dotNL;
+ totalWeight += dotNL;
+ }
+ }
+ return (color / totalWeight);
+}
+
+void main()
+{
+ vec3 N = normalize(vary_dir);
+ frag_color = max(prefilterEnvMap(N), vec4(0));
+}
+// =============================================================================================================
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl
index 7614075cfd..2c31e98838 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl
@@ -1,7 +1,7 @@
/**
- * @file splattexturerectF.glsl
+ * @file radianceGenV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
@@ -22,23 +22,17 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-#extension GL_ARB_texture_rectangle : enable
-/*[EXTRA_CODE_HERE]*/
+uniform mat4 modelview_matrix;
-#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
+in vec3 position;
-uniform sampler2DRect screenMap;
+out vec3 vary_dir;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-
-void main()
+void main()
{
- frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
+ gl_Position = vec4(position, 1.0);
+
+ vary_dir = vec3(modelview_matrix * vec4(position, 1.0)).xyz;
}
+
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl
index 95679e93e7..45267e4403 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl
@@ -1,9 +1,9 @@
/**
- * @file twotextureaddF.glsl
+ * @file reflectionmipF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
+ * Copyright (C) 2022, 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
@@ -22,20 +22,15 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-#ifdef DEFINE_GL_FRAGCOLOR
+
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
-uniform sampler2D tex0;
-uniform sampler2D tex1;
+uniform sampler2D diffuseRect;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+in vec2 vary_texcoord0;
void main()
{
- frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
+ vec3 col = texture(diffuseRect, vary_texcoord0.xy).rgb;
+ frag_color = vec4(col, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index da02534dbb..a14334fd01 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -23,21 +23,17 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D tex0;
uniform vec4 color;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- float alpha = texture2D(tex0, vary_texcoord0.xy).a * color.a;
+ float alpha = texture(tex0, vary_texcoord0.xy).a * color.a;
frag_color = vec4(color.rgb, alpha);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
index f33115d78d..b280fcdc15 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -25,10 +25,10 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
index 641d670c26..7af7f20f85 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -25,17 +25,13 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec4 diffuse_color;
+in vec3 position;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_texcoord0 = texcoord0;
- vertex_color = diffuse_color;
+ vary_texcoord0 = position.xy*0.5+0.5;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
index 6eeb2596b2..6d51b898b7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
@@ -23,11 +23,7 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D tex0;
uniform sampler2D tex1;
@@ -36,12 +32,12 @@ uniform float dither_scale;
uniform float dither_scale_s;
uniform float dither_scale_t;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+in vec2 vary_texcoord0;
+in vec2 vary_texcoord1;
void main()
{
- frag_color = abs(texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy));
+ frag_color = abs(texture(tex0, vary_texcoord0.xy) - texture(tex1, vary_texcoord0.xy));
vec2 dither_coord;
dither_coord[0] = vary_texcoord0[0] * dither_scale_s;
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl
index 67c6674f0c..a103bff12d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl
@@ -25,12 +25,12 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
+in vec3 position;
+in vec2 texcoord0;
+in vec2 texcoord1;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+out vec2 vary_texcoord0;
+out vec2 vary_texcoord1;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 299bfb72aa..a29b848253 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -23,18 +23,14 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
-VARYING vec2 vary_texcoord0;
-VARYING vec4 vertex_color;
+in vec2 vary_texcoord0;
+in vec4 vertex_color;
void main()
{
- frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
+ frag_color = vertex_color*texture(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index 220dafef25..91a846b9fa 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -26,12 +26,12 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void main()
{