Skip to content
Part IA Michaelmas Term

Cacheability of Phong Terms

Caching for Animation

When rendering animations, we can cache certain Phong shading components depending on what is moving in the scene.

Component Cacheability

ComponentTermCacheable?Reason
AmbientIakaI_a k_aAlwaysConstant; independent of everything
DiffuseIlkd(NL)I_l k_d (\mathbf{N} \cdot \mathbf{L})Yes (if static)Depends on N\mathbf{N} and L\mathbf{L}, not V\mathbf{V}
SpecularIlks(RV)nI_l k_s (\mathbf{R} \cdot \mathbf{V})^nNever if cam. movesDepends on viewer direction

Ambient Term

Always cacheable:

  • Constant per surface (independent of camera, lights, objects)
  • Compute once and reuse across all frames

Diffuse Term

Cacheable if:

  • Lights are static
  • Objects are static

Cannot cache if:

  • Lights move (changes L\mathbf{L})
  • Objects move/rotate (changes N\mathbf{N})

View-independent: unaffected by camera motion.

Specular Term

Never cacheable if camera moves:

  • Depends on V\mathbf{V} (viewer direction)
  • Must recompute every frame

Could cache if:

  • Camera is static
  • Lights and objects are static
  • (Rare: only useful for walk-through with fixed viewpoint)

Summary

  • Ambient: always cacheable
  • Diffuse: cacheable if lights and objects are static
  • Specular: never cacheable if camera moves (depends on V\mathbf{V})

Past Paper Questions

2023 Paper 3 Question 3(a)(iv): In the Phong shading model, which terms can be cached in an animation? Explain why.