summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-05-22 10:42:18 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-05-22 10:42:18 -0700
commitb273edd1253e088ea864d399342a0cba2fd0aaa9 (patch)
tree317ff7c05eacccb80b3fe06d65d8f64d7ff6019d /indra/newview/app_settings
parentda72081582c3fd376e228cf0fceaef2ecb1948a9 (diff)
parentc6fc951f34c665d0f1cd6dcff1bea114fb0ff1a0 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/settings.xml66
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cofF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialV.glsl26
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowF.glsl28
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/srgbF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl10
-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.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/clipV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/debugF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/debugV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl4
-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.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl2
-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.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl4
-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/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
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/bumpF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/bumpV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/previewF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/previewV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl10
-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
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl26
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl34
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/waterF.glsl22
151 files changed, 580 insertions, 878 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 234a48639b..5dff358a63 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8352,6 +8352,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>NvAPICreateApplicationProfile</key>
+ <map>
+ <key>Comment</key>
+ <string>Create NVIDIA application profile for optimized settings</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>PurgeCacheOnNextStartup</key>
<map>
<key>Comment</key>
@@ -10788,17 +10799,6 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>RenderAutoMuteByteLimit</key>
- <map>
- <key>Comment</key>
- <string>If avatar attachment size exceed this value (in bytes) attachment will not be rendered. Excludes attachments worn by own avatar.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>U32</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>RenderAvatarMaxNonImpostors</key>
<map>
<key>Comment</key>
@@ -11069,6 +11069,28 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>RenderShaderCacheEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable binary shader cache</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>RenderShaderCacheVersion</key>
+ <map>
+ <key>Comment</key>
+ <string>Current version hash for shader cache</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>00000000-0000-0000-0000-000000000000</string>
+ </map>
<key>ReplaySession</key>
<map>
<key>Comment</key>
@@ -14401,17 +14423,6 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>RenderDelayVBUpdate</key>
- <map>
- <key>Comment</key>
- <string>Delay vertex buffer updates until just before rendering</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>SocialPhotoResolution</key>
<map>
<key>Comment</key>
@@ -17129,17 +17140,6 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>ResetUIScaleOnFirstRun</key>
- <map>
- <key>Comment</key>
- <string>Resets the UI scale factor on first run due to changed display scaling behavior</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
<key>360CaptureUseInterestListCap</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index 767fad016c..374469ce2f 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -24,7 +24,7 @@
*/
-ATTRIBUTE vec4 weight;
+in vec4 weight;
uniform vec4 matrixPalette[45];
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index 0543a26642..9adc68e62b 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -25,12 +25,12 @@
uniform mat4 projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
uniform vec4 color;
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index fac1599c6b..837074f08c 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -28,13 +28,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor);
void calcAtmospherics(vec3 inPositionEye);
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 90bf2851c9..0817076dd5 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -22,7 +22,7 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec4 weight4;
+in vec4 weight4;
uniform mat3x4 matrixPalette[MAX_JOINTS_PER_MESH_OBJECT];
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 6a93bc2fd2..4c9d813c9c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -33,19 +33,19 @@ uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
#ifdef USE_INDEXED_TEX
void passTextureIndex();
#endif
-ATTRIBUTE vec3 normal;
+in vec3 normal;
#ifdef USE_VERTEX_COLOR
-ATTRIBUTE vec4 diffuse_color;
+in vec4 diffuse_color;
#endif
-ATTRIBUTE vec2 texcoord0;
+in vec2 texcoord0;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
@@ -55,15 +55,15 @@ mat4 getSkinnedTransform();
#endif
#endif
-VARYING vec3 vary_fragcoord;
-VARYING vec3 vary_position;
+out vec3 vary_fragcoord;
+out vec3 vary_position;
#ifdef USE_VERTEX_COLOR
-VARYING vec4 vertex_color;
+out vec4 vertex_color;
#endif
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_norm;
+out vec2 vary_texcoord0;
+out vec3 vary_norm;
uniform float near_clip;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl
index 37fe8287be..da467cd5da 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl
@@ -43,7 +43,7 @@ vec2 getScreenCoordinateAo(vec2 screenpos)
float getDepthAo(vec2 pos_screen)
{
- float depth = texture2D(depthMap, pos_screen).r;
+ float depth = texture(depthMap, pos_screen).r;
return depth;
}
@@ -79,7 +79,7 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm, vec2 pos_screen)
{
float ret = 1.0;
vec3 pos_world = pos.xyz;
- vec2 noise_reflect = texture2D(noiseMap, pos_screen.xy * (screen_res / 128)).xy;
+ vec2 noise_reflect = texture(noiseMap, pos_screen.xy * (screen_res / 128)).xy;
float angle_hidden = 0.0;
float points = 0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl
index 44f67899e4..f1dc1159d0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl
@@ -23,22 +23,18 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-VARYING float target_pos_x;
-VARYING float pos_w;
-VARYING vec2 vary_texcoord0;
+in float target_pos_x;
+in float pos_w;
+in vec2 vary_texcoord0;
void main()
{
- float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a;
+ float alpha = texture(diffuseMap, vary_texcoord0.xy).a;
if (alpha < 0.05) // treat as totally transparent
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl
index 9a0024ede9..097e28aa0c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl
@@ -23,24 +23,20 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-VARYING float pos_w;
-VARYING float target_pos_x;
-VARYING vec2 vary_texcoord0;
+in float pos_w;
+in float target_pos_x;
+in vec2 vary_texcoord0;
uniform vec4 color;
void main()
{
- float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * color.a;
+ float alpha = texture(diffuseMap, vary_texcoord0.xy).a * color.a;
if (alpha < 0.05) // treat as totally transparent
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl
index dfe7077db5..57e0b2b59f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl
@@ -30,13 +30,13 @@ uniform float shadow_target_width;
mat4 getSkinnedTransform();
void passTextureIndex();
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING float pos_w;
-VARYING float target_pos_x;
-VARYING vec2 vary_texcoord0;
+out float pos_w;
+out float target_pos_x;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index 01ffb862f7..83b0ba096c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -27,14 +27,14 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec4 diffuse_color;
+in vec2 texcoord0;
-VARYING vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec3 vary_normal;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index 22b3bd1463..6ebe4ce251 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -25,24 +25,20 @@
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_data[3];
-#else
-#define frag_data gl_FragData
-#endif
uniform sampler2D diffuseMap;
uniform float minimum_alpha;
-VARYING vec3 vary_normal;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_normal;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
void main()
{
- vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 diff = texture(diffuseMap, vary_texcoord0.xy);
if (diff.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index ac8a483a6a..5c64d48399 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -27,9 +27,9 @@ uniform mat4 projection_matrix;
mat4 getSkinnedTransform();
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 1bd8fee7c9..bc0c11ec46 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -25,16 +25,16 @@
uniform mat4 projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
mat4 getSkinnedTransform();
-ATTRIBUTE vec4 weight;
+in vec4 weight;
-VARYING vec3 vary_normal;
-VARYING vec2 vary_texcoord0;
+out vec3 vary_normal;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index cc79b450ac..08baf98686 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -23,15 +23,9 @@
* $/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 normalMap;
uniform sampler2D lightMap;
@@ -43,7 +37,7 @@ uniform vec2 screen_res;
uniform vec3 kern[4];
uniform float kern_scale;
-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/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 5e0f01981b..5abaa1f2a6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_fragcoord;
+out vec2 vary_fragcoord;
uniform vec2 screen_res;
void main()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
index c18bca066d..35f483f633 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -31,18 +31,18 @@ uniform float minimum_alpha;
uniform sampler2D diffuseMap;
uniform sampler2D bumpMap;
-VARYING vec3 vary_mat0;
-VARYING vec3 vary_mat1;
-VARYING vec3 vary_mat2;
+in vec3 vary_mat0;
+in vec3 vary_mat1;
+in vec3 vary_mat2;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy);
if(col.a < minimum_alpha)
{
@@ -50,7 +50,7 @@ void main()
}
col *= vertex_color;
- vec3 norm = texture2D(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0;
+ vec3 norm = texture(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0;
vec3 tnorm = vec3(dot(norm,vary_mat0),
dot(norm,vary_mat1),
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index d90891aa20..3af2eab1e4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -27,17 +27,17 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec4 tangent;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
+in vec2 texcoord0;
+in vec4 tangent;
-VARYING vec3 vary_mat0;
-VARYING vec3 vary_mat1;
-VARYING vec3 vary_mat2;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec3 vary_mat0;
+out vec3 vary_mat1;
+out vec3 vary_mat2;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 61eee69a16..98314d39d3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -25,23 +25,23 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
//////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
///////////////////////////////////////////////////////////////////////////////
// Output parameters
-VARYING vec3 vary_CloudColorSun;
-VARYING vec3 vary_CloudColorAmbient;
-VARYING float vary_CloudDensity;
-
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
-VARYING vec2 vary_texcoord3;
-VARYING float altitude_blend_factor;
+out vec3 vary_CloudColorSun;
+out vec3 vary_CloudColorAmbient;
+out float vary_CloudDensity;
+
+out vec2 vary_texcoord0;
+out vec2 vary_texcoord1;
+out vec2 vary_texcoord2;
+out vec2 vary_texcoord3;
+out float altitude_blend_factor;
// Inputs
uniform vec3 camPosLocal;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 929b4e17b1..d95a33a6be 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -23,15 +23,9 @@
* $/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 diffuseRect;
uniform sampler2D depthMap;
@@ -47,7 +41,7 @@ uniform float max_cof;
uniform mat4 inv_proj;
uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
float calc_cof(float depth)
{
@@ -68,13 +62,13 @@ void main()
{
vec2 tc = vary_fragcoord.xy;
- float z = texture2D(depthMap, tc).r;
+ float z = texture(depthMap, tc).r;
z = z*2.0-1.0;
vec4 ndc = vec4(0.0, 0.0, z, 1.0);
vec4 p = inv_proj*ndc;
float depth = p.z/p.w;
- vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy);
+ vec4 diff = texture(diffuseRect, vary_fragcoord.xy);
float sc = calc_cof(depth);
sc = min(sc, max_cof);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
index 8797f89e4c..55e45ce0af 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
@@ -144,7 +144,7 @@ vec2 getScreenCoordinate(vec2 screenpos)
// Method #4: Spheremap Transform, Lambert Azimuthal Equal-Area projection
vec3 getNorm(vec2 screenpos)
{
- vec2 enc = texture2D(normalMap, screenpos.xy).xy;
+ vec2 enc = texture(normalMap, screenpos.xy).xy;
vec2 fenc = enc*4-2;
float f = dot(fenc,fenc);
float g = sqrt(1-f/4);
@@ -170,7 +170,7 @@ vec3 getNormalFromPacked(vec4 packedNormalEnvIntensityFlags)
// See: C++: addDeferredAttachments(), GLSL: softenLightF
vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity)
{
- vec4 packedNormalEnvIntensityFlags = texture2D(normalMap, screenpos.xy);
+ vec4 packedNormalEnvIntensityFlags = texture(normalMap, screenpos.xy);
n = getNormalFromPacked( packedNormalEnvIntensityFlags );
envIntensity = packedNormalEnvIntensityFlags.z;
return packedNormalEnvIntensityFlags;
@@ -190,7 +190,7 @@ float linearDepth01(float d, float znear, float zfar)
float getDepth(vec2 pos_screen)
{
- float depth = texture2D(depthMap, pos_screen).r;
+ float depth = texture(depthMap, pos_screen).r;
return depth;
}
@@ -199,7 +199,7 @@ vec4 getTexture2DLodAmbient(vec2 tc, float lod)
#ifndef FXAA_GLSL_120
vec4 ret = textureLod(projectionMap, tc, lod);
#else
- vec4 ret = texture2D(projectionMap, tc);
+ vec4 ret = texture(projectionMap, tc);
#endif
ret.rgb = srgb_to_linear(ret.rgb);
@@ -215,7 +215,7 @@ vec4 getTexture2DLodDiffuse(vec2 tc, float lod)
#ifndef FXAA_GLSL_120
vec4 ret = textureLod(projectionMap, tc, lod);
#else
- vec4 ret = texture2D(projectionMap, tc);
+ vec4 ret = texture(projectionMap, tc);
#endif
ret.rgb = srgb_to_linear(ret.rgb);
@@ -262,7 +262,7 @@ vec4 texture2DLodSpecular(vec2 tc, float lod)
#ifndef FXAA_GLSL_120
vec4 ret = textureLod(projectionMap, tc, lod);
#else
- vec4 ret = texture2D(projectionMap, tc);
+ vec4 ret = texture(projectionMap, tc);
#endif
ret.rgb = srgb_to_linear(ret.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index afc05b8bb5..6f3b94f734 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -31,15 +31,15 @@ uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-VARYING vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_normal;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy) * vertex_color;
if (col.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index 078197f9a8..e5f2af2c53 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -27,12 +27,12 @@
out vec4 frag_data[4];
-VARYING vec3 vary_normal;
+in vec3 vary_normal;
uniform float minimum_alpha;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index 307dda6b73..234f096ed5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -31,14 +31,14 @@ uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-VARYING vec3 vary_normal;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_normal;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index 24e290c614..68fb8bf499 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -29,15 +29,15 @@ out vec4 frag_data[4];
uniform sampler2D diffuseMap;
-VARYING vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_normal;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
void main()
{
- vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
+ vec3 col = vertex_color.rgb * texture(diffuseMap, vary_texcoord0.xy).rgb;
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index be870b2424..93d561504e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -27,9 +27,9 @@
out vec4 frag_data[4];
-VARYING vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec3 vary_normal;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
vec3 linear_to_srgb(vec3 c);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index 9461e3e32e..13cc612fab 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -27,13 +27,13 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec3 vary_normal;
+out vec3 vary_normal;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index d64bcefade..2402cc3b70 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -27,15 +27,15 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec3 vary_normal;
+out vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void passTextureIndex();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index d9c0e590c8..3b9b8ae696 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -23,15 +23,9 @@
* $/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 diffuseRect;
uniform sampler2D lightMap;
@@ -44,14 +38,14 @@ uniform float res_scale;
uniform float dof_width;
uniform float dof_height;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
vec4 dofSample(sampler2D tex, vec2 tc)
{
tc.x = min(tc.x, dof_width);
tc.y = min(tc.y, dof_height);
- return texture2D(tex, tc);
+ return texture(tex, tc);
}
void main()
@@ -60,7 +54,7 @@ void main()
vec4 dof = dofSample(diffuseRect, vary_fragcoord.xy*res_scale);
- vec4 diff = texture2D(lightMap, vary_fragcoord.xy);
+ vec4 diff = texture(lightMap, vary_fragcoord.xy);
float a = min(abs(diff.a*2.0-1.0) * max_cof*res_scale*res_scale, 1.0);
@@ -69,10 +63,10 @@ void main()
float sc = a/res_scale;
vec4 col;
- col = texture2D(lightMap, vary_fragcoord.xy+vec2(sc,sc)/screen_res);
- col += texture2D(lightMap, vary_fragcoord.xy+vec2(-sc,sc)/screen_res);
- col += texture2D(lightMap, vary_fragcoord.xy+vec2(sc,-sc)/screen_res);
- col += texture2D(lightMap, vary_fragcoord.xy+vec2(-sc,-sc)/screen_res);
+ col = texture(lightMap, vary_fragcoord.xy+vec2(sc,sc)/screen_res);
+ col += texture(lightMap, vary_fragcoord.xy+vec2(-sc,sc)/screen_res);
+ col += texture(lightMap, vary_fragcoord.xy+vec2(sc,-sc)/screen_res);
+ col += texture(lightMap, vary_fragcoord.xy+vec2(-sc,-sc)/screen_res);
diff = mix(diff, col*0.25, a);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index 3c51a8e44c..9e61b6b894 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -23,16 +23,12 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
-vec3 fullbrightAtmosTransport(vec3 light);
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index 08b1147ab0..5a0913a970 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -27,18 +27,18 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
void passTextureIndex();
-ATTRIBUTE vec4 emissive;
-ATTRIBUTE vec2 texcoord0;
+in vec4 emissive;
+in vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
vec3 atmosAmbient();
vec3 atmosAffectDirectionalLight(float lightIntensity);
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
index 81f1e9aed0..9ac4ceb37e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 5515d8e2a3..385cd51969 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -45,7 +43,8 @@ vec3 srgb_to_linear(vec3 cs);
vec3 legacy_adjust_fullbright(vec3 c);
vec3 legacy_adjust(vec3 c);
vec3 linear_to_srgb(vec3 cl);
-vec3 fullbrightAtmosTransport(vec3 light);
+vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
+void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao);
#ifdef HAS_ALPHA_MASK
uniform float minimum_alpha;
@@ -79,8 +78,18 @@ void main()
color.rgb *= vertex_color.rgb;
-#ifdef WATER_FOG
vec3 pos = vary_position;
+
+#ifndef IS_HUD
+ vec3 sunlit;
+ vec3 amblit;
+ vec3 additive;
+ vec3 atten;
+ calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
+#endif
+
+#ifdef WATER_FOG
+
vec4 fogged = applyWaterFogView(pos, vec4(color.rgb, final_alpha));
color.rgb = fogged.rgb;
color.a = fogged.a;
@@ -92,7 +101,7 @@ void main()
color.rgb = legacy_adjust(color.rgb);
color.rgb = srgb_to_linear(color.rgb);
color.rgb = legacy_adjust_fullbright(color.rgb);
- color.rgb = fullbrightAtmosTransport(color.rgb);
+ color.rgb = atmosFragLighting(color.rgb, additive, atten);
#endif
frag_color = max(color, vec4(0));
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl
index 0e461b4004..5795384b47 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl
@@ -36,16 +36,16 @@ uniform vec4 origin;
-ATTRIBUTE vec3 position;
+in vec3 position;
void passTextureIndex();
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+in vec3 normal;
+in vec4 diffuse_color;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
-VARYING vec3 vary_texcoord1;
-VARYING vec3 vary_position;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
+out vec3 vary_texcoord1;
+out vec3 vary_position;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index e565722164..77e63e6360 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -28,20 +28,20 @@ uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
void passTextureIndex();
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
+in vec4 diffuse_color;
+in vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
vec3 atmosAmbient();
vec3 atmosAffectDirectionalLight(float lightIntensity);
-VARYING vec3 vary_position;
+out vec3 vary_position;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
index 50d697ae12..cd56ed0adf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl
@@ -2093,8 +2093,8 @@ uniform sampler2D depthMap;
uniform vec2 rcp_screen_res;
uniform vec4 rcp_frame_opt;
uniform vec4 rcp_frame_opt2;
-VARYING vec2 vary_fragcoord;
-VARYING vec2 vary_tc;
+in vec2 vary_fragcoord;
+in vec2 vary_tc;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl
index 9e6c853015..e40d070268 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl
@@ -49,7 +49,7 @@ SOFTWARE.
/*[EXTRA_CODE_HERE]*/
-VARYING vec2 vary_uv;
+in vec2 vary_uv;
out vec4 outColor;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl
index 682244478b..3a1572996f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_uv;
+out vec2 vary_uv;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl
index 74df43b7c3..748fcbed80 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl
@@ -28,11 +28,11 @@ out vec4 frag_data[4];
uniform vec4 color;
uniform sampler2D diffuseMap;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy);
+ frag_data[0] = color*texture(diffuseMap, vary_texcoord0.xy);
frag_data[1] = vec4(0.0);
frag_data[2] = vec4(0.0, 1.0, 0.0, GBUFFER_FLAG_SKIP_ATMOS);
frag_data[3] = vec4(0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index 5e67442b3a..aae595f619 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -34,22 +34,22 @@ uniform sampler2D diffuseMap;
uniform sampler2D normalMap;
uniform sampler2D specularMap;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
vec3 linear_to_srgb(vec3 c);
vec2 encode_normal (vec3 n);
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha)
{
discard;
}
- vec4 norm = texture2D(normalMap, vary_texcoord0.xy);
- vec4 spec = texture2D(specularMap, vary_texcoord0.xy);
+ vec4 norm = texture(normalMap, vary_texcoord0.xy);
+ vec4 spec = texture(specularMap, vary_texcoord0.xy);
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = spec;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 42266e9378..444c54a31e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.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;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
index d41e0b202b..7cdddfe8db 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
@@ -43,38 +43,38 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 modelview_matrix;
#endif
-VARYING vec3 vary_position;
+out vec3 vary_position;
#endif
uniform mat4 texture_matrix0;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
+in vec2 texcoord0;
#ifdef HAS_NORMAL_MAP
-ATTRIBUTE vec4 tangent;
-ATTRIBUTE vec2 texcoord1;
+in vec4 tangent;
+in vec2 texcoord1;
out vec3 vary_tangent;
flat out float vary_sign;
out vec3 vary_normal;
-VARYING vec2 vary_texcoord1;
+out vec2 vary_texcoord1;
#else
-VARYING vec3 vary_normal;
+out vec3 vary_normal;
#endif
#ifdef HAS_SPECULAR_MAP
-ATTRIBUTE vec2 texcoord2;
-VARYING vec2 vary_texcoord2;
+in vec2 texcoord2;
+out vec2 vary_texcoord2;
#endif
-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/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index 573b522068..f3e7b2ee72 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_data[4];
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
index 7a941674b8..05dced0026 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl
@@ -23,19 +23,13 @@
* $/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 alphaMap;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
uniform float stepX;
uniform float stepY;
@@ -43,12 +37,12 @@ uniform float norm_scale;
void main()
{
- float c = texture2D(alphaMap, vary_texcoord0).r;
+ float c = texture(alphaMap, vary_texcoord0).r;
- vec3 right = vec3(norm_scale, 0, (texture2D(alphaMap, vary_texcoord0+vec2(stepX, 0)).r-c)*255);
- vec3 left = vec3(-norm_scale, 0, (texture2D(alphaMap, vary_texcoord0-vec2(stepX, 0)).r-c)*255);
- vec3 up = vec3(0, -norm_scale, (texture2D(alphaMap, vary_texcoord0-vec2(0, stepY)).r-c)*255);
- vec3 down = vec3(0, norm_scale, (texture2D(alphaMap, vary_texcoord0+vec2(0, stepY)).r-c)*255);
+ vec3 right = vec3(norm_scale, 0, (texture(alphaMap, vary_texcoord0+vec2(stepX, 0)).r-c)*255);
+ vec3 left = vec3(-norm_scale, 0, (texture(alphaMap, vary_texcoord0-vec2(stepX, 0)).r-c)*255);
+ vec3 up = vec3(0, -norm_scale, (texture(alphaMap, vary_texcoord0-vec2(0, stepY)).r-c)*255);
+ vec3 down = vec3(0, norm_scale, (texture(alphaMap, vary_texcoord0+vec2(0, stepY)).r-c)*255);
vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl
index 9bceae05b7..7896659ad3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl
@@ -23,11 +23,11 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
-VARYING vec2 vary_fragcoord;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_fragcoord;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
index 5ef9bb6805..e06f3a5f44 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
@@ -23,11 +23,7 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl
index 1c36aa6b50..b74b2e6a83 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl
@@ -47,7 +47,7 @@ vec3 srgb_to_linear(vec3 c);
void main()
{
- vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba;
+ vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba;
if (basecolor.a < minimum_alpha)
{
@@ -55,7 +55,7 @@ void main()
}
vec3 emissive = emissiveColor;
- emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
+ emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
float lum = max(max(emissive.r, emissive.g), emissive.b);
lum *= vertex_emissive.a;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
index 8e5a6c90e0..faa273b834 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -62,7 +62,7 @@ uniform mat3 normal_matrix;
void main()
{
- vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba;
+ vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba;
if (basecolor.a < minimum_alpha)
{
discard;
@@ -71,7 +71,7 @@ void main()
vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb);
// from mikktspace.com
- vec3 vNt = texture2D(bumpMap, normal_texcoord.xy).xyz*2.0-1.0;
+ vec3 vNt = texture(bumpMap, normal_texcoord.xy).xyz*2.0-1.0;
float sign = vary_sign;
vec3 vN = vary_normal;
vec3 vT = vary_tangent.xyz;
@@ -84,13 +84,13 @@ void main()
// occlusion 1.0
// roughness 0.0
// metal 0.0
- vec3 spec = texture2D(specularMap, metallic_roughness_texcoord.xy).rgb;
+ vec3 spec = texture(specularMap, metallic_roughness_texcoord.xy).rgb;
spec.g *= roughnessFactor;
spec.b *= metallicFactor;
vec3 emissive = emissiveColor;
- emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
+ emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
tnorm *= gl_FrontFacing ? 1.0 : -1.0;
@@ -131,7 +131,7 @@ vec3 srgb_to_linear(vec3 c);
void main()
{
- vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba;
+ vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba;
if (basecolor.a < minimum_alpha)
{
discard;
@@ -140,7 +140,7 @@ void main()
vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb);
vec3 emissive = emissiveColor;
- emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
+ emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
col += emissive;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 5ca39d6966..86e3f1acda 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -23,15 +23,9 @@
* $/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 diffuseRect;
@@ -40,11 +34,11 @@ uniform vec2 screen_res;
uniform float max_cof;
uniform float res_scale;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
{
- vec4 s = texture2D(diffuseRect, tc);
+ vec4 s = texture(diffuseRect, tc);
float sc = abs(s.a*2.0-1.0)*max_cof;
@@ -63,7 +57,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc)
void dofSampleNear(inout vec4 diff, inout float w, float min_sc, vec2 tc)
{
- vec4 s = texture2D(diffuseRect, tc);
+ vec4 s = texture(diffuseRect, tc);
float wg = 0.25;
@@ -79,7 +73,7 @@ void main()
{
vec2 tc = vary_fragcoord.xy;
- vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy);
+ vec4 diff = texture(diffuseRect, vary_fragcoord.xy);
{
float w = 1.0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index 80816912da..a32296369c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -23,21 +23,15 @@
* $/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 diffuseRect;
uniform sampler2D exposureMap;
uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
vec3 linear_to_srgb(vec3 cl);
@@ -173,7 +167,7 @@ vec3 legacyGamma(vec3 color)
void main()
{
//this is the one of the rare spots where diffuseRect contains linear color values (not sRGB)
- vec4 diff = texture2D(diffuseRect, vary_fragcoord);
+ vec4 diff = texture(diffuseRect, vary_fragcoord);
diff.rgb = toneMap(diff.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index 004190dbd9..bace9b8c90 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -23,25 +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 sampler2D diffuseRect;
uniform sampler2D depthMap;
uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
void main()
{
- vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy);
+ vec4 diff = texture(diffuseRect, vary_fragcoord.xy);
frag_color = diff;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl
index 8b4cac3e64..7e8a5d68d4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.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/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 86f0077edb..10b4b3e76c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -23,10 +23,10 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_fragcoord;
-VARYING vec2 vary_tc;
+out vec2 vary_fragcoord;
+out vec2 vary_tc;
uniform vec2 tc_scale;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl
index f75b8e2658..2c17de311c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.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
uniform sampler2D diffuseRect;
uniform float mipLevel;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 8c9b6f8190..a8febabcc6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -25,11 +25,7 @@
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl
index 9608e89169..0f5f9ed289 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.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/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index 406a7ef3b3..370aa75d04 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-/*[EXTRA_CODE_HERE]*/
-
out vec4 frag_color;
void main()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl
index 186ba49969..9bbc63bce1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl
@@ -26,7 +26,7 @@
uniform mat4 modelview_matrix;
uniform mat4 projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 4fa9ae3633..17ce2dee5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -25,7 +25,7 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
// SKY ////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 4f1756c367..b35d10c8a0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -48,8 +48,8 @@ void main()
{
// camera above water: class1\deferred\starsF.glsl
// camera below water: class1\environment\starsF.glsl
- vec4 col_a = texture2D(diffuseMap, vary_texcoord0.xy);
- vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col_a = texture(diffuseMap, vary_texcoord0.xy);
+ vec4 col_b = texture(diffuseMap, vary_texcoord0.xy);
vec4 col = mix(col_b, col_a, blend_factor);
col.rgb *= vertex_color.rgb;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index 37d1630252..726508607d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -27,13 +27,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
uniform float time;
-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;
-VARYING vec2 screenpos;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
+out vec2 screenpos;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
index a85e6ebc66..fd343ed2dc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_data[4];
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
index d3dfa882f0..9a8d791a1d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
@@ -27,11 +27,11 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
-VARYING vec2 vary_texcoord0;
-VARYING float sun_fade;
+out vec2 vary_texcoord0;
+out float sun_fade;
void calcAtmospherics(vec3 eye_pos);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index 3464212c84..f6d509e2c6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -33,10 +33,10 @@ uniform sampler2D detail_2;
uniform sampler2D detail_3;
uniform sampler2D alpha_ramp;
-VARYING vec3 pos;
-VARYING vec3 vary_normal;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
+in vec3 pos;
+in vec3 vary_normal;
+in vec4 vary_texcoord0;
+in vec4 vary_texcoord1;
vec2 encode_normal(vec3 n);
@@ -44,14 +44,14 @@ void main()
{
/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
- vec4 color0 = texture2D(detail_0, vary_texcoord0.xy);
- vec4 color1 = texture2D(detail_1, vary_texcoord0.xy);
- vec4 color2 = texture2D(detail_2, vary_texcoord0.xy);
- vec4 color3 = texture2D(detail_3, vary_texcoord0.xy);
+ vec4 color0 = texture(detail_0, vary_texcoord0.xy);
+ vec4 color1 = texture(detail_1, vary_texcoord0.xy);
+ vec4 color2 = texture(detail_2, vary_texcoord0.xy);
+ vec4 color3 = texture(detail_3, vary_texcoord0.xy);
- float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a;
- float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a;
- float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
+ float alpha1 = texture(alpha_ramp, vary_texcoord0.zw).a;
+ float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a;
+ float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a;
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
outColor.a = 0.0; // yes, downstream atmospherics
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index f42cb6ff6d..f6d3b59e85 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -27,16 +27,16 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec2 texcoord0;
-ATTRIBUTE vec2 texcoord1;
+in vec3 position;
+in vec3 normal;
+in vec4 diffuse_color;
+in vec2 texcoord0;
+in vec2 texcoord1;
-VARYING vec3 pos;
-VARYING vec3 vary_normal;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
+out vec3 pos;
+out vec3 vary_normal;
+out vec4 vary_texcoord0;
+out vec4 vary_texcoord1;
uniform vec4 object_plane_s;
uniform vec4 object_plane_t;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index d857e47b90..e2d87e68fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -29,9 +29,9 @@ out vec4 frag_data[4];
uniform sampler2D diffuseMap;
-VARYING vec4 vertex_color;
-VARYING vec3 vary_normal;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec3 vary_normal;
+in vec2 vary_texcoord0;
uniform float minimum_alpha;
@@ -39,7 +39,7 @@ vec2 encode_normal(vec3 n);
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha)
{
discard;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index c850a39d6f..7dcab640f2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -36,7 +36,7 @@ in vec2 vary_texcoord0;
void main()
{
- float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a;
+ float alpha = texture(diffuseMap, vary_texcoord0.xy).a;
if (alpha < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl
index 5a7cf369b5..f5192c3009 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl
@@ -27,8 +27,8 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec2 texcoord0;
out vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 3b6571a24a..ce8a10712c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -27,13 +27,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
uniform mat3 normal_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec3 vary_normal;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec3 vary_normal;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index 4e535f7e18..7a5e14566b 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -23,15 +23,9 @@
* $/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 diffuseMap;
uniform float minLuminance;
@@ -40,11 +34,11 @@ uniform vec3 lumWeights;
uniform vec3 warmthWeights;
uniform float warmthAmount;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 col = texture(diffuseMap, vary_texcoord0.xy);
/// CALCULATING LUMINANCE (Using NTSC lum weights)
/// http://en.wikipedia.org/wiki/Luma_%28video%29
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index fdca5018b0..ccda75596d 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_texcoord0;
+out vec2 vary_texcoord0;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 301e8aba26..8718dd8b52 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -23,19 +23,15 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
uniform float glowStrength;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
-VARYING vec4 vary_texcoord2;
-VARYING vec4 vary_texcoord3;
+in vec4 vary_texcoord0;
+in vec4 vary_texcoord1;
+in vec4 vary_texcoord2;
+in vec4 vary_texcoord3;
void main()
{
@@ -47,14 +43,14 @@ void main()
kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0;
kern[4] = 1.0; kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25;
- col += kern[0] * texture2D(diffuseMap, vary_texcoord0.xy);
- col += kern[1] * texture2D(diffuseMap, vary_texcoord1.xy);
- col += kern[2] * texture2D(diffuseMap, vary_texcoord2.xy);
- col += kern[3] * texture2D(diffuseMap, vary_texcoord3.xy);
- col += kern[4] * texture2D(diffuseMap, vary_texcoord0.zw);
- col += kern[5] * texture2D(diffuseMap, vary_texcoord1.zw);
- col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw);
- col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw);
+ col += kern[0] * texture(diffuseMap, vary_texcoord0.xy);
+ col += kern[1] * texture(diffuseMap, vary_texcoord1.xy);
+ col += kern[2] * texture(diffuseMap, vary_texcoord2.xy);
+ col += kern[3] * texture(diffuseMap, vary_texcoord3.xy);
+ col += kern[4] * texture(diffuseMap, vary_texcoord0.zw);
+ col += kern[5] * texture(diffuseMap, vary_texcoord1.zw);
+ col += kern[6] * texture(diffuseMap, vary_texcoord2.zw);
+ col += kern[7] * texture(diffuseMap, vary_texcoord3.zw);
frag_color = max(vec4(col.rgb * glowStrength, col.a), vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index 63ca15139c..60ec4e6f3b 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -25,14 +25,14 @@
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
uniform vec2 glowDelta;
-VARYING vec4 vary_texcoord0;
-VARYING vec4 vary_texcoord1;
-VARYING vec4 vary_texcoord2;
-VARYING vec4 vary_texcoord3;
+out vec4 vary_texcoord0;
+out vec4 vary_texcoord1;
+out vec4 vary_texcoord2;
+out vec4 vary_texcoord3;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
index 3817633df0..689c345b2c 100644
--- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
@@ -125,6 +125,6 @@ vec3 legacy_adjust(vec3 c)
vec3 legacy_adjust_fullbright(vec3 c)
{
float exp_scale = texture(exposureMap, vec2(0.5, 0.5)).r;
- return c / exp_scale * 1.34;
+ return c / exp_scale * 1.34; //magic 1.34 arrived at by binary search for a value that reproduces midpoint grey consistenty
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index ac400aa2a6..5a3845b1a3 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -27,7 +27,7 @@ uniform mat4 modelview_matrix;
uniform mat3 normal_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
void calcAtmospherics(vec3 inPositionEye);
@@ -39,9 +39,9 @@ uniform vec3 eyeVec;
uniform float waterHeight;
uniform vec3 lightDir;
-VARYING vec4 refCoord;
-VARYING vec4 littleWave;
-VARYING vec4 view;
+out vec4 refCoord;
+out vec4 littleWave;
+out vec4 view;
out vec3 vary_position;
out vec3 vary_light_dir;
out vec3 vary_tangent;
diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
index 69c1983b4d..a46e91c394 100644
--- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl
@@ -23,22 +23,18 @@
* $/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;
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 9454bbf21e..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()
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/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
index cb8d6a8c03..cefa429639 100644
--- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl
@@ -23,11 +23,7 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform vec4 color;
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/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index e578bb6fc5..fa8aa5c7fe 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
@@ -36,5 +34,5 @@ in vec2 tc;
void main()
{
- frag_color = texture2D(diffuseRect, tc) + texture2D(emissiveRect, tc);
+ 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 c50548d528..3d4035620f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-
/*[EXTRA_CODE_HERE]*/
out vec4 frag_color;
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
index 48aab1ce21..fa67b13e4d 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -24,9 +24,9 @@
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec2 vary_tc;
+out vec2 vary_tc;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 58c9e5ad0a..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 = max(color*texture2D(diffuseMap, vary_texcoord0.xy), vec4(0));
+ 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/irradianceGenV.glsl b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl
index 5190abf17c..633c928e6b 100644
--- a/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec3 vary_dir;
+out vec3 vary_dir;
void main()
{
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/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
index cd5d97c785..9ecdf0bf77 100644
--- a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
@@ -31,7 +31,7 @@ out vec4 frag_color;
uniform samplerCubeArray reflectionProbes;
uniform int sourceIdx;
-VARYING vec3 vary_dir;
+in vec3 vary_dir;
//uniform float roughness;
diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl
index 5f5d9396ff..2c31e98838 100644
--- a/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec3 vary_dir;
+out vec3 vary_dir;
void main()
{
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/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()
{
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
index eaf0f71b41..6535c0835e 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
@@ -23,19 +23,15 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void default_lighting()
{
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
index fc76c0cc00..4dc67028d5 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl
@@ -23,11 +23,7 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
@@ -36,12 +32,12 @@ uniform sampler2D diffuseMap;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void default_lighting()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy);
if (color.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 6b86d717da..2d1c7dadb0 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -23,14 +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;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
index 59c1bc1446..cea08ecffd 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl
@@ -23,14 +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;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
@@ -39,7 +35,7 @@ vec3 scaleSoftClip(vec3 light);
void default_lighting()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color;
color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
index 7da8e9054a..670b3ddaf1 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl
@@ -23,19 +23,15 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
vec3 atmosLighting(vec3 light);
vec4 applyWaterFog(vec4 color);
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void default_lighting_water()
{
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
index f767c17f86..2e5ed57014 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl
@@ -23,11 +23,7 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
@@ -36,12 +32,12 @@ uniform sampler2D diffuseMap;
vec3 atmosLighting(vec3 light);
vec4 applyWaterFog(vec4 color);
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void default_lighting_water()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy);
if (color.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index 2530bdcc74..09b4a6e317 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -23,14 +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;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec3 atmosLighting(vec3 light);
vec4 applyWaterFog(vec4 color);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
index 7f112d7435..4888fa547c 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl
@@ -23,14 +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;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
@@ -39,7 +35,7 @@ vec4 applyWaterFog(vec4 color);
void default_lighting_water()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color;
color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 1deb374cd0..67c99530e3 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -23,22 +23,18 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D texture0;
uniform sampler2D texture1;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
+in vec2 vary_texcoord0;
+in vec2 vary_texcoord1;
void main()
{
- float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
- float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
+ float tex0 = texture(texture0, vary_texcoord0.xy).a;
+ float tex1 = texture(texture1, vary_texcoord1.xy).a;
frag_color = max(vec4(tex0+(1.0-tex1)-0.5), vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index ee9970bc70..7d5417919e 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -26,12 +26,12 @@
uniform mat4 texture_matrix0;
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;
#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index 467a9949e4..ff9aaf3357 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -23,21 +23,17 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
void main()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy);
if (color.a < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
index e90dbb115a..cf3162f5f1 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -27,10 +27,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;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
index ca29bf3143..d90f9271dc 100644
--- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-ATTRIBUTE int texture_index;
+in int texture_index;
-VARYING_FLAT int vary_texture_index;
+flat out int vary_texture_index;
void passTextureIndex()
{
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl
index 687d6b7482..ec785cd1c0 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl
@@ -23,19 +23,15 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
void main()
{
- vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
+ vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color;
frag_color = max(color, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl
index b56fc97a85..e3e71202ae 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl
@@ -23,20 +23,16 @@
* $/LicenseInfo$
*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseMap;
uniform vec4 color;
-VARYING vec2 vary_texcoord0;
+in vec2 vary_texcoord0;
//====================================================================================================
void main()
{
- frag_color = max(texture2D(diffuseMap,vary_texcoord0.xy) * color, vec4(0));
+ frag_color = max(texture(diffuseMap,vary_texcoord0.xy) * color, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl
index 913dec83bd..d8c74e8537 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl
@@ -27,10 +27,10 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
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;
//====================================================================================================
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 5886f47cbc..b474a5803f 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -28,14 +28,14 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
uniform vec4 color;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index 22821a2f76..07f5d250cf 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -30,12 +30,12 @@ uniform mat4 modelview_projection_matrix;
uniform vec4 color;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec3 normal;
+in vec2 texcoord0;
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color);
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);
-}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
index 6b7dc7ac1d..1c79748b49 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
@@ -25,26 +25,23 @@
/*[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;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
+in vec3 vary_texcoord1;
+in vec3 vary_position;
uniform samplerCube environmentMap;
-vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten);
-
+vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
+vec3 legacy_adjust_fullbright(vec3 c);
+vec3 legacy_adjust(vec3 c);
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);
@@ -61,7 +58,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
color.rgb *= vertex_color.rgb;
@@ -84,10 +81,13 @@ void main()
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 = legacy_adjust(color.rgb);
color.rgb = srgb_to_linear(color.rgb);
- color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
+ color.rgb = legacy_adjust_fullbright(color.rgb);
+
+ applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity);
+ color.rgb = atmosFragLighting(color.rgb, additive, atten);
#endif
color.a = 1.0;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index e5341386bd..77e3b92385 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -52,11 +52,7 @@ vec3 legacy_adjust(vec3 c);
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
#ifdef HAS_SUN_SHADOW
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
@@ -77,9 +73,9 @@ uniform mat3 env_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
-VARYING vec3 vary_position;
+in vec3 vary_position;
uniform mat4 proj_mat;
uniform mat4 inv_proj;
@@ -167,7 +163,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
if (nh > 0.0)
{
- float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da);
+ float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da);
vec3 speccol = lit*scol*light_col.rgb*spec.rgb;
speccol = clamp(speccol, vec3(0), vec3(1));
col += speccol;
@@ -184,11 +180,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
}
#else
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_data[4];
-#else
-#define frag_data gl_FragData
-#endif
#endif
uniform sampler2D diffuseMap; //always in sRGB space
@@ -200,7 +192,7 @@ uniform sampler2D bumpMap;
#ifdef HAS_SPECULAR_MAP
uniform sampler2D specularMap;
-VARYING vec2 vary_texcoord2;
+in vec2 vary_texcoord2;
#endif
uniform float env_intensity;
@@ -214,13 +206,13 @@ uniform float minimum_alpha;
in vec3 vary_normal;
in vec3 vary_tangent;
flat in float vary_sign;
-VARYING vec2 vary_texcoord1;
+in vec2 vary_texcoord1;
#else
-VARYING vec3 vary_normal;
+in vec3 vary_normal;
#endif
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+in vec4 vertex_color;
+in vec2 vary_texcoord0;
vec2 encode_normal(vec3 n);
@@ -228,7 +220,7 @@ vec2 encode_normal(vec3 n);
vec3 getNormal(inout float glossiness)
{
#ifdef HAS_NORMAL_MAP
- vec4 vNt = texture2D(bumpMap, vary_texcoord1.xy);
+ vec4 vNt = texture(bumpMap, vary_texcoord1.xy);
glossiness *= vNt.a;
vNt.xyz = vNt.xyz * 2 - 1;
float sign = vary_sign;
@@ -247,7 +239,7 @@ vec3 getNormal(inout float glossiness)
vec4 getSpecular()
{
#ifdef HAS_SPECULAR_MAP
- vec4 spec = texture2D(specularMap, vary_texcoord2.xy);
+ vec4 spec = texture(specularMap, vary_texcoord2.xy);
spec.rgb *= specular_color.rgb;
#else
vec4 spec = vec4(specular_color.rgb, 1.0);
@@ -301,7 +293,7 @@ void main()
waterClip();
// diffcol == diffuse map combined with vertex color
- vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy);
+ vec4 diffcol = texture(diffuseMap, vary_texcoord0.xy);
diffcol.rgb *= vertex_color.rgb;
alphaMask(diffcol.a);
@@ -364,7 +356,7 @@ void main()
if (glossiness > 0.0) // specular reflection
{
float sa = dot(normalize(refnormpersp), light_dir.xyz);
- vec3 dumbshiny = sunlit_linear * shadow * (texture2D(lightFunc, vec2(sa, glossiness)).r);
+ vec3 dumbshiny = sunlit_linear * shadow * (texture(lightFunc, vec2(sa, glossiness)).r);
// add the two types of shiny together
vec3 spec_contrib = dumbshiny * spec.rgb;
@@ -395,7 +387,7 @@ void main()
float gtdenom = 2 * nh;
float gt = max(0,(min(gtdenom * nv / vh, gtdenom * nl / vh)));
- float scol = shadow*fres*texture2D(lightFunc, vec2(nh, glossiness)).r*gt/(nh*nl);
+ float scol = shadow*fres*texture(lightFunc, vec2(nh, glossiness)).r*gt/(nh*nl);
color.rgb += lit*scol*sunlit_linear.rgb*spec.rgb;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
index 2da177ea7e..2a096a98ec 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
@@ -23,15 +23,9 @@
* $/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 depthMap;
uniform sampler2D diffuseRect;
@@ -49,7 +43,7 @@ uniform vec2 screen_res;
uniform float far_z;
uniform mat4 inv_proj;
-VARYING vec4 vary_fragcoord;
+in vec4 vary_fragcoord;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
@@ -88,15 +82,15 @@ void main()
vec3 n;
vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG()
- vec4 spec = texture2D(specularRect, tc);
- vec3 diffuse = texture2D(diffuseRect, tc).rgb;
+ vec4 spec = texture(specularRect, tc);
+ vec3 diffuse = texture(diffuseRect, tc).rgb;
vec3 h, l, v = -normalize(pos);
float nh, nv, vh, lightDist;
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 colorEmissive = texture2D(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
@@ -167,7 +161,7 @@ void main()
if (nh > 0.0)
{
- float scol = fres * texture2D(lightFunc, vec2(nh, spec.a)).r * gt / (nh * nl);
+ float scol = fres * texture(lightFunc, vec2(nh, spec.a)).r * gt / (nh * nl);
col += lit * scol * light_col[i].rgb * spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl
index 831b3b2684..c2b9ed3d96 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl
@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
-ATTRIBUTE vec3 position;
+in vec3 position;
-VARYING vec4 vary_fragcoord;
+out vec4 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index 33715d4d87..23120bbbbe 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -23,16 +23,9 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_shader_texture_lod : enable
-
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseRect;
uniform sampler2D specularRect;
@@ -67,7 +60,7 @@ uniform float size;
uniform vec3 color;
uniform float falloff;
-VARYING vec4 vary_fragcoord;
+in vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -118,7 +111,7 @@ void main()
if (proj_shadow_idx >= 0)
{
- vec4 shd = texture2D(lightMap, tc);
+ vec4 shd = texture(lightMap, tc);
shadow = (proj_shadow_idx==0)?shd.b:shd.a;
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
@@ -139,8 +132,8 @@ void main()
float nh, nl, nv, vh, lightDist;
calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist);
- vec3 diffuse = texture2D(diffuseRect, tc).rgb;
- vec4 spec = texture2D(specularRect, tc);
+ vec3 diffuse = texture(diffuseRect, tc).rgb;
+ vec4 spec = texture(specularRect, tc);
vec3 dlit = vec3(0, 0, 0);
vec3 slit = vec3(0, 0, 0);
@@ -148,7 +141,7 @@ void main()
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 colorEmissive = texture2D(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
@@ -223,7 +216,7 @@ void main()
if (nh > 0.0)
{
- float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
+ float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
vec3 speccol = dlit*scol*spec.rgb*shadow;
speccol = clamp(speccol, vec3(0), vec3(1));
final_color += speccol;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
index 7724a6cac9..42ba96148c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
@@ -23,15 +23,9 @@
* $/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 diffuseRect;
uniform sampler2D specularRect;
@@ -48,8 +42,8 @@ uniform vec3 color;
uniform float falloff;
uniform float size;
-VARYING vec4 vary_fragcoord;
-VARYING vec3 trans_center;
+in vec4 vary_fragcoord;
+in vec3 trans_center;
uniform vec2 screen_res;
@@ -83,8 +77,8 @@ void main()
vec3 n;
vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG()
- vec3 diffuse = texture2D(diffuseRect, tc).rgb;
- vec4 spec = texture2D(specularRect, tc);
+ vec3 diffuse = texture(diffuseRect, tc).rgb;
+ vec4 spec = texture(specularRect, tc);
// Common half vectors calcs
vec3 lv = trans_center.xyz-pos;
@@ -101,7 +95,7 @@ void main()
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 colorEmissive = texture2D(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
@@ -141,7 +135,7 @@ void main()
if (nh > 0.0)
{
- float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
+ float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
final_color += lit*scol*color.rgb*spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl
index d42c8f6cf6..8d23f1b427 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl
@@ -26,13 +26,13 @@
uniform mat4 modelview_projection_matrix;
uniform mat4 modelview_matrix;
-ATTRIBUTE vec3 position;
+in vec3 position;
uniform vec3 center;
uniform float size;
-VARYING vec4 vary_fragcoord;
-VARYING vec3 trans_center;
+out vec4 vary_fragcoord;
+out vec3 trans_center;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
index 8043a78a82..dbf20fe2d8 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
@@ -23,15 +23,9 @@
* $/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 vec2 screen_res;
uniform mat4 projection_matrix;
@@ -39,8 +33,8 @@ uniform mat4 inv_proj;
uniform float zNear;
uniform float zFar;
-VARYING vec2 vary_fragcoord;
-VARYING vec3 camera_ray;
+in vec2 vary_fragcoord;
+in vec3 camera_ray;
uniform sampler2D specularRect;
uniform sampler2D diffuseRect;
@@ -67,10 +61,10 @@ void main()
vec3 n;
vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG()
vec3 pos = getPositionWithDepth(tc, getDepth(tc)).xyz;
- vec4 spec = texture2D(specularRect, tc);
+ vec4 spec = texture(specularRect, tc);
vec2 hitpixel;
- vec4 diffuse = texture2D(diffuseRect, tc);
+ vec4 diffuse = texture(diffuseRect, tc);
vec3 specCol = spec.rgb;
vec4 fcol = texture(diffuseMap, tc);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl
index b084094d4d..f7e7268cc3 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl
@@ -26,12 +26,12 @@
uniform mat4 projection_matrix;
uniform mat4 inv_proj;
-ATTRIBUTE vec3 position;
+in vec3 position;
uniform vec2 screen_res;
-VARYING vec2 vary_fragcoord;
-VARYING vec3 camera_ray;
+out vec2 vary_fragcoord;
+out vec3 camera_ray;
void main()
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index a8d61afeca..2f3efaa94a 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -23,19 +23,12 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_shader_texture_lod : enable
-
#define FLT_MAX 3.402823466e+38
#define REFMAP_COUNT 256
#define REF_SAMPLE_COUNT 64 //maximum number of samples to consider
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseRect;
uniform sampler2D specularRect;
@@ -60,7 +53,7 @@ uniform mat3 env_mat;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
uniform int sun_up_factor;
-VARYING vec2 vary_fragcoord;
+in vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
@@ -127,16 +120,16 @@ void main()
vec2 tc = vary_fragcoord.xy;
float depth = getDepth(tc.xy);
vec4 pos = getPositionWithDepth(tc, depth);
- vec4 norm = texture2D(normalMap, tc);
+ vec4 norm = texture(normalMap, tc);
float envIntensity = norm.z;
norm.xyz = getNorm(tc);
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
- vec4 baseColor = texture2D(diffuseRect, tc);
- vec4 spec = texture2D(specularRect, vary_fragcoord.xy); // NOTE: PBR linear Emissive
+ vec4 baseColor = texture(diffuseRect, tc);
+ vec4 spec = texture(specularRect, vary_fragcoord.xy); // NOTE: PBR linear Emissive
#if defined(HAS_SUN_SHADOW) || defined(HAS_SSAO)
- vec2 scol_ambocc = texture2D(lightMap, vary_fragcoord.xy).rg;
+ vec2 scol_ambocc = texture(lightMap, vary_fragcoord.xy).rg;
#endif
#if defined(HAS_SUN_SHADOW)
@@ -180,12 +173,12 @@ void main()
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 orm = texture2D(specularRect, tc).rgb;
+ vec3 orm = texture(specularRect, tc).rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
float ao = orm.r * ambocc;
- vec3 colorEmissive = texture2D(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
@@ -211,7 +204,7 @@ void main()
else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS))
{
//should only be true of WL sky, just port over base color value
- color = texture2D(emissiveRect, tc).rgb;
+ color = texture(emissiveRect, tc).rgb;
color = srgb_to_linear(color);
if (sun_up_factor > 0)
{
@@ -263,7 +256,7 @@ void main()
float gtdenom = 2 * nh;
float gt = max(0,(min(gtdenom * nv / vh, gtdenom * nl / vh)));
- scol *= fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
+ scol *= fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
color.rgb += lit*scol*sunlit_linear.rgb*spec.rgb;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index f2ab585716..1ea801d7d7 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -23,9 +23,6 @@
* $/LicenseInfo$
*/
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_shader_texture_lod : enable
-
/*[EXTRA_CODE_HERE]*/
#define DEBUG_ANY_LIGHT_TYPE 0 // Output green light cone
@@ -38,11 +35,7 @@
#define DEBUG_SPOT_NL 0 // monochome area effected by light
#define DEBUG_SPOT_ZERO 0 // Output zero for spotlight
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
uniform sampler2D diffuseRect;
uniform sampler2D specularRect;
@@ -75,8 +68,8 @@ uniform float size;
uniform vec3 color;
uniform float falloff;
-VARYING vec3 trans_center;
-VARYING vec4 vary_fragcoord;
+in vec3 trans_center;
+in vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -126,7 +119,7 @@ void main()
if (proj_shadow_idx >= 0)
{
- vec4 shd = texture2D(lightMap, tc);
+ vec4 shd = texture(lightMap, tc);
shadow = (proj_shadow_idx == 0) ? shd.b : shd.a;
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
@@ -147,15 +140,15 @@ void main()
float nh, nl, nv, vh, lightDist;
calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist);
- vec3 diffuse = texture2D(diffuseRect, tc).rgb;
- vec4 spec = texture2D(specularRect, tc);
+ vec3 diffuse = texture(diffuseRect, tc).rgb;
+ vec4 spec = texture(specularRect, tc);
vec3 dlit = vec3(0, 0, 0);
vec3 slit = vec3(0, 0, 0);
vec3 amb_rgb = vec3(0);
if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR))
{
- vec3 colorEmissive = texture2D(emissiveRect, tc).rgb;
+ vec3 colorEmissive = texture(emissiveRect, tc).rgb;
vec3 orm = spec.rgb;
float perceptualRoughness = orm.g;
float metallic = orm.b;
@@ -231,7 +224,7 @@ void main()
if (nh > 0.0)
{
- float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
+ float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl);
vec3 speccol = dlit*scol*spec.rgb*shadow;
speccol = clamp(speccol, vec3(0), vec3(1));
final_color += speccol;
diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
index 21c30012ab..e99ad5b474 100644
--- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
@@ -50,9 +50,9 @@ uniform float waterFogKS;
uniform vec2 screenRes;
//bigWave is (refCoord.w, view.w);
-VARYING vec4 refCoord;
-VARYING vec4 littleWave;
-VARYING vec4 view;
+in vec4 refCoord;
+in vec4 littleWave;
+in vec4 view;
in vec3 vary_position;
vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit);
@@ -62,9 +62,9 @@ void main()
vec4 color;
//get detail normals
- vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
- vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
- vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;
+ vec3 wave1 = texture(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
+ vec3 wave2 = texture(bumpMap, littleWave.xy).xyz*2.0-1.0;
+ vec3 wave3 = texture(bumpMap, littleWave.zw).xyz*2.0-1.0;
vec3 wavef = normalize(wave1+wave2+wave3);
//figure out distortion vector (ripply)
@@ -72,7 +72,7 @@ void main()
distort = distort+wavef.xy*refScale;
#ifdef TRANSPARENT_WATER
- vec4 fb = texture2D(screenTex, distort);
+ vec4 fb = texture(screenTex, distort);
#else
vec4 fb = vec4(waterFogColorLinear, 0.0);
#endif
diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
index 3d4f4fc17b..8fee259933 100644
--- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -99,9 +99,9 @@ uniform vec3 waterFogColorLinear;
//bigWave is (refCoord.w, view.w);
-VARYING vec4 refCoord;
-VARYING vec4 littleWave;
-VARYING vec4 view;
+in vec4 refCoord;
+in vec4 littleWave;
+in vec4 view;
in vec3 vary_position;
in vec3 vary_normal;
in vec3 vary_tangent;
@@ -144,12 +144,12 @@ void main()
//get wave normals
vec2 bigwave = vec2(refCoord.w, view.w);
vec3 wave1_a = texture(bumpMap, bigwave, -2 ).xyz*2.0-1.0;
- vec3 wave2_a = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
- vec3 wave3_a = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;
+ vec3 wave2_a = texture(bumpMap, littleWave.xy).xyz*2.0-1.0;
+ vec3 wave3_a = texture(bumpMap, littleWave.zw).xyz*2.0-1.0;
vec3 wave1_b = texture(bumpMap2, bigwave ).xyz*2.0-1.0;
- vec3 wave2_b = texture2D(bumpMap2, littleWave.xy).xyz*2.0-1.0;
- vec3 wave3_b = texture2D(bumpMap2, littleWave.zw).xyz*2.0-1.0;
+ vec3 wave2_b = texture(bumpMap2, littleWave.xy).xyz*2.0-1.0;
+ vec3 wave3_b = texture(bumpMap2, littleWave.zw).xyz*2.0-1.0;
//wave1_a = wave2_a = wave3_a = wave1_b = wave2_b = wave3_b = vec3(0,0,1);
@@ -210,16 +210,16 @@ void main()
vec3 sunlit_linear = srgb_to_linear(sunlit);
#ifdef TRANSPARENT_WATER
- vec4 fb = texture2D(screenTex, distort2);
- float depth = texture2D(screenDepth, distort2).r;
+ vec4 fb = texture(screenTex, distort2);
+ float depth = texture(screenDepth, distort2).r;
vec3 refPos = getPositionWithNDC(vec3(distort2*2.0-vec2(1.0), depth*2.0-1.0));
if (refPos.z > pos.z-0.05)
{
//we sampled an above water sample, don't distort
distort2 = distort;
- fb = texture2D(screenTex, distort2);
- depth = texture2D(screenDepth, distort2).r;
+ fb = texture(screenTex, distort2);
+ depth = texture(screenDepth, distort2).r;
refPos = getPositionWithNDC(vec3(distort2 * 2.0 - vec2(1.0), depth * 2.0 - 1.0));
}