Theme Catppuccin
Make yourself at homeCatppuccin

A softer light for long learning sessions.

Appearance

Loading your preference…

Dark palette

Choose a dark palette to try it.

Light uses Latte. Your choices stay in this browser.

The foundation workshop / 24 weeks · 12 chapters

A place for
careful making.

Read, build, inspect, change one thing. Twelve two-week chapters take you from a first image to a small rendering project you can explain.

Working in a later course? Choose its companion guide or prepare your AMD Linux and Apple silicon workspaces.

01 / Your tools

A small, explicit toolchain.

The native references use C++23, CMake, and the standard library. Scenes are ordinary typed C++ values. There is no JSON parser, third-party header dependency, graphics SDK, or network service in the native starter.

Use a compiler and standard library that support C++23, including std::expected, and CMake 3.25 or later. The reference is verified with Apple Clang 21 on macOS; Linux is an intended target that has not been verified here.

Learn CMake, Ninja & Clang — from the beginning ↗

A fifteen-page primer starts from an empty folder, then teaches libraries, target requirements, tests, failure diagnosis, presets, and sanitizers using your own project and this renderer. Your existing C++ experience is welcome; no remembered CMake knowledge is assumed.

The website and the native references

The learning website runs with Bun 1.4.4. The three native programs run as C++ executables on your machine. Browser controls teach the ideas; they don't compile or launch your C++.

02 / First evidence

Make an image. Then make a change.

From the project's native directory, configure, build, and run its checks:

cmake --preset clang-debug
cmake --build --preset clang-debug --parallel
ctest --preset clang-debug
./build/clang-debug/prism-render studio.ppm
./build/clang-debug/prism-raster triangles.ppm
./build/clang-debug/prism-memory
Actual C++ renderer output: coral, blue, and mint spheres casting shadows on a checkerboard ground
Actual output from the included C++ renderer. The typed demo_scene() reproduces this image; its PPM was converted to PNG for this page.
Render a world
prism-render uses the typed demo_scene() in scene.cpp. Change a sphere, camera, or light, rebuild, and compare the image.
Rasterize triangles
prism-raster uses demo_raster_scene() in raster_lab.cpp. It interpolates screen-space RGB and depth, skips degenerate triangles, and bounds its pixel traversal.
Observe a memory budget
prism-memory runs the separate PMR experiment: a bounded arena, controlled allocation failure, cleanup, and promotion to an independent owner.

Both image programs write binary P6 PPM. Inspect the dimensions and header, then open the file in a compatible viewer. Replacing the provided scene unchanged is not the chapter mission: make a deliberate change and record what it taught you.

Open the complete native instructions ↗

Run these commands on your machine. This page never starts a compiler or accesses work infrastructure.

03 / A steady rhythm

One chapter. Two weeks.
One finished experiment.

Use the first week to understand and reproduce a small result. Use the second to make your own variation, add evidence, and explain a decision. The schedule is a suggested pace, with a small restart step in each chapter.

  1. Weeks 1–2First light
  2. Weeks 3–4Own the frame
  3. Weeks 5–6Vectors, then rays
  4. Weeks 7–8A scene by design
  5. Weeks 9–10Trace your first world
  6. Weeks 11–12Memory with a budget
  7. Weeks 13–14Shadows and second rays
  8. Weeks 15–16Triangles on a grid
  9. Weeks 17–18Camera, clipping, depth
  10. Weeks 19–20Attributes that stay attached
  11. Weeks 21–22Your first shader
  12. Weeks 23–24A renderer you can defend

Each chapter includes a concrete mission, a definition of done, a remix, review questions, and optional further reading. Your notes and checks are stored in this browser; they are personal records, not automatic grading.

Open your course journey ↗
04 / Open the hood

Find your next file.

Choose your project, follow a starting point, or look up a file. Each companion includes the source you can read, build, and make your own.

Your source shelf

9 companions · 79 files

Pick one project. Start with its guide, then follow the code.

One project at a time

First Light

Make your first CPU image, rasterize triangles, and trace an allocation budget.

Go to the lesson
Browse this project15 files

15 files in First Light

Read online or download a file. The project guide shows how to build and run it.

05 / Our working principles

Use the guidelines.
Understand the reason.

Your downloaded C++ Core Guidelines are included as a reference snapshot. The assignments are original course material; linked reading from Computer Graphics from Scratch and LearnOpenGL is credited beside the chapters it supports.

Ownership before optimization
Start with values, std::vector, and scoped resources. Name the owner and its lifetime before adding a view, custom allocator, or concurrency. R.1 · C.20
Validate typed values too
Typed scenes still need finite coordinates, supported dimensions, positive radii, and bounded combined work. Check factors before multiplying and validate before allocating or indexing pixels.
Make failures observable
Test a known pixel, a rejected boundary, and a failed output. Sanitizers and focused tests provide evidence; they do not prove complete memory safety.
Measure allocation
Use ordinary containers first. Then observe requests through a bounded std::pmr arena. Its resource must outlive every borrowing container, and all borrowers must die before reset.
State the implemented boundary
The native examples implement ray/sphere and ground hits, shadows, screen-space triangle coverage, interpolated RGB/depth, PPM output, and a PMR experiment. Reflections, 3D raster projection/clipping, textures, and perspective-correct UVs are your guided extensions.
Make the result yours
Keep attribution for supplied sources and reading. Show your own change, regression test, image, and reasoning. An unchanged reference is a study aid; it is not your independent portfolio project.
Production habits, honest scope

First Light teaches bounded, inspectable CPU programs. Later course companions add an OpenGL camera, a diffuse path renderer, a responsive image pipeline, PMR rendering experiments, Asio coroutines, and Vulkan/Metal clear-color windows. Each companion states its tested behavior and the project features you will build.

06 / After the reference

Build the next contract
when you can explain this one.

The browser shader chapter connects the CPU experiments to WebGL2 / GLSL ES 3.00. Continue inside Parallax with The Shader Workshop: original OpenGL lessons, a native C++ starter, and Chromatic Observatory, your interactive exhibit.

Light Transport develops a CPU path tracer. Renderer Engineering teaches task ownership, bounded queues, cancellation, joining, asset generations, and the difference between coroutine syntax and an execution runtime.

Vulkan and Metal then make GPU submission, completion, and resource retirement concrete on your two machines. Try the frame-lifetime experiment before translating it into API calls. First, finish your current small project with a reproducible image, useful tests, and a debugging story you can explain.