POC / Radiance Cascades

Trying to build up my intuition around Suslik's Radiance Cascades GI approach.

2D

Things are simpler in 2D so we'll start there.

Radiance Intervals (2D)

In 2D these are bands/shells/annuluses/crusts(🍕) of radiance values where relative to the previous level, each cascade level:

  • doubles the inner radius of the band
  • doubles the width of the band
  • doubles the number of rays per probe
  • halves the total number of rays
  • offsets the rays to avoid overlaps (e.g., angle = TAU * (rayIndex + 0.5) / rayCount)
level 0 ray count:
branching factor(Nlevel):

source: flatland-2d/radiance-intervals-2d.js

Ray Distributions (2D)

Note: this demo is limited to spatial doubling for cascade levels irregardless of the branching factor, which is the common case for flatland.

max level
2r raycount (level 0):
probe diameter (level 0):
interval radius (level 0):
branching factor(Nlevel):
color lower levels:
show cascade ray counts:

source: flatland-2d/probe-ray-distributions-2d.js

Probe Ray Interpolation (2D)

min level:
max level:
level 0 ray count:
branching factor(Nlevel):

source: flatland-2d/probe-interpolation-2d.js

Flatland (2D)

Debug/Development

run continuously and collect frame timings
timings
render world mip level
render probe directions
disable brush preview
raymarch mipmap N on cascade level N
raymarch with dda
raymarch fixed size step multiplier:
accumulate non-linearly
accumulation decay:

Radiance Cascade Parameters

2i spacing (level 0):
2r raycount (level 0):
branching factor:
interval radius (level 0):
levels:

Brush Parameters

erase
brush opacity:
brush radiance:
brush radius:
brush color:

This demo requires WebGPU - in other words, you should open this page in Chrome or Edge.

source: flatland-2d/flatland-2d.js

3D

World Space Storage Requirements (3D)

Compute a storage cost table for world space probes, using a ping-pong buffer, at various spatial resolutions.

rayCount = 6
bytesPerRay = 16
diameter3 * rayCount * bytesPerRay * 2
diameter megabytes MB per slice

Licensing

Text / Images

tmpvar's radiance cascades 2D playground is licensed under CC BY 4.0

which includes the text and images on this page.

Linked Source Code

All of the linked source code is licensed MIT as specified in the header of each file.