How does Blinn-Phong's half vector replace Phong's reflection vector, and what does the specular exponent do to the highlight?
answer
- mirror direction versus a bisector
- halfway between light and viewer
- the angle roughly halves
- exponent sets width, not peak
basics
~20 sPhong compares the view direction with the light mirrored about the normal; Blinn-Phong compares the normal with H = normalize(L + V). Both raise that cosine to an exponent: higher exponents give smaller, tighter highlights with the same peak.
solid answer
~50 sPhong's specular term is `max(0, dot(r, v))^s`, where `r = 2 * dot(n, l) * n - l` mirrors the light direction about the normal and `v` points toward the viewer. Blinn-Phong uses `max(0, dot(n, h))^s` instead, with the half vector `h = normalize(l + v)`; `h` lines up with `n` exactly when the viewer sits in the mirror direction. The angle between `n` and `h` is about half the angle between `r` and `v` (exactly half when all vectors lie in one plane), so Blinn-Phong needs roughly four times the exponent for a similar highlight. The exponent controls width only: in this classic model the peak stays at 1, so a tighter highlight is not brighter. Blinn-Phong also avoids Phong's truncated lobe when `dot(r, v)` turns negative at grazing angles, and its highlights stretch at grazing angles much as real surfaces do.
code
pseudocode · 11 linesfunction shadeBlinnPhong(p, nIn, eyePos, light, kd, ks, s):
n = normalize(nIn) // interpolated normals arrive shorter than 1
l = normalize(light.position - p) // surface toward light
v = normalize(eyePos - p) // surface toward viewer
nDotL = max(0, dot(n, l))
diffuse = kd * nDotL
specular = 0
if nDotL > 0: // no highlight where the light cannot reach
h = normalize(l + v)
specular = ks * max(0, dot(n, h)) ^ s
return light.colour * (diffuse + specular)go deeper
Know both specular formulas, what the half vector bisects, and that a higher exponent gives a smaller, sharper highlight.
Derive why the Blinn angle is about half the Phong angle and the factor of four, and explain the truncated Phong lobe and the dot(N, L) gate.
Diagnose highlight bugs from symptoms: a highlight on the unlit side, a dimmed highlight from unnormalised vectors, or a material that changed look when the model was swapped.
Judge when a classic model is still the right fit, such as stylised or low-end targets, and when its missing energy normalisation makes materials impossible to author consistently.
## Phong's reflection vector The **specular term** models a glossy surface reflecting a blurred image of the light. Perfect mirrors send light from direction `l` only along the mirror direction `r`; glossy surfaces spread it around `r`. Phong's model measures how close the view direction `v` is to that mirror direction: - `r = 2 * dot(n, l) * n - l`, the light direction reflected about the unit normal `n` (all vectors unit length, `l` and `v` pointing away from the surface). - `specular = ks * max(0, dot(r, v))^s`, where `ks` is the specular colour and `s` the **specular exponent** or shininess. ## Blinn's half vector, derived Blinn asked a different question: which surface orientation would reflect the light straight into the eye? A mirror sends `l` to `v` when its normal bisects them, so that ideal normal is the **half vector** `h = normalize(l + v)`. The closer the real normal `n` is to `h`, the more light reaches the viewer: - `specular = ks * max(0, dot(n, h))^s` Place everything in one plane and measure signed angles from `n`: the light at `+a`, the viewer at `-b`. The mirror direction sits at `-a`, so the angle between `r` and `v` is `|a - b|`. The half vector bisects `l` and `v`, so it sits at `(a - b) / 2`, an angle of `|a - b| / 2` from `n`. In plane, the Blinn angle is **exactly half** the Phong angle; out of plane it is close to half but not exact. That halving fixes the exponent conversion. For small angles `cos(x)^s` behaves like `exp(-s * x^2 / 2)`. Halve the angle and `cos(x / 2)^s'` behaves like `exp(-s' * x^2 / 8)`. The two match when `s' = 4s`, so a Blinn-Phong exponent about **four times** the Phong exponent gives a highlight of similar size. ## The exponent sets size, not brightness | Exponent `s` | Highlight | Reads as | |---|---|---| | low (about 5-10) | broad, soft | satin, rough plastic | | medium (about 30-60) | defined spot | polished plastic, paint | | high (several hundred) | small, sharp | lacquer, wet surfaces | These ranges are illustrative for Blinn-Phong; Phong needs about a quarter of each. The peak value of `max(0, cos)^s` is always 1, so in this classic, unnormalised model a smaller highlight is **not** brighter. Real glossy surfaces concentrate the same reflected energy into a smaller lobe, so their peak rises; physically based models add a normalisation factor for that, which is a separate subject. ## Why Blinn-Phong became the default 1. **No truncated lobe.** `dot(r, v)` goes negative once `r` and `v` are more than 90 degrees apart, which happens at grazing light and view angles even on lit surfaces. The clamp then cuts the lobe off, visible as a hard-edged highlight with low exponents. While `l` and `v` are both above the surface, `h` stays within 90 degrees of `n`, so the Blinn lobe is never cut this way. 2. **Better grazing behaviour.** At grazing angles the Blinn highlight stretches into an elongated streak, much like highlights on real floors and roads; Phong's stays rounder. 3. **Historic cost.** For a directional light and a distant viewer, `h` is constant per light, which once mattered; many fixed-function pipelines used the half vector. On current GPUs the cost difference is negligible, so the choice is about the look. ## Traps - **Highlights on the unlit side.** With `l` just below the surface and `v` above it, `h` can still be above the surface, so `dot(n, h)` is positive and a faint highlight appears where the light cannot reach. Gate specular with `dot(n, l) > 0`, or multiply it by the clamped Lambert term. - **Unnormalised vectors.** `l + v` must be normalised, and an interpolated normal must be renormalised, or `dot(n, h)` shrinks and the exponent magnifies the error. - **Comparing exponents across models.** Swapping Phong for Blinn-Phong with the same `s` makes the highlight larger and softer; artists' values need converting. - The half vector bisects **light and view**, not the normal and the light. A strong answer writes both formulas, derives the halved angle and the factor of four, states that the exponent sets width with a fixed peak in this model, and names the gating trap.
- Why does a Blinn-Phong exponent need to be about four times a Phong exponent for a similar highlight?The angle between `n` and `h` is about half the angle between `r` and `v`. For small angles `cos(x)^s` behaves like `exp(-s * x^2 / 2)`; with the angle halved, `cos(x / 2)^s'` behaves like `exp(-s' * x^2 / 8)`. Matching the two gives `s' = 4s`. The factor is approximate: exact halving holds only when the vectors share a plane, and the small-angle form only near the peak.
- Why can Blinn-Phong show a highlight on a face the light cannot reach, and how do you stop it?When the light is just below a surface's horizon and the viewer above it, the half vector can still point above the surface, so `dot(n, h)` stays positive and the specular term lights a face whose Lambert term is zero. Gate the specular term on `dot(n, l) > 0`, or multiply it by the clamped Lambert factor so it fades out at the terminator.
- Why does raising the exponent not make the highlight brighter in this model?`max(0, cos)^s` peaks at 1 whatever `s` is, so the exponent only narrows the lobe. A real glossy surface puts the same reflected energy into a smaller cone, so its peak rises as the highlight shrinks. Physically based models add a normalisation factor that grows with the exponent to reproduce that; the classic model leaves it to the artist's specular colour.
- Phong and Blinn-Phong give the same highlight for the same exponent.
- The half vector bisects the surface normal and the light direction.
- Raising the exponent makes the classic highlight both smaller and brighter.
- Specular needs no dot(N, L) gate because dot(N, H) already rejects back-facing light.
- Blinn-Phong is preferred today mainly because it is cheaper than Phong.