# Why Diffuse Light use max(N · H, 0) instead of just letting it be negative?

In Cg tuts, Diffuse Section

Surfaces that face away from the light will produce negative dot-product values, so the max(N · L, 0) in the equation ensures that these surfaces show no diffuse lighting.

My question is why not just leave it be negative? IMO, both the negative and zero will make the color be black.

If lighting with multiple lights, they add together to make the final lighting value. A negative light would darken other lights, which is incorrect. This is also true if you add in specular reflections, emissive lighting, or other sources of lighting. The negative lighting from one source of lighting would darken some other source of non negative lighting.

• If only one direction light is taken into account, no further processing such as half-lambert, is there any need to use the max func? Jan 7, 2019 at 7:54
• If your application does indeed not rely on this value not being negative (only a single light source, just rendering straight to a color target in a way that will lead to the output being clamped to black anyways, etc.) then, by all means, go ahead and skip the max() if it makes you feel better. But do so, knowing that this will merely produce a result indistinguishable from the correct result in the most narrow circumstances and incorrect results in any other case. Meanwhile, any useful explanation of how shading works will continue to present the formula that is correct in general… 😉 Jan 7, 2019 at 10:00
• @MichaelKenzel Actually, it will makes me feel better :) knowing it could be safely skipped. Because I am afraid there is sth beyond my knowledge happens under the hood. Thanks. Jan 7, 2019 at 11:46

Because negative shading values are undefined and don't play well with tonemapping. It is preferable to use values in $$[0,1]$$ for low-dynamic-range or $$[0,+\infty)$$ for high-dynamic-range images.

$$N \cdot L < 0$$ implies that the light is directed in the direction opposite the normal to the visible surface of the polygon. This means that the light is coming from behind and striking the back face of the polygon. In the analogous situation in real life, light striking one face of an opaque surface does not affect the illumination of a second face. Shining light on the back of a book (or other opaque object) does make the front of the book darker (that is it does not apply negative lighting): it simply has no effect on the front face of the book. This is the reason for the max() function.

Applying negative illumination to a surface where $$N \cdot L < 0$$ doesn't make sense physically. In geometric optics with incoherent light sources there is no such thing as negative illumination.