Skip to content
Part IA Michaelmas Term

Reflection and Refraction

Recursive Ray Tracing

At an intersection point, we can spawn additional rays:

  • Reflection rays for mirrors
  • Refraction rays for transparent materials

Ray spawning for reflection and refraction through a transparent sphere

Reflection

For mirror-like surfaces, a reflected ray is spawned:

R=D2(DN)N\mathbf{R} = \mathbf{D} - 2(\mathbf{D} \cdot \mathbf{N})\mathbf{N}

where D\mathbf{D} is the incoming ray direction and N\mathbf{N} is the surface normal.

Reflection Direction Derivation

The reflection is the incident direction mirrored about the normal:

  • Component parallel to N\mathbf{N}: reversed
  • Component perpendicular to N\mathbf{N}: unchanged

Refraction (Transparency)

Transparent objects bend light according to Snell’s law:

n1sinθ1=n2sinθ2n_1 \sin\theta_1 = n_2 \sin\theta_2

where n1n_1 and n2n_2 are refractive indices.

Refracted Direction

T=n1n2D+(n1n2cosθ1cosθ2)N\mathbf{T} = \frac{n_1}{n_2}\mathbf{D} + \left(\frac{n_1}{n_2}\cos\theta_1 - \cos\theta_2\right)\mathbf{N}

Total Internal Reflection

When light travels from a denser to less dense medium:

  • If incident angle exceeds critical angle: No refraction, only reflection
  • Critical angle: θc=arcsin(n2/n1)\theta_c = \arcsin(n_2/n_1)

Fresnel Effect

At glancing angles, more light is reflected; at normal incidence, more is refracted:

  • Approximate with Schlick’s approximation
  • Important for realistic glass and water

Combining Effects

The final colour combines:

  • Local shading (Phong)
  • Reflected colour (weighted by reflectivity)
  • Refracted colour (weighted by transparency)

I=Ilocal+krIreflected+ktIrefractedI = I_{\text{local}} + k_r I_{\text{reflected}} + k_t I_{\text{refracted}}

Summary

  • Reflection rays use the mirror direction formula
  • Refraction follows Snell’s law
  • Total internal reflection occurs above the critical angle
  • Combined colour blends local, reflected, and refracted contributions