nuclear@18: varying vec3 vdir, ldir, normal; nuclear@18: varying vec4 shadow_tc; nuclear@18: nuclear@18: void main() nuclear@18: { nuclear@18: gl_Position = ftransform(); nuclear@18: nuclear@18: vec3 vpos = (gl_ModelViewMatrix * gl_Vertex).xyz; nuclear@18: normal = gl_NormalMatrix * gl_Normal; nuclear@18: vdir = -vpos; nuclear@18: ldir = gl_LightSource[0].position.xyz - vpos; nuclear@18: gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; nuclear@18: nuclear@18: mat4 offmat = mat4(0.5, 0.0, 0.0, 0.0, nuclear@18: 0.0, 0.5, 0.0, 0.0, nuclear@18: 0.0, 0.0, 0.5, 0.0, nuclear@18: 0.5, 0.5, 0.5, 1.0); nuclear@18: mat4 tex_matrix = offmat * gl_TextureMatrix[1]; nuclear@18: nuclear@19: shadow_tc = tex_matrix * vec4(vpos, 1.0); nuclear@18: }