summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl33
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl28
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl29
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl4
21 files changed, 155 insertions, 115 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 839606cdcb..4fffb9e97f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -27,6 +27,9 @@
#extension GL_ARB_texture_rectangle : enable
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
uniform sampler2DRectShadow shadowMap0;
uniform sampler2DRectShadow shadowMap1;
uniform sampler2DRectShadow shadowMap2;
@@ -41,11 +44,11 @@ uniform vec2 shadow_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;
uniform float shadow_bias;
@@ -122,9 +125,9 @@ void main()
}
}
- vec4 diff = diffuseLookup(gl_TexCoord[0].xy);
+ vec4 diff = diffuseLookup(vary_texcoord0.xy);
- vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a);
+ vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
@@ -133,7 +136,7 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
- //gl_FragColor = gl_Color;
+ //gl_FragColor = vertex_color;
gl_FragColor = color;
//gl_FragColor.r = 0.0;
//gl_FragColor = vec4(1,shadow,1,1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 84e49a5f8f..30aa82473a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -42,11 +42,13 @@ uniform vec2 shadow_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 float shadow_bias;
@@ -123,9 +125,9 @@ void main()
}
}
- vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy);
+ vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
- vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a);
+ vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
@@ -134,7 +136,7 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
- //gl_FragColor = gl_Color;
+ //gl_FragColor = vertex_color;
gl_FragColor = color;
//gl_FragColor.r = 0.0;
//gl_FragColor = vec4(1,shadow,1,1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 294a000ab5..9370b484b8 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/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$
*/
@@ -24,11 +42,12 @@ uniform vec2 shadow_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 float shadow_bias;
@@ -105,7 +124,7 @@ void main()
}
}
- vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy);
+ vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0);
vec4 color = diff * col;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index c3148d5fdf..ad353eb624 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -27,10 +27,10 @@ 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;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -42,11 +42,15 @@ 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_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;
+VARYING float fog_depth;
uniform float near_clip;
uniform float shadow_offset;
@@ -89,7 +93,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
mat4 mat = getObjectSkinnedTransform();
@@ -134,9 +138,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;
pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz;
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 8d55616e67..268e4127a2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/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,12 +43,15 @@ 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_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_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;
@@ -97,7 +100,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);
@@ -130,9 +133,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/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 0273f3c121..091a865160 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/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;
uniform float shadow_offset;
@@ -88,7 +91,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;
@@ -134,9 +137,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 = pos.xyz + vec3(0,0,near_clip);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
index d9eafb6eba..4fc6c00caf 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl
@@ -30,7 +30,7 @@
uniform sampler2DRect depthMap;
uniform sampler2DRect normalMap;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform float depth_cutoff;
uniform float norm_cutoff;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
index a84fdd5dc1..11a7cf846d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl
@@ -31,7 +31,7 @@
uniform sampler2DMS depthMap;
uniform sampler2DMS normalMap;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform float depth_cutoff;
uniform float norm_cutoff;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
index 1f5470db3c..69c6acc07a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.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/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 4c92d72f44..d1f2db6188 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -59,7 +59,7 @@ uniform float size;
uniform vec3 color;
uniform float falloff;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index 1afa9a9fb4..74f78cfc06 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -28,6 +28,8 @@
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_texture_multisample : enable
+VARYING vec4 vertex_color;
+
uniform sampler2DMS diffuseRect;
uniform sampler2DMS specularRect;
uniform sampler2DMS depthMap;
@@ -54,9 +56,9 @@ uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
-varying vec4 vary_light;
+VARYING vec4 vary_light;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -160,7 +162,7 @@ void main()
{
proj_tc.xyz /= proj_tc.w;
- float fa = gl_Color.a+1.0;
+ float fa = vertex_color.a+1.0;
float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
if (dist_atten > 0.0)
{
@@ -189,7 +191,7 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
- vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+ vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
lit = da * dist_atten * noise;
@@ -206,7 +208,7 @@ void main()
amb_da = min(amb_da, 1.0-lit);
- col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
@@ -239,7 +241,7 @@ void main()
stc.y > 0.0)
{
vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
- col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+ col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 22f52032a5..e9f1a3d3a5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -67,7 +67,7 @@ uniform vec2 screen_res;
uniform vec3 sun_dir;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
vec3 vary_PositionEye;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 1244294451..6b979b13ed 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -66,8 +66,8 @@ uniform mat3 ssao_effect_mat;
uniform mat4 inv_proj;
uniform vec2 screen_res;
-varying vec4 vary_light;
-varying vec2 vary_fragcoord;
+VARYING vec4 vary_light;
+VARYING vec2 vary_fragcoord;
vec3 vary_PositionEye;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index 424299269f..c840d72784 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/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()
{
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 25270f4939..19a1d1f165 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -27,6 +27,8 @@
#extension GL_ARB_texture_rectangle : enable
+VARYING vec4 vertex_color;
+
uniform sampler2DRect diffuseRect;
uniform sampler2DRect specularRect;
uniform sampler2DRect depthMap;
@@ -53,9 +55,9 @@ uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
-varying vec4 vary_light;
+VARYING vec4 vary_light;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -114,7 +116,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
- float fa = gl_Color.a+1.0;
+ float fa = vertex_color.a+1.0;
float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
lv = proj_origin-pos.xyz;
@@ -140,7 +142,7 @@ void main()
vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod);
- vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+ vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
lit = da * dist_atten * noise;
@@ -163,7 +165,7 @@ void main()
amb_da = min(amb_da, 1.0-lit);
- col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
@@ -192,7 +194,7 @@ void main()
stc.y > 0.0)
{
vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
- col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+ col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 4962e73e39..85fea56411 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -28,6 +28,8 @@
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_texture_multisample : enable
+VARYING vec4 vertex_color;
+
uniform sampler2DMS diffuseRect;
uniform sampler2DMS specularRect;
uniform sampler2DMS depthMap;
@@ -54,9 +56,9 @@ uniform float sun_wash;
uniform int proj_shadow_idx;
uniform float shadow_fade;
-varying vec4 vary_light;
+VARYING vec4 vary_light;
-varying vec4 vary_fragcoord;
+VARYING vec4 vary_fragcoord;
uniform vec2 screen_res;
uniform mat4 inv_proj;
@@ -161,7 +163,7 @@ void main()
{
proj_tc.xyz /= proj_tc.w;
- float fa = gl_Color.a+1.0;
+ float fa = vertex_color.a+1.0;
float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
if (dist_atten > 0.0)
{
@@ -190,7 +192,7 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
- vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a;
+ vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a;
lit = da * dist_atten * noise;
@@ -207,7 +209,7 @@ void main()
amb_da = min(amb_da, 1.0-lit);
- col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
}
@@ -240,7 +242,7 @@ void main()
stc.y > 0.0)
{
vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod);
- col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow;
+ col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 146fac56e9..bb742adb62 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -47,7 +47,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;
@@ -97,15 +97,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
stc.xyz /= stc.w;
stc.z += spot_shadow_bias*scl;
- float cs = shadow2D(shadowMap, stc.xyz).x;
+ float cs = shadow2D(shadowMap, stc.xyz);
float shadow = cs;
vec2 off = 1.5/proj_shadow_res;
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
index ac4fe52655..4933eb00b7 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl
@@ -48,8 +48,8 @@ uniform float ssao_max_radius;
uniform float ssao_factor;
uniform float ssao_factor_inv;
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vary_light;
uniform mat4 inv_proj;
uniform vec2 screen_res;
@@ -98,15 +98,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
stc.xyz /= stc.w;
stc.z += spot_shadow_bias*scl;
- float cs = shadow2D(shadowMap, stc.xyz).x;
+ float cs = shadow2D(shadowMap, stc.xyz);
float shadow = cs;
vec2 off = 1.5/proj_shadow_res;
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 60741771d6..042bb5f96c 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -46,7 +46,7 @@ uniform float ssao_max_radius;
uniform float ssao_factor;
uniform float ssao_factor_inv;
-varying vec2 vary_fragcoord;
+VARYING vec2 vary_fragcoord;
uniform vec3 sun_dir;
uniform mat4 inv_proj;
@@ -148,15 +148,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
stc.xyz /= stc.w;
stc.z += spot_shadow_bias*scl;
- float cs = shadow2D(shadowMap, stc.xyz).x;
+ float cs = shadow2D(shadowMap, stc.xyz);
float shadow = cs;
vec2 off = 1.5/proj_shadow_res;
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
index 0fd7b7525d..e138ae5841 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl
@@ -47,8 +47,8 @@ uniform float ssao_max_radius;
uniform float ssao_factor;
uniform float ssao_factor_inv;
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+VARYING vec2 vary_fragcoord;
+VARYING vec4 vary_light;
uniform mat4 inv_proj;
uniform vec2 screen_res;
@@ -149,15 +149,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
stc.xyz /= stc.w;
stc.z += spot_shadow_bias*scl;
- float cs = shadow2D(shadowMap, stc.xyz).x;
+ float cs = shadow2D(shadowMap, stc.xyz);
float shadow = cs;
vec2 off = 1.5/proj_shadow_res;
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
return shadow/5.0;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 60ba2d7ad4..bc5eb5181d 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/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;