#ifdef BUMP

varying vec3		N, V, L, V_M;
varying vec4		glVertex;
varying vec2		glTexCoord0;

varying	vec2    texCoordTransformed;
varying vec4		shadowMapTexCoord;
uniform mat4		T;


void main(void)
{
	vec4 p = gl_ModelViewMatrix * gl_Vertex;
	
	V = normalize(-p.xyz);
	L = normalize(gl_LightSource[0].position.xyz - p.xyz);
	N = normalize(gl_NormalMatrix * gl_Normal);

	glTexCoord0 = gl_MultiTexCoord0.st;
	glVertex = gl_Vertex;
 
	V_M = normalize(-gl_NormalMatrix*gl_ModelViewMatrix[3].xyz - glVertex.xyz);

  shadowMapTexCoord = T * p;
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
	gl_TexCoord[0] = gl_MultiTexCoord0;
}

#else

varying vec3		N, V, L;
varying vec4		shadowMapTexCoord;

uniform mat4		T;

void main(void)
{
	vec4 p = gl_ModelViewMatrix * gl_Vertex;
	
	V = normalize(-p.xyz);
	L = normalize(gl_LightSource[0].position.xyz - p.xyz);
	N = normalize(gl_NormalMatrix * gl_Normal);

	shadowMapTexCoord = T * p;

	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
	gl_TexCoord[0] = gl_MultiTexCoord0;
}

#endif
