//varying vec3 normal;
//varying vec4 color;

varying vec3 NormalOut;
varying vec3 VertexToLight;
varying vec4 ColorOut;
varying vec3 PosOut;
varying vec3 ModelViewPos;

#vertexshader



void main()
{
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
	NormalOut = gl_NormalMatrix * gl_Normal;
	
	ColorOut = gl_Color;
	PosOut = gl_Position.xyz;
	
	ModelViewPos = (gl_ModelViewMatrix * gl_Vertex).xyz;
	VertexToLight = (gl_ModelViewMatrix * vec4(100.0,100.0,100.0,1.0)).xyz - ModelViewPos;
	gl_TexCoord[0] = gl_MultiTexCoord0;
}

#fragmentshader

uniform sampler2D texture;

void main()
{
	vec3 LightPos = vec3(100.0,100.0,100.0);
	vec3 LightDir = VertexToLight;
	
	vec2 TexCoord = gl_TexCoord[0].xy;
	vec3 Col = texture2D(texture, TexCoord).xyz;
	gl_FragColor.xyz = Col * ColorOut.xyz;
	gl_FragColor.w = 1.0;
}
