Post

day 608: ! built a fake real-time GI system for my game and it cost almost nothing to run! The warm sunset light wrapping under the car is not baked, not a probe volume, not a reflection capture. here is how it works 🧵 #buildinpublic #indiegamedev #unity3d

vehicles in this game get hijacked mid-battle and thrown across five different biomes. each one has a different sun angle, sand color, and sky. baked GI is useless here: the world is fully procedural and randomized.

the solution is a rolling 16×16 grid of ambient light probes. each probe stores spherical harmonics, a lightweight mathematical encoding of the full light environment at that position. the grid slides toroidally so probes only need to recalculate when they wrap around.

ground bounce is: sun color * temperature * sun angle * sand albedo * bounce scale * shadow contribution. the sand color comes from the world manager. so the bounce color automatically tracks the terrain you are driving on

probes in shadow suppress the ground bounce and dim the sky away from shadow caster, creating nice occlusion. the suppression uses the occluder distance, letting more sky cast and bounce come trough in shallower shadow.

the shadow raycast and GI analyze only fires when a probe is dirty. once settled, zero cost. probes don't need to rebake at all. total per-frame cost at steady state: one bilinear lookup per vehicle.

0 reposts3 likes

It is not path tracing. but one bounce, 256 probes total. It is physically grounded math and it reads the actual world state: sand color, sun temperature, sky gradient and shadow distance. Later in the future I will add colour bounce from nearby structures,

GI probes being recalculated in realtime to match shifting light scenarios. The probes could update every frame for ultra smooth look, but the game hardly needs that and I want this to run on the steam deck without issues!