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.

Light the exhibits

SKETCHBOOK / 06 The material room · 2-week chapter

Page 1 of 3: Keep every direction in the same space

Normals are part of geometry

Keep every direction in the same space

For a first lighting pass, choose world space for positions, normals, lights, and the viewer. The model matrix transforms a vertex position; its linear part does not always transform normals correctly. Under non-uniform scale, use the inverse transpose of the supported nonsingular model transform for a normal direction.

Interpolate the transformed normal and normalize it at the fragment when the lighting equation needs a unit direction. A blend of unit vertex normals is generally not itself unit length. Degenerate geometry and singular scales need an explicit policy before taking an inverse or normalizing.

Add a normal-debug view to the observatory before tuning appearance. Map normal components into a visible range and compare a box face before and after rotation. A colored normal picture is a diagnostic representation, not an albedo texture or a final lighting calculation.

TRY IT IN YOUR STUDIO

Give one exhibit a non-uniform scale. Compare correct normal handling with reusing the model matrix, and record which face reveals the error.

From the page to your own work

Your studio assignment.

Build three materials you can explain in the same room.

A finish line you can see

Your diffuse/highlight shader, normal-debug mode, and controlled contact sheet.

  1. Keep light, view, positions, and normals in a documented space.
  2. Handle non-uniform scale and degenerate normalization.
  3. Validate material ranges and identify the model’s limitations.
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 is the model matrix alone insufficient for every normal transform?
  • A normal must remain perpendicular to the transformed tangent plane.
  • Non-uniform scaling changes that relationship.
  • Use a supported inverse-transpose transform and reject singular cases.

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

A small creative variation ↗

Add one alternate light position while keeping material values fixed.

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

Coming back after a break? ↩

Return to a single unlit box, then enable only the normal-debug view.

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