varying vec2 TexCoord;
varying vec4 pos;
varying vec4 EyeSpacePosition2;
varying vec4 EyeSpacePosition;

void main( void )
   {
   gl_Position = ftransform();
   pos         = ftransform();
   
   EyeSpacePosition2 = vec4(pos.xyz, 1) * gl_ModelViewMatrix;
   EyeSpacePosition = vec4
      (
      EyeSpacePosition2.x - gl_MultiTexCoord0.x - 0.5,
      EyeSpacePosition2.y - (1.0-gl_MultiTexCoord0.y) - 0.5,
      EyeSpacePosition2.z,
      EyeSpacePosition2.w
      );
      
   TexCoord = (gl_MultiTexCoord0.xy-0.5)*2.0;
   }