Basic Lighting Models

Now that we understand the fundamentals, let us build up the lighting models used in practice. These models are all approximations of the rendering equation, designed to be computationally efficient while producing visually convincing results.

Ambient Lighting

Ambient lighting is the simplest component and serves as a baseline illumination that prevents any surface from being completely black.

The concept:

In the real world, light bounces off surfaces many times (indirect illumination / global illumination). This means even surfaces that do not receive direct light still get some illumination from light bouncing around the environment. Computing this accurately is expensive, so the ambient term is a cheap approximation.

The formula:

Iambient=kaIa

Where:

  • ka = ambient reflection coefficient (material property, 0 to 1)
  • Ia​ = ambient light intensity (scene-level constant)

Key characteristics:

  • It is a constant — it does not depend on surface orientation, light position, or viewer position.
  • It makes every surface uniformly lit by a small amount.
  • It is physically incorrect but practically essential.
  • Without it, shadowed regions would be pitch black, which looks unrealistic.

Limitations:

  • It produces flat, lifeless images if used alone.
  • It does not account for occlusion (corners should be darker than open areas, but ambient light treats them equally).
  • Modern techniques like Ambient Occlusion (AO) and Screen-Space Ambient Occlusion (SSAO) add sophistication by darkening areas where indirect light would be harder to reach.

Enhanced Ambient Models:

TechniqueDescription
Hemisphere AmbientUses two colors (sky color from above, ground color from below) blended based on the normal direction
Spherical Harmonics AmbientRepresents low-frequency lighting environment using spherical harmonics basis functions
SSAOScreen-space technique that estimates occlusion by sampling neighboring depth values
HBAO / GTAOMore advanced ambient occlusion techniques with better quality

Diffuse Reflection (Lambertian Reflection)

Diffuse reflection is the component that gives objects their fundamental color and shape-from-shading cues. It models light that penetrates slightly into a surface, scatters around inside the material, and exits in random directions.

The Lambertian Model:

Johann Heinrich Lambert (1760) observed that a perfectly matte surface appears equally bright from all viewing angles, and its brightness depends only on the angle between the incoming light and the surface normal.

Idiffuse=kdILmax(0,L^N^)

Where:

  • kd​ = diffuse reflection coefficient (material color, 0 to 1, can be a color vector)
  • IL​ = intensity of the light source
  • L^ = unit vector from the surface point toward the light source
  • N^ = unit surface normal at the point
  • L^N^ = cosine of the angle between light direction and normal (dot product)
  • max(0,...) = clamped to zero — if the surface faces away from the light, there is no diffuse contribution

Understanding L^N^:

This is the critical term. Let us understand it intuitively:

  • When light hits the surface head-on (perpendicular): L^N^=cos(0°)=1.0L^⋅N^=cos(0°)=1.0 → Maximum brightness
  • At 45 degrees: L^N^=cos(45°)0.707 → 70.7% brightness
  • At grazing angle (nearly parallel): L^N^=cos(90°)=0.0 = 0.0 → No light
  • Behind the surface: L^N^<0 → Clamped to 0 (no negative light)

Why does the angle matter? Physically:

When light hits a surface at an angle, the same amount of light energy is spread over a larger area. Imagine shining a flashlight directly at a wall (bright, concentrated circle) versus at an extreme angle (dim, stretched ellipse). The cosine law captures this geometric spreading.

With distance attenuation:

For point lights, we add attenuation:

Idiffuse=kdILd2max(0,L^N^)

Where dd is the distance from the light source to the surface point. In practice, a linear or quadratic falloff function is often used:

att(d)=1kc+kld+kqd2

Where kc​, kl​, kq are constant, linear, and quadratic attenuation factors.

Characteristics of Lambertian surfaces:

  • Equally bright from all viewing directions (matte/chalk-like appearance)
  • No specular highlights
  • The color is determined by kd (the wavelengths the surface reflects)
  • Examples: chalk, unpolished wood, flat wall paint, paper

Specular Reflection

Specular reflection models the shiny highlights seen on glossy or shiny surfaces. Unlike diffuse reflection, specular reflection depends on the viewer's position as you move around a shiny object, the highlight moves.

The Physics:

When light hits a smooth surface, some of it reflects in the mirror direction — the angle of incidence equals the angle of reflection. If the viewer is near this mirror direction, they see a bright highlight.

Mirror Reflection Direction:

The reflected ray direction R^R^ can be computed from the light direction L^L^ and the surface normal N^N^:

R^=2(N^L^)N^L^

This is derived from the law of reflection. R^R^ points in the direction that a perfect mirror would reflect the incoming light.

Phong Specular Model:

Bui Tuong Phong (1975) proposed:

Ispecular=ksILmax(0,R^V^)n

Where:

  • ks​ = specular reflection coefficient (strength of the highlight)
  • IL​ = light source intensity
  • R^ = reflected light direction
  • V^ = direction from surface point toward the viewer (camera)
  • R^V^ = cosine of the angle between the reflection direction and the view direction
  • n = shininess exponent (also called the specular exponent)

The Shininess Exponent (n):

This is the key parameter that controls how "tight" or "spread out" the specular highlight is:

nn valueAppearanceExample material
1–2Very broad, dull highlightRough plastic, unpolished stone
10–30Moderate highlightSmooth plastic, wood with varnish
50–100Tight, bright highlightPolished metal, glossy paint
200–500Very sharp, mirror-likeChrome, mirror
Perfect mirrorTheoretical limit

Why does nn work this way?

The dot product R^V^ is always ≤ 1 (for angles ≤ 90°). Raising a number between 0 and 1 to a high power drives it toward 0 rapidly. So only values very close to 1 (when V^ is nearly aligned with R^) survive the exponentiation creating a tight highlight. Low exponents allow a wider range of angles to contribute creating a broad highlight.

Example: If R^V^=0.8R^⋅V^=0.8:

  • n=2n = 2: 0.82 = 0.64 (still quite bright)
  • n = 10: 0.810 ≈ 0.107 (much dimmer)
  • n=100: 0.81000.00000000000000000001 (invisible)

Blinn-Phong Specular Model:

Jim Blinn (1977) introduced an optimization. Instead of computing the reflection vector R^, he introduced the halfway vectorH^:

H^=L^+V^L^+V^

The specular term becomes:

Ispecular=ksILmax(0,N^H^)n

Why is this better?

  • Computing H^ and its dot product with N^ is often cheaper than computing R^ and its dot product with V^.
  • When V^ and L^ are both at infinity (directional lights), H^ is a constant even faster to compute.
  • At grazing angles, Blinn-Phong produces slightly more realistic highlights than Phong.
  • Used in OpenGL fixed-function pipeline and many real-time engines.


 

Previous Post
Light-Surface Interaction - Rendering Equation, Light Sources, and Normal Vectors
0 people found this article helpful

Was this article helpful?