summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl33
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl29
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl35
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl24
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl17
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/giF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/giV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl26
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowF.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowV.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainV.glsl34
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/debugV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl24
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/uiF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/uiV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/bumpF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/bumpV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/previewV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/treeV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl2
137 files changed, 923 insertions, 552 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index dca96910f2..bc63d07d72 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;
+ATTRIBUTE 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 c98b99b15a..cf939e2df8 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -25,9 +25,13 @@
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -35,7 +39,7 @@ void calcAtmospherics(vec3 inPositionEye);
void main()
{
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
@@ -55,12 +59,12 @@ void main()
gl_Position = projection_matrix * pos;
- gl_FogFragCoord = length(pos.xyz);
+ fog_depth = length(pos.xyz);
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
- gl_FrontColor = color;
+ vertex_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index 9a19fb928b..82db15c3ae 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -28,10 +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;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -41,7 +44,7 @@ void main()
//transform vertex
vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz;
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 norm = normalize(normal_matrix * normal);
@@ -50,7 +53,7 @@ void main()
vec4 specular = vec4(1.0);
vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
- gl_FrontColor = color;
+ vertex_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 6fef303723..43ed41a205 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -24,7 +24,7 @@
-attribute vec4 weight4;
+ATTRIBUTE vec4 weight4;
uniform mat4 matrixPalette[32];
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
index 374808c091..a64f6ea55c 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl
@@ -23,11 +23,12 @@
* $/LicenseInfo$
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
void main()
{
- gl_FragColor = vec4(gl_Color.rgb, texture2D(diffuseMap, gl_TexCoord[0].xy).a);
+ gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
index 21a9e91bf5..78b5328c9a 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
@@ -25,9 +25,12 @@
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
mat4 getSkinnedTransform();
@@ -41,7 +44,7 @@ void main()
pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- gl_FrontColor = diffuse_color;
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vertex_color = diffuse_color;
+ vary_texcoord0 = texcoord0;
gl_Position = projection_matrix * pos;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 19de0c0b39..23142a3516 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -38,11 +38,14 @@ uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform mat4 inv_proj;
@@ -66,9 +69,9 @@ void main()
vec4 pos = vec4(vary_position, 1.0);
- vec4 diff= diffuseLookup(gl_TexCoord[0].xy);
+ vec4 diff= diffuseLookup(vary_texcoord0.xy);
- vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
+ vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
index d4f56896cf..332bc9c262 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl
@@ -38,11 +38,13 @@ uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
uniform mat4 inv_proj;
@@ -66,9 +68,9 @@ void main()
vec4 pos = vec4(vary_position, 1.0);
- vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
+ vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
- vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
+ vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
index 5d1306bfc9..e8a2318f39 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl
@@ -1,7 +1,25 @@
/**
* @file alphaNonIndexedNoColorF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, 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$
*/
@@ -19,11 +37,12 @@ uniform vec2 screen_res;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
+VARYING vec2 vary_texcoord0;
uniform mat4 inv_proj;
@@ -47,7 +66,7 @@ void main()
vec4 pos = vec4(vary_position, 1.0);
- vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
+ vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy);
vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0);
vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 9d2c009d2a..e5899872db 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -25,10 +25,10 @@
uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getObjectSkinnedTransform();
@@ -41,12 +41,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying vec3 vary_position;
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_normal;
-varying vec3 vary_fragcoord;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_normal;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
uniform float near_clip;
@@ -87,7 +90,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
@@ -130,9 +133,9 @@ void main()
col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
- gl_FrontColor = col;
+ vertex_color = col;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 490ac7c067..9920caf7f6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -28,10 +28,10 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec4 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -43,13 +43,16 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_light;
-varying vec3 vary_pointlight_col;
-varying float vary_texture_index;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_light;
+VARYING vec3 vary_pointlight_col;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
uniform float near_clip;
uniform float shadow_offset;
@@ -98,7 +101,7 @@ void main()
vec4 pos = (modelview_matrix * vert);
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 norm = normalize(normal_matrix * normal);
@@ -132,9 +135,9 @@ void main()
col.rgb = col.rgb*diffuse_color.rgb;
- gl_FrontColor = col;
+ vertex_color = col;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
pos = modelview_projection_matrix * vert;
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
index 0c930848e5..40fa59b637 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl
@@ -26,10 +26,12 @@
uniform sampler2D diffuseMap;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
+ //gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
gl_FragColor = vec4(1,1,1,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index fc055e555d..533babf3dc 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -26,23 +26,26 @@ uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
uniform mat4 texture_matrix0;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
mat = modelview_matrix * mat;
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
vec4 p = projection_matrix * vec4(pos, 1.0);
p.z = max(p.z, -p.w+0.01);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 16f2b889f8..12e88ca5dd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -25,9 +25,9 @@
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -41,11 +41,14 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying vec3 vary_position;
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_position;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_pointlight_col;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
uniform float near_clip;
@@ -86,7 +89,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
@@ -132,9 +135,9 @@ void main()
col.rgb = min(col.rgb, 1.0);
- gl_FrontColor = col;
+ vertex_color = col;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index d5c20a22d9..01ffb862f7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -27,20 +27,22 @@ 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 vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_normal = normalize(normal_matrix * normal);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
index a006b81ef7..b1fc9da855 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl
@@ -27,11 +27,12 @@
uniform sampler2D diffuseMap;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec4 diff = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy);
if (diff.a < 0.2)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
index ba3cc82b39..c9386062c6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl
@@ -27,7 +27,7 @@
uniform sampler2D diffuseMap;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index 6835b9c021..525acbe4ea 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -27,15 +27,16 @@ uniform mat4 projection_matrix;
mat4 getSkinnedTransform();
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
void main()
{
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 704845d310..1bd8fee7c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -25,19 +25,20 @@
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
mat4 getSkinnedTransform();
-attribute vec4 weight;
+ATTRIBUTE vec4 weight;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
void main()
{
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
vec4 pos;
vec3 norm;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 3609cc054b..e0a25b505a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -37,7 +37,7 @@ uniform vec2 delta;
uniform vec3 kern[4];
uniform float kern_scale;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 5339e38018..212f7e56ad 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec2 vary_fragcoord;
+VARYING 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 429a891f07..379420a8a0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl
@@ -28,22 +28,25 @@
uniform sampler2D diffuseMap;
uniform sampler2D bumpMap;
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb;
- vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0;
+ vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
+ vec3 norm = texture2D(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0;
vec3 tnorm = vec3(dot(norm,vary_mat0),
dot(norm,vary_mat1),
dot(norm,vary_mat2));
gl_FragData[0] = vec4(col, 0.0);
- gl_FragData[1] = gl_Color.aaaa; // spec
- //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+ gl_FragData[1] = vertex_color.aaaa; // spec
+ //gl_FragData[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
vec3 nvn = normalize(tnorm);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index cf93430217..6c205074b4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -26,21 +26,23 @@ uniform mat4 projection_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
-attribute vec2 texcoord2;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord2;
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -58,5 +60,5 @@ void main()
vary_mat2 = vec3(t.z, b.z, n.z);
gl_Position = projection_matrix*vec4(pos, 1.0);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index 9ec31383ac..c8d38bb8f7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -27,21 +27,23 @@ 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 vec3 binormal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 binormal;
-varying vec3 vary_mat0;
-varying vec3 vary_mat1;
-varying vec3 vary_mat2;
+VARYING vec3 vary_mat0;
+VARYING vec3 vary_mat1;
+VARYING vec3 vary_mat2;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 n = normalize(normal_matrix * normal);
vec3 b = normalize(normal_matrix * binormal);
@@ -51,5 +53,5 @@ void main()
vary_mat1 = vec3(t.y, b.y, n.y);
vary_mat2 = vec3(t.z, b.z, n.z);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index f4310dae95..127136a12c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -29,15 +29,20 @@
// The fragment shader for the sky
/////////////////////////////////////////////////////////////////////////
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
uniform sampler2D cloud_noise_texture;
uniform vec4 cloud_pos_density1;
uniform vec4 cloud_pos_density2;
uniform vec4 gamma;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
/// Soft clips the light with a gamma correction
vec3 scaleSoftClip(vec3 light) {
//soft clip effect:
@@ -50,14 +55,14 @@ vec3 scaleSoftClip(vec3 light) {
void main()
{
// Set variables
- vec2 uv1 = gl_TexCoord[0].xy;
- vec2 uv2 = gl_TexCoord[1].xy;
+ vec2 uv1 = vary_texcoord0.xy;
+ vec2 uv2 = vary_texcoord1.xy;
vec4 cloudColorSun = vary_CloudColorSun;
vec4 cloudColorAmbient = vary_CloudColorAmbient;
float cloudDensity = vary_CloudDensity;
- vec2 uv3 = gl_TexCoord[2].xy;
- vec2 uv4 = gl_TexCoord[3].xy;
+ vec2 uv3 = vary_texcoord2.xy;
+ vec2 uv4 = vary_texcoord3.xy;
// Offset texture coords
uv1 += cloud_pos_density1.xy; //large texture, visible density
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 67b5e7fb83..64e094e3c5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -25,17 +25,22 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
//////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
///////////////////////////////////////////////////////////////////////////////
// Output parameters
-varying vec4 vary_CloudColorSun;
-varying vec4 vary_CloudColorAmbient;
-varying float vary_CloudDensity;
+VARYING vec4 vary_CloudColorSun;
+VARYING vec4 vary_CloudColorAmbient;
+VARYING float vary_CloudDensity;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
// Inputs
uniform vec3 camPosLocal;
@@ -64,7 +69,7 @@ void main()
// World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
// Get relative position
vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
@@ -163,17 +168,17 @@ void main()
// Texture coords
- gl_TexCoord[0] = vec4(texcoord0,0,1);
- gl_TexCoord[0].xy -= 0.5;
- gl_TexCoord[0].xy /= cloud_scale.x;
- gl_TexCoord[0].xy += 0.5;
+ vary_texcoord0 = texcoord0;
+ vary_texcoord0.xy -= 0.5;
+ vary_texcoord0.xy /= cloud_scale.x;
+ vary_texcoord0.xy += 0.5;
- gl_TexCoord[1] = gl_TexCoord[0];
- gl_TexCoord[1].x += lightnorm.x * 0.0125;
- gl_TexCoord[1].y += lightnorm.z * 0.0125;
+ vary_texcoord1 = vary_texcoord0;
+ vary_texcoord1.x += lightnorm.x * 0.0125;
+ vary_texcoord1.y += lightnorm.z * 0.0125;
- gl_TexCoord[2] = gl_TexCoord[0] * 16.;
- gl_TexCoord[3] = gl_TexCoord[1] * 16.;
+ vary_texcoord2 = vary_texcoord0 * 16.;
+ vary_texcoord3 = vary_texcoord1 * 16.;
// Combine these to minimize register use
vary_CloudColorAmbient += oHazeColorBelowCloud;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
index e1dc1de0af..51d67d2790 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl
@@ -29,11 +29,13 @@ uniform float maximum_alpha;
uniform sampler2D diffuseMap;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
+ vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
if (col.a < minimum_alpha || col.a > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
index f3ad6f92de..8868d33705 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl
@@ -23,14 +23,17 @@
* $/LicenseInfo$
*/
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
uniform float minimum_alpha;
uniform float maximum_alpha;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
+ vec4 col = diffuseLookup(vary_texcoord0.xy) * vertex_color;
if (col.a < minimum_alpha || col.a > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
index dfc1b52c2e..2f46d43b9d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl
@@ -1,7 +1,25 @@
/**
* @file diffuseAlphaMaskNoColorF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, 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$
*/
@@ -11,11 +29,12 @@ uniform float maximum_alpha;
uniform sampler2D diffuseMap;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha || col.a > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
index 9c9a8b56c5..aaf89a22ef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl
@@ -27,14 +27,16 @@
uniform sampler2D diffuseMap;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb;
+ vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
- gl_FragData[1] = gl_Color.aaaa; // spec
- //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+ gl_FragData[1] = vertex_color.aaaa; // spec
+ //gl_FragData[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
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
index 4d996a099d..e08e52c7cf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl
@@ -23,15 +23,17 @@
* $/LicenseInfo$
*/
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- vec3 col = gl_Color.rgb * diffuseLookup(gl_TexCoord[0].xy).rgb;
+ vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
- gl_FragData[1] = gl_Color.aaaa; // spec
- //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
+ gl_FragData[1] = vertex_color.aaaa; // spec
+ //gl_FragData[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
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index 37864578ec..7ed41cbcb9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -27,18 +27,19 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
-varying vec3 vary_normal;
-varying float vary_texture_index;
+VARYING vec3 vary_normal;
+VARYING float vary_texture_index;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_normal = normalize(normal_matrix * normal);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 880a7ea0a2..a74290bfcd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -26,18 +26,20 @@ uniform mat4 projection_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -51,7 +53,7 @@ void main()
vary_normal = norm.xyz;
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
gl_Position = projection_matrix*vec4(pos, 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index e158df13f7..36000b86d6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -27,22 +27,24 @@ uniform mat3 normal_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec4 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
-varying vec3 vary_normal;
-varying float vary_texture_index;
+VARYING vec3 vary_normal;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_texture_index = position.w;
vary_normal = normalize(normal_matrix * normal);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index 5a9a6196f3..6cf563189a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -1,7 +1,25 @@
/**
* @file emissiveF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, 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$
*/
@@ -12,12 +30,14 @@
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
float shadow = 1.0;
- vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
+ vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
color.rgb = fullbrightAtmosTransport(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index fccf8554d2..b3558be678 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -27,9 +27,9 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec4 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
@@ -38,7 +38,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
void main()
{
@@ -49,11 +52,11 @@ void main()
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
- gl_FrontColor = vec4(0,0,0,emissive);
+ vertex_color = vec4(0,0,0,emissive);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 6c506676af..f54827f720 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -27,6 +27,9 @@
#extension GL_ARB_texture_rectangle : enable
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -35,7 +38,7 @@ void main()
{
float shadow = 1.0;
- vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
+ vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
color.rgb = fullbrightAtmosTransport(color.rgb);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 2759165471..ef9f62da84 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -28,9 +28,9 @@ uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec4 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
@@ -39,7 +39,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
vec3 scaleDownLight(vec3 light);
vec3 scaleUpLight(vec3 light);
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
void main()
{
@@ -50,11 +53,11 @@ void main()
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
index bfb7760af8..72c5a93087 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl
@@ -38,7 +38,7 @@ uniform sampler2D depthGIMap;
uniform sampler2D lightFunc;
// Inputs
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index 2766691bd0..e5d3bb8ea6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -25,12 +25,12 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
-
-varying vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -44,5 +44,5 @@ void main()
vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index 7152e13946..e98f9aef87 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -31,9 +31,11 @@ uniform sampler2D diffuseMap;
uniform sampler2D normalMap;
uniform sampler2D specularMap;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha || col.a > maximum_alpha)
{
@@ -41,6 +43,6 @@ void main()
}
gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
- gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
- gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0);
+ gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy);
+ gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 645b0d793a..58e5dc0b56 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -26,15 +26,18 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
index 4ba26fb0c6..4f13167c1c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl
@@ -27,7 +27,7 @@
uniform sampler2DRect diffuseMap;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
index dafc55a6ff..f2dc60aa5d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -25,10 +25,11 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vertex_color;
uniform vec2 screen_res;
@@ -40,5 +41,5 @@ void main()
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 42212a978e..279a2fa78d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -45,7 +45,7 @@ uniform int light_count;
uniform vec4 light[MAX_LIGHT_COUNT];
uniform vec4 light_col[MAX_LIGHT_COUNT];
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform float far_z;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 1d54d7bede..eefefa640d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index c42935d815..dff6360726 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -60,7 +60,7 @@ uniform vec3 color;
uniform float falloff;
uniform float size;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
index 8c34a554c2..0fc23fecb4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl
@@ -43,7 +43,7 @@ uniform vec3 color;
uniform float falloff;
uniform float size;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index cab9817583..cb14e6d4e8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index daef6a938c..64044590c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -2096,8 +2096,8 @@ uniform float magnification;
uniform mat4 inv_proj;
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
float getDepth(vec2 pos_screen)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
index f67615bdd5..16b61897d5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl
@@ -2083,8 +2083,8 @@ uniform vec2 rcp_screen_res;
uniform vec4 rcp_frame_opt;
uniform vec4 rcp_frame_opt2;
uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
index b519dbc4b0..a1986fca9a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFNoFXAAF.glsl
@@ -29,7 +29,7 @@ uniform sampler2DRect diffuseRect;
uniform sampler2D bloomMap;
uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
index 861bb9f735..84c23c97a0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoFXAAF.glsl
@@ -41,7 +41,7 @@ uniform float magnification;
uniform mat4 inv_proj;
uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
float getDepth(vec2 pos_screen)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index b11f26fbae..8edf5b2723 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -25,10 +25,10 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec2 vary_fragcoord;
-varying vec2 vary_tc;
+VARYING vec2 vary_fragcoord;
+VARYING vec2 vary_tc;
uniform vec2 tc_scale;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 99257daca4..a172f49d87 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -38,7 +38,7 @@ uniform int kern_length;
uniform float kern_scale;
uniform vec3 blur_quad;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index 61c6393648..0d5c8e7287 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -25,10 +25,10 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
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 615317febf..c63a627971 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -28,11 +28,13 @@ uniform float maximum_alpha;
uniform sampler2D diffuseMap;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
- float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a;
+ float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a;
if (alpha < minimum_alpha || alpha > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index f7bed00214..6a3cba771b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -26,11 +26,13 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
@@ -41,6 +43,6 @@ void main()
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_FrontColor = diffuse_color;
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
index 541f08d5fe..ee0ea84e6f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl
@@ -25,7 +25,7 @@
-varying vec4 post_pos;
+VARYING vec4 post_pos;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
index 190cac9e2c..8b46e81f90 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 59c0a994cd..26c7165e06 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -29,7 +29,7 @@
// The fragment shader for the sky
/////////////////////////////////////////////////////////////////////////
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
uniform sampler2D cloud_noise_texture;
uniform vec4 gamma;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index e97d3e0828..721de18e0b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -25,15 +25,16 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
// SKY ////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
///////////////////////////////////////////////////////////////////////////////
// Output parameters
-varying vec4 vary_HazeColor;
+VARYING vec4 vary_HazeColor;
+VARYING vec2 vary_texcoord0;
// Inputs
uniform vec3 camPosLocal;
@@ -61,7 +62,7 @@ void main()
// World / view / projection
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
// Get relative position
vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 8116b7cdbf..fa1d2cc7a7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -64,7 +64,7 @@ uniform vec3 env_mat[3];
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
vec3 vary_PositionEye;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 7d1e99b4aa..c6031fc45a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -25,11 +25,11 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
uniform vec2 screen_res;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
void main()
{
//transform vertex
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index e69fa074c4..20970fc4ba 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -54,7 +54,7 @@ uniform vec3 color;
uniform float falloff;
uniform float size;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 4ab59d4d66..8eb4be7177 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -23,13 +23,14 @@
* $/LicenseInfo$
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
void main()
{
- vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragData[0] = col;
gl_FragData[1] = vec4(0,0,0,0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index 1fcb05ef2c..8bc5b06379 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -26,14 +26,17 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_FrontColor = diffuse_color;
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
index 4a69192fc3..797648202d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl
@@ -41,7 +41,7 @@ uniform float ssao_max_radius;
uniform float ssao_factor;
uniform float ssao_factor_inv;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index 10751304ae..473d6df8fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
index c6578ea177..effa994a48 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl
@@ -31,20 +31,22 @@ uniform sampler2D detail_2;
uniform sampler2D detail_3;
uniform sampler2D alpha_ramp;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
void main()
{
/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
- vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy);
- vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy);
- vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy);
- vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy);
+ 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);
- float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a;
- float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a;
- float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a;
+ 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;
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
gl_FragData[0] = vec4(outColor.rgb, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 7f84ef1cff..5effee4e4e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -27,13 +27,19 @@ 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;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+
+uniform vec4 object_plane_s;
+uniform vec4 object_plane_t;
vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
{
@@ -57,11 +63,11 @@ void main()
vary_normal = normalize(normal_matrix * normal);
// Transform and pass tex coords
- gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ vary_texcoord0.xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;
vec4 t = vec4(texcoord1,0,1);
- gl_TexCoord[0].zw = t.xy;
- gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
- gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0);
+ vary_texcoord0.zw = t.xy;
+ vary_texcoord1.xy = t.xy-vec2(2.0, 0.0);
+ vary_texcoord1.zw = t.xy-vec2(1.0, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
index a6406bdc12..b0ef348cd1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl
@@ -27,20 +27,22 @@
uniform sampler2D diffuseMap;
-varying vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec3 vary_normal;
+VARYING vec2 vary_texcoord0;
uniform float minimum_alpha;
uniform float maximum_alpha;
void main()
{
- vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 col = texture2D(diffuseMap, vary_texcoord0.xy);
if (col.a < minimum_alpha || col.a > maximum_alpha)
{
discard;
}
- gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, 0.0);
+ gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
index 9f0b902c96..22ebaa9be6 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl
@@ -1,7 +1,25 @@
/**
* @file treeShadowF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, 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$
*/
@@ -10,11 +28,12 @@ uniform float maximum_alpha;
uniform sampler2D diffuseMap;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
void main()
{
- float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a;
+ float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a;
if (alpha < minimum_alpha || alpha > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
index c695d374ac..e472a75304 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
@@ -26,10 +26,11 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
-varying vec4 post_pos;
+VARYING vec4 post_pos;
+VARYING vec2 vary_texcoord0;
void main()
{
@@ -40,5 +41,5 @@ void main()
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 45bfc0ce09..3b6571a24a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -27,19 +27,21 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
uniform mat3 normal_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
-varying vec3 vary_normal;
+VARYING vec3 vary_normal;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_normal = normalize(normal_matrix * normal);
- gl_FrontColor = vec4(1,1,1,1);
+ vertex_color = vec4(1,1,1,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index c3e7371c8e..d10548cbef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -58,10 +58,10 @@ uniform vec2 screen_res;
uniform mat4 norm_mat; //region space to screen space
//bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
-varying vec4 vary_position;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
+VARYING vec4 vary_position;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
index ac51cb1741..9734acf005 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -26,7 +26,7 @@
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
void calcAtmospherics(vec3 inPositionEye);
@@ -37,11 +37,11 @@ uniform float time;
uniform vec3 eyeVec;
uniform float waterHeight;
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
-varying vec4 vary_position;
+VARYING vec4 vary_position;
float wave(vec2 v, float t, float f, vec2 d, float s)
{
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index c5ca9f4804..a34e76d25a 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -34,9 +34,11 @@ uniform vec3 lumWeights;
uniform vec3 warmthWeights;
uniform float warmthAmount;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy);
+ vec4 col = texture2DRect(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/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
index c2cc8ed567..cbf4dc4bea 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
@@ -35,9 +35,11 @@ uniform vec3 lumWeights;
uniform vec3 warmthWeights;
uniform float warmthAmount;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- ivec2 itc = ivec2(gl_TexCoord[0].xy);
+ ivec2 itc = ivec2(vary_texcoord0.xy);
vec4 fcol = vec4(0,0,0,0);
for (int i = 0; i < samples; i++)
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index 628489296f..1396dc6973 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -25,13 +25,14 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = texcoord0;
+ vary_texcoord0.xy = texcoord0;
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 75cff75ea9..3d17a20fbb 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -28,6 +28,11 @@
uniform sampler2D diffuseMap;
uniform float glowStrength;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
void main()
{
@@ -38,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, gl_TexCoord[0].xy);
- col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy);
- col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy);
- col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy);
- col += kern[4] * texture2D(diffuseMap, gl_TexCoord[0].zw);
- col += kern[5] * texture2D(diffuseMap, gl_TexCoord[1].zw);
- col += kern[6] * texture2D(diffuseMap, gl_TexCoord[2].zw);
- col += kern[7] * texture2D(diffuseMap, gl_TexCoord[3].zw);
+ 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);
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index 615ca6a0b4..cdb2281578 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -25,21 +25,26 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
uniform vec2 glowDelta;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
void main()
{
gl_Position = modelview_projection_matrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5);
- gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5);
- gl_TexCoord[2].xy = texcoord0 + glowDelta*(-1.5);
- gl_TexCoord[3].xy = texcoord0 + glowDelta*(-0.5);
- gl_TexCoord[0].zw = texcoord0 + glowDelta*(0.5);
- gl_TexCoord[1].zw = texcoord0 + glowDelta*(1.5);
- gl_TexCoord[2].zw = texcoord0 + glowDelta*(2.5);
- gl_TexCoord[3].zw = texcoord0 + glowDelta*(3.5);
+ vary_texcoord0.xy = texcoord0 + glowDelta*(-3.5);
+ vary_texcoord1.xy = texcoord0 + glowDelta*(-2.5);
+ vary_texcoord2.xy = texcoord0 + glowDelta*(-1.5);
+ vary_texcoord3.xy = texcoord0 + glowDelta*(-0.5);
+ vary_texcoord0.zw = texcoord0 + glowDelta*(0.5);
+ vary_texcoord1.zw = texcoord0 + glowDelta*(1.5);
+ vary_texcoord2.zw = texcoord0 + glowDelta*(2.5);
+ vary_texcoord3.zw = texcoord0 + glowDelta*(3.5);
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
index c61d5a2a08..5d72390d2d 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl
@@ -29,13 +29,18 @@ uniform sampler2D detail0;
uniform sampler2D detail1;
uniform sampler2D alphaRamp;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
void main()
{
- float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a;
- vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb,
- texture2D(detail0, gl_TexCoord[0].xy).rgb,
+ float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
+ vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
+ texture2D(detail0, vary_texcoord0.xy).rgb,
a);
gl_FragColor.rgb = color;
- gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a;
+ gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 04b3033dd8..d4a62db684 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -31,14 +31,22 @@ uniform mat4 texture_matrix3;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
-attribute vec2 texcoord2;
-attribute vec2 texcoord3;
+uniform vec4 object_plane_t;
+uniform vec4 object_plane_s;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+ATTRIBUTE vec2 texcoord2;
+ATTRIBUTE vec2 texcoord3;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -61,15 +69,15 @@ void main()
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vec4 pos = modelview_matrix * position;
+ vec4 pos = modelview_matrix * vec4(position, 1.0);
vec3 norm = normalize(normal_matrix * normal);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
- gl_FrontColor = color;
+ vertex_color = color;
- gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
- gl_TexCoord[1] = texture_matrix1*vec4(texcoord1,0,1);
- gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
- gl_TexCoord[3] = texture_matrix3*vec4(texcoord3,0,1);
+ vary_texcoord0 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,object_plane_s,object_plane_t).xy;
+ vary_texcoord1 = (texture_matrix1*vec4(texcoord1,0,1)).xy;
+ vary_texcoord2 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,object_plane_s,object_plane_t).xy;
+ vary_texcoord3 = (texture_matrix3*vec4(texcoord3,0,1)).xy;
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
index 711b42b95e..307b87e086 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl
@@ -31,13 +31,18 @@ uniform sampler2D detail0;
uniform sampler2D detail1;
uniform sampler2D alphaRamp;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+VARYING vec2 vary_texcoord2;
+VARYING vec2 vary_texcoord3;
+
void main()
{
- float a = texture2D(alphaRamp, gl_TexCoord[1].xy).a;
- vec3 color = mix(texture2D(detail1, gl_TexCoord[2].xy).rgb,
- texture2D(detail0, gl_TexCoord[0].xy).rgb,
+ float a = texture2D(alphaRamp, vary_texcoord1.xy).a;
+ vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb,
+ texture2D(detail0, vary_texcoord0.xy).rgb,
a);
gl_FragColor.rgb = color;
- gl_FragColor.a = texture2D(alphaRamp, gl_TexCoord[3].xy).a;
+ gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).a;
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
index 72e8e739b3..48eea0bdda 100644
--- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
@@ -33,9 +33,9 @@ uniform float refScale;
uniform vec4 waterFogColor;
//bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index 4d555b566a..1bb04ceb34 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -50,9 +50,9 @@ uniform float blurMultiplier;
uniform vec4 fogCol;
//bigWave is (refCoord.w, view.w);
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index d44690d1fb..e4db326bed 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -24,15 +24,16 @@
*/
+VARYING float fog_depth;
vec4 applyWaterFog(vec4 color)
{
// GL_EXP2 Fog
- //float fog = exp(-gl_Fog.density * gl_Fog.density * gl_FogFragCoord * gl_FogFragCoord);
+ //float fog = exp(-gl_Fog.density * gl_Fog.density * fog_depth * fog_depth);
// GL_EXP Fog
- // float fog = exp(-gl_Fog.density * gl_FogFragCoord);
+ // float fog = exp(-gl_Fog.density * fog_depth);
// GL_LINEAR Fog
- float fog = (gl_Fog.end - gl_FogFragCoord) * gl_Fog.scale;
+ float fog = (gl_Fog.end - fog_depth) * gl_Fog.scale;
fog = clamp(fog, 0.0, 1.0);
color.rgb = mix(gl_Fog.color.rgb, color.rgb, fog);
return color;
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index 99433ada7b..f66ba1d2d9 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -26,7 +26,7 @@
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
void calcAtmospherics(vec3 inPositionEye);
@@ -36,9 +36,9 @@ uniform float time;
uniform vec3 eyeVec;
uniform float waterHeight;
-varying vec4 refCoord;
-varying vec4 littleWave;
-varying vec4 view;
+VARYING vec4 refCoord;
+VARYING vec4 littleWave;
+VARYING vec4 view;
float wave(vec2 v, float t, float f, vec2 d, float s)
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
index 27c63fdc8b..66f3e1ae11 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl
@@ -27,9 +27,12 @@ uniform sampler2D diffuseMap;
uniform float custom_alpha;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
color.a *= custom_alpha;
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
index 5bbc7deff0..890474d6d8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
@@ -25,15 +25,17 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
- gl_FrontColor = diffuse_color;
+ vary_texcoord0 = texcoord0;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl
index cd3d090e52..f4d704577a 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;
+ATTRIBUTE vec3 position;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
index b8963e1dec..caff5fc324 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl
@@ -28,8 +28,11 @@
uniform sampler2D glowMap;
uniform sampler2DRect screenMap;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
void main()
{
- gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) +
- texture2DRect(screenMap, gl_TexCoord[1].xy);
+ gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) +
+ texture2DRect(screenMap, vary_texcoord1.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
index 6639f88047..3e972f0cb4 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl
@@ -1,7 +1,25 @@
/**
* @file glowcombineFXAAF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, 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$
*/
@@ -11,7 +29,7 @@ uniform sampler2D glowMap;
uniform sampler2DRect screenMap;
uniform vec2 screen_res;
-varying vec2 vary_tc;
+VARYING vec2 vary_tc;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
index bd5dd6046b..058f3b1b82 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl
@@ -25,9 +25,9 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
+ATTRIBUTE vec3 position;
-varying vec2 vary_tc;
+VARYING vec2 vary_tc;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index 94edbe5ab1..f7970b7f78 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -25,14 +25,17 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
- gl_TexCoord[1] = vec4(texcoord1,0,1);
+ vary_texcoord0 = texcoord0;
+ vary_texcoord1 = texcoord1;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index 3a48205101..1d37b97bf1 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -27,7 +27,9 @@
uniform vec4 color;
uniform sampler2D diffuseMap;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- gl_FragColor = color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index 6bb5affd93..9bf7b60eb7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -26,13 +26,15 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index 43dcd5dbe2..c26fa08ddc 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;
+ATTRIBUTE vec3 position;
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
index a5442c9bf4..d860106305 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl
@@ -1,13 +1,33 @@
/**
* @file onetexturenocolorF.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2005, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
uniform sampler2D tex0;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy);
+ gl_FragColor = texture2D(tex0, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
index 615412c7a2..6b9986c8d7 100644
--- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl
@@ -25,13 +25,14 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position, 1);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vary_texcoord0 = texcoord0;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
index b1d2b949ac..a25c9a08fb 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl
@@ -25,9 +25,12 @@
uniform sampler2D tex0;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a;
+ float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a;
- gl_FragColor = vec4(gl_Color.rgb, alpha);
+ gl_FragColor = vec4(vertex_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 45e6a9febc..c58f9dfdaf 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -25,14 +25,17 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_FrontColor = diffuse_color;
- gl_TexCoord[0] = vec4(texcoord0,0,1);
+ vertex_color = diffuse_color;
+ vary_texcoord0 = texcoord0;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
index c263f4dc6a..9a295ce9f2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl
@@ -27,7 +27,10 @@
uniform sampler2DRect screenMap;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- gl_FragColor = texture2DRect(screenMap, gl_TexCoord[0].xy) * gl_Color;
+ gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
index 2b471d99e8..641d670c26 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -25,14 +25,17 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec4 diffuse_color;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec4 diffuse_color;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
- gl_FrontColor = diffuse_color;
+ vary_texcoord0 = texcoord0;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
index 3408cc44f8..3ded949943 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl
@@ -26,7 +26,10 @@
uniform sampler2D tex0;
uniform sampler2D tex1;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
void main()
{
- gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy);
+ gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
index 2a36feaa21..3c2f297f7f 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
@@ -25,14 +25,17 @@
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = vec4(texcoord0,0,1);
- gl_TexCoord[1] = vec4(texcoord1,0,1);
+ vary_texcoord0 = texcoord0;
+ vary_texcoord1 = texcoord1;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
index 7694056b08..2602e489c8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl
@@ -25,7 +25,10 @@
uniform sampler2D diffuseMap;
+VARYING vec2 vary_texcoord0;
+VARYING vec4 vertex_color;
+
void main()
{
- gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = vertex_color*texture2D(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 a9e42a432f..220dafef25 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -26,15 +26,17 @@
uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position, 1);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_FrontColor = diffuse_color;
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
index 5cb3eb05a7..0a687d7a33 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl
@@ -23,13 +23,14 @@
* $/LicenseInfo$
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
void default_lighting()
{
- vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
index f3ba8b73a8..7ba6e9dec9 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
@@ -28,8 +28,10 @@
uniform sampler2D diffuseMap;
+VARYING vec2 vary_texcoord0;
+
void fullbright_lighting()
{
- gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
index b4c8a9abce..00c08d59ef 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
@@ -29,7 +29,9 @@
uniform sampler2D diffuseMap;
uniform samplerCube environmentMap;
+VARYING vec2 vary_texcoord0;
+
void fullbright_shiny_lighting()
{
- gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
index 925d6fbcfd..2140b2f612 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl
@@ -28,7 +28,9 @@
uniform sampler2D diffuseMap;
uniform samplerCube environmentMap;
+VARYING vec2 vary_texcoord0;
+
void fullbright_shiny_lighting_water()
{
- gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
index 71238f7d31..ab6b561f08 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl
@@ -28,8 +28,10 @@
uniform sampler2D diffuseMap;
+VARYING vec2 vary_texcoord0;
+
void fullbright_lighting_water()
{
- gl_FragColor = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
index 7c9b7c218f..183582e41f 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl
@@ -24,14 +24,15 @@
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
uniform samplerCube environmentMap;
void shiny_lighting()
{
- vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
index ca1af8fc79..9c9f7ca658 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl
@@ -24,14 +24,15 @@
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
uniform samplerCube environmentMap;
void shiny_lighting_water()
{
- vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
index da76a977b6..1a041c26ca 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl
@@ -23,13 +23,14 @@
* $/LicenseInfo$
*/
-
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
uniform sampler2D diffuseMap;
void default_lighting_water()
{
- vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
index 11031a8829..53c0e77b48 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl
@@ -26,10 +26,13 @@
uniform sampler2D texture0;
uniform sampler2D texture1;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
+
void main()
{
- float tex0 = texture2D(texture0, gl_TexCoord[0].xy).a;
- float tex1 = texture2D(texture1, gl_TexCoord[1].xy).a;
+ float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
+ float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index dccc692593..09ec6ff792 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -27,14 +27,17 @@ uniform mat4 texture_matrix0;
uniform mat4 texture_matrix1;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec2 texcoord1;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_TexCoord[1] = texture_matrix1 * vec4(texcoord1,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vary_texcoord1 = (texture_matrix1 * vec4(texcoord1,0,1)).xy;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
index e2a00e8440..bf4c45f18f 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveSkinnedV.glsl
@@ -27,9 +27,13 @@ uniform mat4 projection_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
mat4 getObjectSkinnedTransform();
@@ -37,7 +41,7 @@ mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -46,9 +50,9 @@ void main()
calcAtmospherics(pos.xyz);
- gl_FrontColor = vec4(0,0,0,emissive);
+ vertex_color = vec4(0,0,0,emissive);
gl_Position = projection_matrix*vec4(pos, 1.0);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
index dedf00f374..0e05beac67 100644
--- a/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/emissiveV.glsl
@@ -27,25 +27,29 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec4 position;
-attribute float emissive;
-attribute vec2 texcoord0;
+ATTRIBUTE vec4 position;
+ATTRIBUTE float emissive;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
void calcAtmospherics(vec3 inPositionEye);
-varying float vary_texture_index;
+VARYING float vary_texture_index;
+VARYING float fog_depth;
void main()
{
//transform vertex
vary_texture_index = position.w;
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
calcAtmospherics(pos.xyz);
- gl_FrontColor = vec4(0,0,0,emissive);
+ vertex_color = vec4(0,0,0,emissive);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
index b9c1078c30..f73760bfd4 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightNoColorV.glsl
@@ -27,9 +27,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
@@ -39,11 +43,11 @@ void main()
vec4 vert = vec4(position.xyz,1.0);
vec4 pos = (modelview_matrix * vert);
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
- gl_FrontColor = vec4(1,1,1,1);
+ vertex_color = vec4(1,1,1,1);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index 546b7cad4a..69cd858b4d 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -27,10 +27,15 @@ uniform mat4 texture_matrix1;
uniform mat4 modelview_matrix;
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
mat4 getObjectSkinnedTransform();
@@ -49,14 +54,14 @@ void main()
vec3 ref = reflect(pos.xyz, -norm.xyz);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
gl_Position = projection_matrix*vec4(pos, 1.0);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index a9b086e215..a8e640018d 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -29,10 +29,15 @@ uniform mat4 texture_matrix1;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
@@ -46,13 +51,13 @@ void main()
vec3 norm = normalize(normal_matrix * normal);
vec3 ref = reflect(pos.xyz, -norm);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index f0722a1e4d..4de24fd46b 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -26,17 +26,21 @@ uniform mat4 projection_matrix;
uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
mat4 getObjectSkinnedTransform();
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
+
void main()
{
//transform vertex
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -45,9 +49,9 @@ void main()
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
gl_Position = projection_matrix*vec4(pos, 1.0);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index d8f223d403..7286e5e2f4 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -27,9 +27,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
@@ -38,13 +42,13 @@ void main()
//transform vertex
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
index d09db8e6a3..e5bf5bf2d3 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -28,9 +28,11 @@ uniform float maximum_alpha;
uniform sampler2D diffuseMap;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy);
+ vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
if (color.a < minimum_alpha || color.a > maximum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
index 69007610c6..e90dbb115a 100644
--- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -27,12 +27,14 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_texcoord0;
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
index 3771c2e795..282686a9b0 100644
--- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl
@@ -28,9 +28,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -40,14 +44,14 @@ void main()
//transform vertex
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 norm = normalize(normal_matrix * normal);
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index 7e5c8ca2d5..591d6fc5c9 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -27,10 +27,14 @@ uniform mat4 texture_matrix0;
uniform mat4 texture_matrix1;
uniform mat4 modelview_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING vec3 vary_texcoord1;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -50,13 +54,13 @@ void main()
vec3 ref = reflect(pos.xyz, -norm.xyz);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz;
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
gl_Position = projection_matrix*vec4(pos, 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index da47f8a58a..86a78b190c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec3 vary_texcoord0;
+VARYING float fog_depth;
void calcAtmospherics(vec3 inPositionEye);
@@ -47,12 +51,12 @@ void main()
calcAtmospherics(pos.xyz);
- gl_FrontColor = diffuse_color;
+ vertex_color = diffuse_color;
vec3 ref = reflect(pos.xyz, -norm);
- gl_TexCoord[0] = texture_matrix0*vec4(ref,1.0);
+ vary_texcoord0 = (texture_matrix0*vec4(ref,1.0)).xyz;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index d1d8126cb4..45a493e4f2 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -28,9 +28,13 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -40,14 +44,14 @@ void main()
//transform vertex
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 norm = normalize(normal_matrix * normal);
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index bf083a55c4..aea0e25e60 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -26,10 +26,14 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -38,7 +42,7 @@ mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -53,9 +57,9 @@ void main()
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
gl_Position = projection_matrix*vec4(pos, 1.0);
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index 87ece3972e..4b6b219751 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -28,10 +28,14 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 diffuse_color;
-attribute vec2 texcoord0;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec3 normal;
+ATTRIBUTE vec4 diffuse_color;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -41,14 +45,14 @@ void main()
//transform vertex
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vec3 norm = normalize(normal_matrix * normal);
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
index 64ca63731b..250d99a9c7 100644
--- a/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/treeV.glsl
@@ -28,20 +28,24 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
-attribute vec3 position;
-attribute vec2 texcoord0;
-attribute vec3 normal;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec3 normal;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+VARYING float fog_depth;
+
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz,1.0);
gl_Position = modelview_projection_matrix*vert;
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy;
vec4 pos = (modelview_matrix * vert);
@@ -50,7 +54,7 @@ void main()
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
- gl_FrontColor = color;
+ vertex_color = color;
- gl_FogFragCoord = pos.z;
+ fog_depth = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
index dbacf28637..2e41360150 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl
@@ -25,7 +25,7 @@
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
vec3 getPositionEye()
{
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
index e051ac9851..42f8646f2d 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl
@@ -25,7 +25,7 @@
-varying vec3 vary_PositionEye;
+VARYING vec3 vary_PositionEye;
vec3 getPositionEye()