summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/transportF.glsl60
13 files changed, 27 insertions, 105 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index f4d6eff69e..ae8cd97b18 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -25,19 +25,13 @@
//class2/deferred/alphaF.glsl
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
#define INDEXED 1
#define NON_INDEXED 2
#define NON_INDEXED_NO_COLOR 3
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform mat3 env_mat;
uniform vec3 sun_dir;
@@ -47,13 +41,13 @@ uniform vec3 moon_dir;
uniform sampler2D diffuseMap;
#endif
-VARYING vec3 vary_fragcoord;
-VARYING vec3 vary_position;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_norm;
+in vec3 vary_fragcoord;
+in vec3 vary_position;
+in vec2 vary_texcoord0;
+in vec3 vary_norm;
#ifdef USE_VERTEX_COLOR
-VARYING vec4 vertex_color; //vertex color should be treated as sRGB
+in vec4 vertex_color; //vertex color should be treated as sRGB
#endif
#ifdef HAS_ALPHA_MASK
@@ -195,7 +189,7 @@ void main()
#endif
#ifdef USE_DIFFUSE_TEX
- vec4 diffuse_tap = texture2D(diffuseMap,vary_texcoord0.xy);
+ vec4 diffuse_tap = texture(diffuseMap,vary_texcoord0.xy);
#endif
#ifdef USE_INDEXED_TEX
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index cd7c005162..7b7b4a040c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -214,7 +214,7 @@ void main()
// emissiveColor is the emissive color factor from GLTF and is already in linear space
vec3 colorEmissive = emissiveColor;
// emissiveMap here is a vanilla RGB texture encoded as sRGB, manually convert to linear
- colorEmissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
+ colorEmissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
@@ -305,7 +305,7 @@ void main()
// emissiveColor is the emissive color factor from GLTF and is already in linear space
vec3 colorEmissive = emissiveColor;
// emissiveMap here is a vanilla RGB texture encoded as sRGB, manually convert to linear
- colorEmissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
+ colorEmissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
float a = basecolor.a*vertex_color.a;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
index 080f622155..60134a7f72 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
@@ -40,7 +40,7 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
vec3 env_vec = env_mat * refnormpersp;
- glossenv = srgb_to_linear(textureCube(environmentMap, env_vec).rgb);
+ glossenv = srgb_to_linear(texture(environmentMap, env_vec).rgb);
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
@@ -63,7 +63,7 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
vec3 env_vec = env_mat * refnormpersp;
- legacyenv = srgb_to_linear(textureCube(environmentMap, env_vec).rgb);
+ legacyenv = srgb_to_linear(texture(environmentMap, env_vec).rgb);
glossenv = legacyenv;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index 1e7ccb747a..d1db6dd943 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -23,11 +23,11 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
+out vec2 vary_fragcoord;
// forwards
void setAtmosAttenuation(vec3 c);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index e1cbfcce1a..1ea57516a4 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -23,20 +23,14 @@
* $/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
//class 2, shadows, no SSAO
// Inputs
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
uniform vec3 sun_dir;
uniform float shadow_bias;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 99a26a050d..0126e09d4c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -22,20 +22,14 @@
* $/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
//class 2 -- shadows and SSAO
// Inputs
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
vec4 getPosition(vec2 pos_screen);
vec3 getNorm(vec2 pos_screen);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 3dfca0f655..5ae7f2c571 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_fragcoord;
+out vec2 vary_fragcoord;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index 4c418e414f..3773f191e8 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
-// VARYING param funcs
+// out param funcs
uniform vec3 sun_dir;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
index 07733bda18..34669a6796 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl
@@ -24,8 +24,8 @@
*/
-VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+in vec3 vary_AdditiveColor;
+in vec3 vary_AtmosAttenuation;
vec3 getSunlitColor()
{
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 31109aed31..1b854d80b3 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -24,8 +24,8 @@
*/
-VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+out vec3 vary_AdditiveColor;
+out vec3 vary_AtmosAttenuation;
vec3 additive_color;
vec3 atmos_attenuation;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
index 22e16b7e0f..7a6741fe0e 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-VARYING vec3 vary_PositionEye;
-VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+in vec3 vary_PositionEye;
+in vec3 vary_AdditiveColor;
+in vec3 vary_AtmosAttenuation;
vec3 getSunlitColor()
{
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
index 0f2a3ee527..23c3aed4d8 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-VARYING vec3 vary_PositionEye;
-VARYING vec3 vary_AdditiveColor;
-VARYING vec3 vary_AtmosAttenuation;
+out vec3 vary_PositionEye;
+out vec3 vary_AdditiveColor;
+out vec3 vary_AtmosAttenuation;
vec3 atmos_attenuation;
vec3 sunlit_color;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
deleted file mode 100644
index 8221ba9516..0000000000
--- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * @file class2\wl\transportF.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$
- */
-
-//////////////////////////////////////////////////////////
-// The fragment shader for the terrain atmospherics
-//////////////////////////////////////////////////////////
-
-vec3 getAdditiveColor();
-vec3 getAtmosAttenuation();
-
-vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
-
-// the below implementations are deprecated but remain here as adapters for shaders that haven't been refactored yet
-
-vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
-{
- return atmosFragLighting(light, additive, atten);
-}
-
-vec3 atmosTransport(vec3 light)
-{
- return atmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation());
-}
-
-vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten)
-{
- return atmosTransportFrag(light, additive, atten);
-}
-
-vec3 fullbrightAtmosTransport(vec3 light)
-{
- return atmosTransport(light);
-}
-
-vec3 fullbrightShinyAtmosTransport(vec3 light)
-{
- return atmosTransport(light);
-}