Lighting
Computing Light Interaction
Lighting lessons
Intuition: What Does a Dot Product Actually Mean?
The dot product A.B measures how much B points in the direction of A. The yellow projection line shows this geometrically — it is literally the shadow of B cast onto A. This is why N.L gives diffuse lighting intensity:
Intuition: Cross Product Geometry
The cross product produces a vector perpendicular to both inputs. Its magnitude equals the parallelogram area. This is how TBN builds an orthogonal frame, how IK Jacobian columns are computed, and how curl noise works:
Normal Map Decoder
Normal maps store surface normals as RGB colors in tangent space. Hover over the map to see how each pixel decodes from RGB [0,255] to XYZ [-1,+1] and affects lighting:
Fresnel Ring Demonstrator
See where Fresnel kicks in on a sphere — the bright ring at the edges shows grazing-angle reflection. Center (head-on) uses F0, edges approach 1.0:
Lambert Diffuse
Interactive: Diffuse + Specular + Fresnel
Drag the light to see all three shading quantities update in real-time:
Normal Mapping and TBN
Shadow Mapping
Live: Shadow Map Depth Visualizer
See the scene from both camera and light. Set bias to 0 to see shadow acne — the floor falsely shadows itself because d_fragment barely exceeds d_stored due to floating-point precision:
Global Illumination
Interactive: Spherical Harmonics Basis
SH probes encode diffuse lighting. L0 = ambient, L1 = directional, L2 = quadratic. 9 coefficients x RGB = 27 floats per probe: