Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 13 · From Scratch · Container Runtime · about 16 min to read

Play it as a journeyTutor comes with a plan

A ray tracer in an afternoon

Capstone Keypress to Pixel
Capstone Keypress to Pixel · Open board

The board that follows one key press until a pixel changes colour. A ray tracer is the same last step done on purpose: for every pixel on the screen, work out one colour, from numbers alone.

Lesson 103 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • The problem: a screen has pixels, a scene has only numbers
  • Rays: one straight line per pixel
  • Spheres: where does a ray touch a ball?
  • Normals: which way does the surface face?
  • Diffuse light: facing the lamp makes it bright
  • Specular light: the shiny spot depends on where the eye is
  • Shadows: a second ray toward the lamp
  • PPM: the easiest picture file there is
  • The code
  • Run it
  • Break it: shadows with no offset
  • What this leaves out

Terms it explains: ray, normal, dot product, diffuse, specular.

Review From Scratch