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.

Shadows and second rays

SKETCHBOOK / 07 The light room · 2-week chapter

Page 1 of 3: A shadow is a visibility test

Continue from the light you already know

A shadow is a visibility test

A diffuse term answers how a surface faces a light. It does not answer whether another object blocks that light. At a surface hit, construct a secondary ray toward the light and ask whether an accepted blocker lies in its interval. Keep this visibility decision separate from the material’s color.

The reference has a directional light, so its shadow ray extends toward an effectively distant source. A point light would need a finite upper distance: an object beyond the lamp must not block it. That is a change to the ray interval contract, not just a different light vector.

The current CPU renderer tests spheres as occluders and retains its ambient contribution in shadow. The plane is not a general shadow caster. Reproduce one sphere shadow before adding another lighting model, then change one object position and predict where the shadow moves.

TRY IT IN YOUR STUDIO

Use the existing directional-light scene to save an occluded and unoccluded comparison. Sketch the finite interval you would need for a later point-light extension.

From the page to your own work

Your studio assignment.

Explain the implemented shadow ray, then add one bounded mirror experiment of your own.

A finish line you can see

A controlled shadow comparison and your own one-bounce reflection extension, with an explicit work/depth limit and tests.

  1. Demonstrate one unoccluded and one occluded surface point.
  2. Test a reflected direction against a known plane normal.
  3. Keep reflection depth finite and define the zero-budget result.
  4. Save a before/after image and explain one numerical-offset 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.

Why can a surface shadow itself, and why is a fixed epsilon only an approximation?
  • The computed hit can lie slightly inside the surface after rounding.
  • A secondary ray needs a deliberate origin/interval policy.
  • Scene scale and grazing angles affect a fixed offset; it is not a universal robustness proof.

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

A small creative variation ↗

Use one reflective sphere and keep every other material unchanged. Stop after a single visible reflected object.

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

Coming back after a break? ↩

Disable the reflection extension and reproduce one existing sphere shadow. Then test the reflection direction alone.

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