Radiosity

Global illumination for a Cornell box, written from scratch in Java.

Fig. 1 — Final render8 passes
pass 0.0 / 8only the light emits; every other dot is dark
ROLECo-author, with Kon Aoki
YEAR2019
STACKJava · AWT · Swing
GATHERING, PER DOT
Li = Σj visible Φj / rij² · cj
ci = mi · Li
Φflux of a source dot, from its last pass
rlength of the ray between the two dots
ccolor the dot renders and re-emits
mmaterial color of the face: white, red or green
  1. 01
    DotsEvery face of the box is split into dots, the smallest unit of light. At the start only the area light on the ceiling holds any energy.
  2. 02
    RaysFor each dot, a ray is traced from every dot on the other faces. If the ray hits another face before it arrives, that source is dropped.
  3. 03
    GatherEach visible source adds its flux divided by the distance squared, tinted by its color. The sum is multiplied by the dot’s own material color.
  4. 04
    Re-emitThe dot becomes a light carrying that color and flux, so walls start lighting each other. The scene is gathered again for 8 passes, then a camera ray-casts the dots to the screen.
Fig. 2 — One dot gathering, side sectionlive
Fig. 3 — Demo of the rendererKon Aoki & Aymeric Foyer, 2019