⚫ The Dot Product: How Much Do Two Directions Agree?
One tiny calculation, three multiplications and two additions, answers ‘do these point the same way?’. It’s behind lighting, field-of-view checks and much more. Drag two arrows and see.
One tiny calculation, three multiplications and two additions, answers ‘do these point the same way?’. It’s behind lighting, field-of-view checks and much more. Drag two arrows and see.
Build each triangle’s normal in the fragment shader from ddx and ddy of its position: a faceted, low-poly look with no extra mesh data. Plus more uses for derivatives.
How games draw shadows: render the scene’s depth from the light’s point of view, then check every pixel against it. See the shadow map itself, and the acne, jaggies and blur that come with it.
A flat square can look like a bumpy brick wall if each pixel lies about which way it faces. See how normal maps store those directions, and why they’re always blue.
The numbers in an image aren’t amounts of light. Find the grey that really is half as bright, then see what goes wrong when blending and lighting ignore it.
How a shader fakes light with three simple terms: ambient, diffuse and specular. Learn Lambert’s cosine law, the Blinn-Phong highlight, and why lighting per pixel beats lighting per vertex.