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.

Trace your first world

SKETCHBOOK / 05 The rendering studio · 2-week chapter

Page 1 of 4: Follow one pixel all the way through

Understand the pipeline before adding features

Follow one pixel all the way through

The native project renders a small sphere-and-plane scene on the CPU. For each pixel center, a perspective camera constructs a ray; geometry chooses the nearest accepted hit; shading assigns a color; the output stage converts that result into PPM channel values. A ray that misses takes the renderer’s background path. There is one sample per pixel, so this is not an anti-aliasing or sampling-quality lesson yet.

Read these stages as separate decisions. Scene validation owns the input boundary. Math functions answer geometric questions. The renderer chooses visibility and appearance. The command handles paths and reports failure. That separation lets you test a ray-sphere intersection without needing an output file or an image viewer.

Choose one pixel near the center and trace its values on paper. Record the ray origin and direction, the accepted t, the hit normal, and the resulting channel values. The goal is not a photorealistic image yet; it is an image whose decisions you can explain.

TRY IT IN YOUR STUDIO

Run the included studio scene locally. Find the loop that visits pixels and the function that tests a sphere. Draw arrows between the pipeline stages using the actual native function names.

From the page to your own work

Your studio assignment.

Follow one pixel through geometry, lighting, and encoding before improving the image.

A finish line you can see

A scene image with one deliberate visual change, a pixel trace, and a new geometric regression test.

  1. Choose one camera, light, or material change and predict its effect.
  2. Trace one hit through normal, lighting term, and encoded channels.
  3. Add a regression with an independently known answer.
  4. Describe the gamma-2 approximation and one current renderer limitation.
Keep the evidence in your weekly notebook ↗
Explain it like an engineer

Try answering aloud before opening the review notes. Use your own implementation as evidence.

How would you debug a black object without randomly changing constants?
  • Inspect the hit, normal length, coordinate space, light direction, and occlusion separately.
  • Distinguish linear shading values from encoded output.
  • Use a controlled scene and intermediate diagnostics to test one hypothesis.

These prompts support practice; they are not an automatic assessment of your work.

A small creative variation ↗

Add a normal-visualization debug mode with a documented mapping from [-1, 1] to display channels.

Optional. Save it for later if this chapter already feels full.

Coming back after a break? ↩

Render the known scene unchanged. Pick one center pixel and find the function that assigns its color.

Books & principles behind this study +

Original Parallax explanations and assignments, with these works for further reading.

YOUR MARGIN NOTES

Leave yourself a good question.

What changed your mind? What would you try next?

Notes are private to this browser and saved as you write.

A CHECKPOINT, NOT A SCORE

Can you explain the idea and try the exercise yourself?

Completion records your own assessment. It does not compile or test your C++.
Companion source 4 files