uniform mat4 tmpMat; //cancels out the effect of the VIEW matrix (so only MODEL matrix remains active) ==> all in all transform the vertex to WORLDSPACE

varying vec4 shadow_tex_coord;

void main() 
{
  vec4 eyeVertex = gl_ModelViewMatrix * gl_Vertex;
  shadow_tex_coord = gl_TextureMatrix[2] * tmpMat * eyeVertex;

 //  shadow_tex_coord = gl_TextureMatrix[2] * gl_Vertex;



  gl_FrontColor = gl_Color;
  //  gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0);

  //gl_Position = ftransform();
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

  //  gl_ClipVertex = gl_ModelViewMatrix * transformed_vertex;

  //  gl_Position += (-.5+texture2D(noiseMap, tc.xy*vec2(16.0/texW, 16.0/texH)))*vec4(.5, .5, .5, 1.0);
  //  gl_Position = ftransform();

  
}
