summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/avatar
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-09-16 12:40:53 -0500
committerDave Parks <davep@lindenlab.com>2011-09-16 12:40:53 -0500
commitda84f5552731e1ece3a463c4c385bb327f1048a1 (patch)
treedc10fc228a15b69f8b62631a68dbc67efe1f3395 /indra/newview/app_settings/shaders/class1/avatar
parent4fea7dcb3ef35cae9e31ba467403d31ce9083905 (diff)
SH-2243 work in progress -- don't use deprecated shader state
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/avatar')
-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
6 files changed, 32 insertions, 21 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;
}