**Introduction**

**nearest point**on the area light to the vertex.

**Problem**

**nearest point**and do not account for other points on the lights surface that could be illuminating the fragment even more so. Let me try and explain why…

**nearest point**on the area light where the surface and the light intersect. Since the surface normal and the vertex-to-light vectors are always perpendicular, the dot product between them is zero. Subsequently, the calculation of the diffuse contribution is zero despite there being a large area of light looming over the surface.

**Potential Solution**

**nearest point**on the area light, we calculate it from a point on the area light that yields the greatest dot product between the vertex-to-light vector (normalised) and the vertex normal. In the diagram above, this would be the purple dot, rather than the blue dot.

**Help!**

**casting point**on the area light – represented by the red dots, so that I can perform the dot product between the vertex-to-casting-point (normalised) and the vertex normal. Again, this should yield the maximum possible contribution value.

**Interactive Demo**

**line 317**.

**castingPoint.location**is an instance of

**THREE.Vector3**and is the missing piece of the puzzle. You should also notice that there are 2 values at the lower left of the sketch – these are dynamically updated to display the dot product between the relevant vectors.