Week 11 — Coding Projects

Core

Implement basic shading models.

  • NumPy: Given positions/normals/light direction, compute Lambert intensity. Add Blinn-Phong specular. Render a simple shaded sphere image on CPU.
  • Metal: Vertex + fragment shaders for Lambert and Blinn-Phong. Render a sphere with light and camera controls. · Reading: MBT — lighting, normals, fragment shading, material parameters.
  • Vulkan: Equivalent lighting pipeline with shader stages and lighting UBOs. · Reading: Vulkan Book — shader stages, lighting UBOs, material pipeline setup.
  • CUDA: Software shading of many fragments/pixels in parallel. · Reading: CUDA Book — image-parallel kernels, per-pixel compute patterns.
  • Stretch: Add multiple lights. Add gamma correction.
  • Verify: Diffuse intensity matches max(dot(n, l), 0) · Specular highlight moves with camera/light · Normals are normalized before shading.