Surface normals

Level UniversityDifficulty ★★★★★Application⌖ Open in the map

What is it?

The unit vector perpendicular to a surface at a point. For an implicit surface F=0F = 0 it is ∇F/∥∇F∥\nabla F/\norm{\nabla F}; for a parametric one r(u,v)r(u,v), the normalized cross product ru×rvr_u \times r_v. Every lighting computation starts from it.

Why does it exist?

Light reflects depending on the angle between the incoming ray and the surface. That angle is measured against the normal — and the normal is a derivative: the gradient points across level sets, so it is perpendicular to the surface F=0F = 0.

Formulas

n=∇F∥∇F∥,n=ru×rv∥ru×rv∥n = \frac{\nabla F}{\norm{\nabla F}}, \qquad n = \frac{r_u \times r_v}{\norm{r_u \times r_v}}
z=h(x,y)  ⟹  n∝(−hx, −hy, 1)z = h(x, y) \implies n \propto \big(-h_x,\ -h_y,\ 1\big)
height fields and bump maps

Example

Sphere F=x2+y2+z2−R2F = x^2 + y^2 + z^2 - R^2: ∇F=2(x,y,z)\nabla F = 2(x, y, z), so the normal at a point is the point itself divided by RR — radial, as expected. A bump map perturbs hh with a texture and recomputes nn from its partial derivatives: flat geometry that looks rough.

Why does it matter?

Wrong normals are the most visible rendering bug; normal maps are how games show detail without millions of triangles.

The mathematics behind it

  • Gradient★★★★★fundamental

    The normal of an implicit surface F=0F = 0 is ∇F/∥∇F∥\nabla F/\norm{\nabla F}.

  • Surfaces and level sets★★★★★fundamental

    Normals of parametric surfaces come from ru×rvr_u \times r_v; of implicit ones from ∇F\nabla F.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

↑ ↓ to navigate · ↵ · Esc