Lab B01 Ray Casting and Visibility

Seeing the scene

Tasks

This lab focuses on building a ray casting loop, calculate the direction of rays through pixels, and intersect rays with a sphere.

Lab B01 corresponds to chapter 1-6.4 of Prof. Shirley's Ray Tracing in One Weekend.

You can directly follow Prof. Shirley's Tutorial at

Expected Duration

  • Scheduled lab time: 1 hour

  • Expected independent study: 2 hours

You are not expected to complete all tasks during the lab session.

Focus

Students build the core ray tracer loop and solve basic ray–object intersections.

Learning objectives

By the end of this lab, students will be able to:

  • Generate rays from a virtual camera

  • Implement basic ray–sphere intersection tests

Key activities

  • Generate camera rays (one ray per pixel)

  • Implement ray–sphere intersection

  • Output flat colour or surface normal

Visual outcome

  • Coloured spheres

  • Normal visualisation

  • No lighting yet

Last updated