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