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.
A sphere. A light.
A very useful dot product.
Turn around the view. The light’s forward component stays fixed.
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.
Ready to make light with real GLSL? Open the Shader Lab ↗
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.
