varying float LightIntensity; varying vec3 MCposition; uniform vec3 LightPos; void main() { vec3 ECposition = vec3(gl_ModelViewMatrix * gl_Vertex); MCposition = gl_Vertex.xyz; vec3 tnorm = normalize(vec3 (gl_NormalMatrix * gl_Normal)); LightIntensity = abs( dot(normalize(LightPos - ECposition), tnorm) ); LightIntensity *= 1.5; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }