1 uniform mat4 envmap_matrix;
3 varying vec3 vdir, ldir[3], normal;
4 varying vec4 shadow_tc;
9 gl_Position = ftransform();
11 vec3 vpos = (gl_ModelViewMatrix * gl_Vertex).xyz;
12 normal = gl_NormalMatrix * gl_Normal;
14 wdir = (envmap_matrix * vec4(vdir, 1.0)).xyz; // bring back to world space
15 ldir[0] = gl_LightSource[0].position.xyz - vpos;
16 ldir[1] = gl_LightSource[1].position.xyz - vpos;
17 ldir[2] = gl_LightSource[2].position.xyz - vpos;
18 gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
20 mat4 offmat = mat4(0.5, 0.0, 0.0, 0.0,
24 mat4 tex_matrix = offmat * gl_TextureMatrix[1];
26 shadow_tc = tex_matrix * vec4(vpos, 1.0);