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