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 diffuse walk

SKETCHBOOK / 03 The Lantern Room · 2-week chapter

Page 1 of 6: A scattering sample is a contract

BSDF / PDF pairing

A scattering sample is a contract

A Lambertian BRDF is reflectance divided by pi. Its reflected-energy fraction is the reflectance, not the BRDF value by itself. With cosine-weighted hemisphere sampling, the cosine-over-pi density cancels the corresponding BRDF and cosine factors in the throughput update.

That cancellation is specific to the paired model and sampler. It is not permission to delete PDF handling from the integrator. Return a scattering sample containing direction, density, and the information needed to distinguish an ordinary density from a delta event later.

The runnable bridge in diffuse.cpp keeps the formula visible even though the matched terms cancel. Its validated scene owns sphere/material values; reflectance channels must lie in [0,1]. It builds the world-space frame, uses a documented small-scene ray offset, and propagates invalid sampling inputs as ordinary errors before any division.

From the page to your own work

Your studio assignment.

Add the first indirect diffuse bounce to your own Lantern Room.

A finish line you can see

A bounded diffuse path loop, a constant-environment test, and a trace of one sample.

  1. Check a matched sampler/BRDF cancellation numerically.
  2. Name the local/world frame conversion.
  3. Test zero and maximum bounce behavior.
  4. Describe the remaining truncation bias.
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.

Why does the same albedo update fail for a different directional sampler?
  • The cancellation depends on a specific PDF.
  • Write f times cosine divided by the new density.
  • Keep directional measure and local hemisphere conventions consistent.

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

A small creative variation ↗

Render one colored wall twice, once with one indirect bounce and once with a larger bounded depth.

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

Coming back after a break? ↩

Run the constant-environment check and fixed-ray trace unchanged before editing the throughput update.

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 10 files