The ray has hit something — a sphere, a triangle, a floor. Knowing where it hit is
only half the story; to colour the pixel we need to know which way the surface
faces at that point. That arrow sticking straight out of the surface is the
Step 1 — the sphere normal points straight out from the centre. On a
sphere with centre
No cross products, no stored data — the geometry alone hands you the normal. (Its length is
always the radius
Step 2 — a flat triangle has one face normal. For a single triangle the
normal is the same everywhere on it: the face normal
Step 3 — for a smooth look, blend the vertex normals. To make a faceted mesh
look round, each vertex stores its own normal
Step 4 — renormalise after blending. A weighted sum of unit vectors is generally not unit length (it sags toward the inside of the bend), so we must restore it to length one before using it:
This single renormalised, interpolated normal is what turns a coarse polygon soup into a smoothly curved surface.
Step 5 — assemble the shading frame. Lighting needs three directions at the
hit: the surface normal
Face the light squarely (
Step 6 — flip the normal to face the ray if needed. A stored normal can point
the "wrong" way for the side you hit (you struck the back face, or you're inside the surface).
If the normal already agrees with the incoming ray direction
It's a common assumption that a "high-poly" mesh automatically looks smooth. It doesn't — not on its own. If every triangle is still shaded with its own single flat face normal (Step 2), the surface stays visibly faceted no matter how many triangles you throw at it: a sphere made of ten thousand tiny flat triangles, each lit uniformly, still shows every one of those facets, just smaller.
What actually produces the illusion of a smoothly curved surface is Steps 3–4: interpolating the vertex normals across each triangle's face (then renormalising) so the shading itself changes gradually from one edge of the triangle to the other, instead of jumping in one block. Two meshes can share the exact same vertices and triangles and look completely different depending only on which normal you feed the lighting model at each pixel — the flat face normal, or the interpolated one.
The choice of which normal you use at a hit is the entire difference between a faceted and a rounded surface — the geometry is identical.
Same vertices, same barycentric weights — only the question of what you interpolate (a face normal, a per-vertex brightness, or the normal itself) separates the three. The interpolated normal is where ray–triangle, barycentrics, and lighting all come together.