A complete technical breakdown of global illumination, physically-based materials, rigid body dynamics, and the Genesis rendering engine.
Global illumination (GI) simulates how light bounces between surfaces, creating soft shadows, color bleeding, and realistic ambient lighting. Unlike rasterization (which only computes direct lighting), GI accounts for all light paths.
All physically-based rendering solves the same equation, formulated by James Kajiya in 1986:
In words: outgoing light = emitted light + integral of (BRDF × incoming light × cosine) over hemisphere.
Genesis uses Monte Carlo path tracing to solve this integral stochastically:
// Simplified path tracing for sample in 1..SPP: ray = camera.generate_ray(pixel) color = trace_path(ray, depth=12) def trace_path(ray, depth): hit = scene.intersect(ray) if hit.material.is_emissive: return hit.emission wi = hit.material.sample(wo, normal) Li = trace_path(Ray(hit.point, wi), depth - 1) return brdf * Li * cos(theta) / pdf
128 random paths traced per pixel, then averaged. More samples = less noise.
Each path bounces up to 12 times. More bounces capture indirect lighting.
After 4 bounces, paths are randomly terminated based on throughput. Unbiased.
Every surface has a material defining how light interacts with it. Modern renderers use PBR—materials based on real physics, not arbitrary parameters.
| Material | Type | Key Parameters | Used For |
|---|---|---|---|
| Metal | Conductor | color, roughness | Gold sphere, obsidian floor |
| Glass | Dielectric | color, IOR | Crystal dominoes, diamond orb |
| Default | Diffuse/Glossy | color, roughness | Corridor walls |
| Emission | Light source | emissive RGB | Neon bars, ceiling lights |
The BRDF describes what fraction of incoming light reflects in each outgoing direction. For metals, most light reflects; for dielectrics, the Fresnel equations determine reflection vs. transmission.
All materials reflect more light at grazing angles:
Look at the obsidian floor. Near the camera (grazing angle), it's almost a perfect mirror. Directly below the lights (normal incidence), it's darker. That gradient is Fresnel.
When light crosses a boundary (air → glass), it bends according to Snell's Law:
| Material | IOR | Visual Effect |
|---|---|---|
| Ice | 1.31 | Subtle distortion |
| Glass / Quartz | 1.54–1.55 | Moderate bending |
| Ruby | 1.77 | Strong bending |
| Diamond | 2.417 | Extreme brilliance |
Genesis simulates a thin-lens camera. Objects at the wrong distance appear blurry—just like a real camera.
Lower f-stop = larger aperture = shallower DOF. The film uses f/2.0 for cinematic bokeh.
Objects at this distance are sharp. The rack focus shot animates this from 1m to 9m.
Out-of-focus points blur into discs. Diameter: d ∝ aperture × |z - focus| / z
Even at 128 SPP, Monte Carlo noise is visible. We use Intel Open Image Denoise (OIDN)—a neural network trained to remove path tracing noise while preserving detail.
# HDR denoising pipeline rgb_float = camera.render() # float32 [0, ∞) rgb_float = clip(rgb_float, 0, 1) rgb_clean = denoiser.denoise(rgb_float) # OIDN Metal rgb_uint8 = (rgb_clean * 255).astype(uint8)
The domino cascade isn't animated by hand—it's simulated. Genesis solves Newton's equations of motion at 60 Hz.
# Collision response for (A, B) in find_collisions(): v_rel = A.velocity - B.velocity impulse = -(1 + restitution) * dot(v_rel, normal) / (1/A.mass + 1/B.mass) A.velocity += impulse * normal / A.mass B.velocity -= impulse * normal / B.mass
Click each stage to explore. Watch the data flow.
Forge is Kagami's construction colony—the engine that abstracts camera movements into composable, named shot types.
from kairos.core.services.forge.modules.genesis.cinematography import ( Cinematographer, Shot, Sequence, ) sequence = Sequence( name="The Symmetry of Collapse", shots=[ Cinematographer.create_one_point_perspective_shot(...), Cinematographer.create_rack_focus_shot(...), Cinematographer.create_dolly_zoom_shot(...), Cinematographer.create_steadicam_follow_shot(...), Cinematographer.create_arc_shot(...), ] )
| Shot Type | Camera Motion | Psychological Effect |
|---|---|---|
| One-Point Perspective | Slow dolly forward | Inevitability, dread |
| Rack Focus | Static, focus shifts | Revelation, connection |
| Dolly Zoom | Dolly back + zoom in | Vertigo, realization |
| Steadicam | Smooth path | Immersion, presence |
| Arc Shot | Orbit around subject | Power, contemplation |
How does this connect to Kagami's world model? Genesis provides the substrate for imagination—the world model can predict "what happens if I push this domino?" and Genesis makes that prediction visible.
The world model predicts. Genesis renders the prediction. The encoder compresses the render. The world model updates. This is the imagination loop—dreaming in physics, learning from synthetic experience.