# Blinn-Phong specular light bleeding on triangles facing-away from light: what is the canonical solution?

In our implementation of the empirical Blinn-Phong shading model, we are facing a problem with light-bleeding of the specular component.

The model defines the half-vector $$\vec{h} = \frac{\vec{v} + \vec{l}}{||\vec{v} + \vec{l}||}$$, with:

• $$\vec{v}$$ the unit view vector
• $$\vec{l}$$ the unit light vector (defined from surface-point to light-source).

and the specular component is proportional to $${(\vec{n} \cdot \vec{h})^+}^p$$ (with $$p$$ as Phong exponent)

## Specular light bleeding situation

Light bleeding occurs in certain configurations when the light vector $$\vec{l}$$ is facing away from the surface (i.e. >90° angle from the normal $$\vec{n}$$).

Such a configuration is illustrated by the diagram below:

Here, we can see that although the light should not contribute to the surface lighting, the computed half-vector is close to the normal, and thus an important specular contribution will be added by the model.

We followed implementation advices from Fundamental of Computer Graphics and Real-Time Rendering, but we missed any mention of this potential problem:

• Are we misunderstanding how to implement this shading model?
• Or is this an inherent issue, and what would be the canonical approach to address it?

Edit bonus question:

• What tools to draw geometric diagrams would you recommend?
• I changed my comment to an answer Commented Jun 11 at 11:45

• Sadly, this can lead to an abrupt cut-off of the specular contribution between adjacent polygons where the change of ndotl sign occurs, which is very noticeable on smooth surfaces. Maybe some sort of windowing function might be used on ndotl and the result used as the operand in place of (float)ndotl to smooth things out.