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.

A small experiment / a visible idea

Let there be understanding.

A surface normal points away from the sphere. A light direction points toward the light.
Their alignment tells us how much diffuse light the surface receives.

STUDY NO. 01 / LIGHT & FORM

A sphere. A light.
A very useful dot product.

LIVE STUDY
A diffuse-shaded sphere. Adjust the controls and read the numeric probe below for the same lighting information.
A white directional light. An orthographic sphere. No texture, specular shine, or hidden magic.
135°

Turn around the view. The light’s forward component stays fixed.

Choose a pigment
NORMAL AT THE PROBE(-0.45, 0.35, 0.82)
MAX(0, N · L)0.92Diffuse response
AMBIENT TERM0.12Kept separate and fixed
DISPLAYED BRIGHTNESS0.930.12 + 0.88 × diffuse

The surface gets a vote.

N is a unit surface normal. L is a unit direction from the surface toward the light. Their dot product measures alignment; clamping at zero removes light arriving from behind the surface. This study scales display RGB directly to keep that relationship visible.

This is a JavaScript teaching model beside the real C++ lab. Explore the native renderer source or run it in your workshop.

Bring the idea home

Make the pixels yourself.

The browser experiment is a teaching model. Your C++ renderer is a separate, runnable program with scene validation and tests.

Build the C++ renderer ↗