diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/avatar')
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; } |