diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-06-06 23:21:07 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-06-06 23:21:07 -0400 |
commit | 89ea7ccfc7fd4c33eab4ad9123141fa40231a00d (patch) | |
tree | af2083dc9563abc8fa7a97100fc7766044d406e8 /indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl | |
parent | 3d1cb7ef111cbd5724262077702e0dc2a3d6998d (diff) | |
parent | a519e34f02b4b2663fe082ba9ad12f1b423669cb (diff) |
Automated merge with file:///Users/nat/linden/viewer-maint-1144
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl index fc19a73709..5effee4e4e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl @@ -22,10 +22,24 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; -varying vec3 vary_normal; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +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) { @@ -44,16 +58,16 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_normal = normalize(gl_NormalMatrix * gl_Normal); + vary_normal = normalize(normal_matrix * normal); // Transform and pass tex coords - gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], 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 = gl_MultiTexCoord1; + 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); } |