 
 
 
 
 
 
 
  
The diffuse term needs to take into account whether light falls directly on the vertex, the diffuse color of the light, and the diffuse material property:
 
 
where:
 is the unit vector that points from the vertex to the light position (GL_ POSITION).
 is the unit vector that points from the vertex to the light position (GL_ POSITION). 
 is the unit normal vector at the vertex.
 is the unit normal vector at the vertex.