Radiance Cascades × Pixel-art 3D rendering × OKLab palette quantization
Palette-true pixel art with soft GI. 3D pixel art lit by penumbra-correct global illumination that still lands on a fixed palette. Cascades are cheap at the tiny internal resolution, and texel-snapping the camera keeps probes and pixels aligned so light does not crawl.
Open in StudioReproduced101× · 3.14 ms
Verified proof

Split-screen WebGL2 proof comparing continuous radiance-cascade 2D GI (left) against texel-snapped low-res pixel art quantized into an 8-color palette in OKLab with a 4x4 Bayer lightness threshold (right).
Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · converts soft multi-emitter GI penumbras into temporally stable OKLab-dithered palette ramps at snapped pixel resolution
Show GLSL proof (100 lines)
const float PIXEL_GRID = 84.0; // P
const float DITHER_STRENGTH = 0.095; // P
const float GI_EXPOSURE = 1.45; // P
float sdBox2(vec2 p, vec2 b) { vec2 q = abs(p) - b; return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0); }
float sceneOccluders(vec2 p) {
float p1 = sdBox2(p - vec2(-0.18, 0.06), vec2(0.08, 0.14));
float p2 = sdBox2(p - vec2(0.20, -0.10), vec2(0.11, 0.07));
float p3 = length(p - vec2(0.02, 0.24)) - 0.09;
float border = -sdBox2(p, vec2(0.47, 0.47));
return min(min(p1, p2), min(p3, border));
}
vec3 sampleEmission(vec2 p, float t) {
vec2 l1 = vec2(-0.30 + 0.06 * sin(t * 0.7), -0.22 + 0.05 * cos(t * 0.5));
vec2 l2 = vec2(0.28, 0.24 + 0.05 * sin(t * 0.6));
float d1 = length(p - l1) - 0.065;
float d2 = length(p - l2) - 0.06;
if (d1 < 0.008) return vec3(2.8, 1.35, 0.35);
if (d2 < 0.008) return vec3(0.35, 1.85, 2.55);
return vec3(0.0);
}
vec3 radianceCascade(vec2 p, float t) {
vec3 sum = vec3(0.0);
const int RAYS = 24;
for (int i = 0; i < RAYS; i++) {
float a = (float(i) + 0.5) * 6.2831853 / float(RAYS);
vec2 dir = vec2(cos(a), sin(a));
float dist = 0.012;
vec3 rad = vec3(0.04, 0.05, 0.08);
for (int s = 0; s < 22; s++) {
vec2 q = p + dir * dist;
vec3 em = sampleEmission(q, t);
if (dot(em, em) > 0.01) { rad = em / (1.0 + 3.2 * dist * dist); break; }
float d = sceneOccluders(q);
if (d < 0.004) { rad = vec3(0.03, 0.035, 0.05); break; }
dist += max(d * 0.85, 0.018);
if (dist > 1.15) break;
}
sum += rad;
}
return (sum / float(RAYS)) * GI_EXPOSURE;
}
vec3 linToOklab(vec3 c) {
float l = 0.41222147 * c.r + 0.53633254 * c.g + 0.05144599 * c.b;
float m = 0.21190350 * c.r + 0.68069955 * c.g + 0.10739696 * c.b;
float s = 0.08830246 * c.r + 0.28171884 * c.g + 0.62997870 * c.b;
float l_ = pow(max(l, 0.0), 1.0 / 3.0);
float m_ = pow(max(m, 0.0), 1.0 / 3.0);
float s_ = pow(max(s, 0.0), 1.0 / 3.0);
return vec3(0.21045426 * l_ + 0.79361779 * m_ - 0.00407205 * s_, 1.97799850 * l_ - 2.42859221 * m_ + 0.45059371 * s_, 0.02590404 * l_ + 0.78277177 * m_ - 0.80867577 * s_);
}
float bayer4(vec2 cell) {
ivec2 p = ivec2(mod(cell, 4.0));
int idx = p.y * 4 + p.x;
const float B[16] = float[16](0.0,8.0,2.0,10.0,12.0,4.0,14.0,6.0,3.0,11.0,1.0,9.0,15.0,7.0,13.0,5.0);
return (B[idx] + 0.5) / 16.0 - 0.5;
}
vec3 quantizeOklab(vec3 linCol, vec2 cell) {
vec3 pal[8] = vec3[8](
vec3(0.015, 0.018, 0.032),
vec3(0.055, 0.075, 0.125),
vec3(0.095, 0.260, 0.360),
vec3(0.320, 0.680, 0.820),
vec3(0.280, 0.105, 0.055),
vec3(0.680, 0.280, 0.075),
vec3(0.950, 0.640, 0.200),
vec3(0.960, 0.940, 0.860)
);
vec3 lab = linToOklab(clamp(linCol, 0.0, 1.0));
lab.x = clamp(lab.x + bayer4(cell) * DITHER_STRENGTH, 0.0, 1.0);
float bestD = 1e9;
vec3 bestC = pal[0];
for (int i = 0; i < 8; i++) {
vec3 pl = linToOklab(pal[i]);
vec3 diff = lab - pl;
float d = diff.x * diff.x * 1.4 + dot(diff.yz, diff.yz);
if (d < bestD) { bestD = d; bestC = pal[i]; }
}
return bestC;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
bool rightSide = uv.x > 0.0;
vec2 cell = floor((uv + 0.5) * PIXEL_GRID);
vec2 p = rightSide ? ((cell + 0.5) / PIXEL_GRID - 0.5) : uv;
float occ = sceneOccluders(p);
vec3 em = sampleEmission(p, iTime);
vec3 gi = radianceCascade(p, iTime);
vec3 col = gi;
if (dot(em, em) > 0.01) col = em;
else if (occ < 0.0) col = vec3(0.04, 0.05, 0.075);
col = col / (1.0 + col);
if (rightSide) {
float px = 1.0 / PIXEL_GRID;
float edge = step(0.0, occ) * step(sceneOccluders(p + vec2(px, 0.0)), 0.0) + step(0.0, occ) * step(sceneOccluders(p + vec2(0.0, px)), 0.0);
col = quantizeOklab(col, cell);
if (edge > 0.5) col = vec3(0.015, 0.018, 0.032);
}
if (abs(uv.x) < 0.0028) col = vec3(0.95);
fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Why they connect
Radiance Cascades runs at the low internal resolution of Pixel-art 3D rendering, marching a coarse scene SDF or the low-res depth buffer, and merges cascades into per-pixel radiance. That hop is composite: radiance is not an io-type input of the pixel-art pass, so it is added to direct light while the low-res frame is shaded. The pixel-art pass writes a point-sampled ldr-image with one-pixel outlines, and OKLab palette quantization maps that ldr-image to the nearest palette colour in OKLab, with an ordered threshold on lightness so soft GI gradients become dithered ramps across palette entries instead of hard bands.
How to build it
Godot 4 or three.js on WebGPU. Render the G-buffer at a small size such as 320×180 into point-sampled targets and snap the camera to a world grid of one low-res pixel, applying the sub-pixel remainder only in the final blit. Run screen-space radiance cascades on that buffer, or a world-space 3D variant against a coarse SDF of the level. Because cascade-0 probe spacing equals the pixel size, every low-res pixel owns a probe, and GI stays stable while the camera slides. Add GI to the posterized direct light, then quantize in OKLab with a 4×4 Bayer offset on L only (see Ordered dithering with Bayer matrices). Precompute the palette in OKLab and anchor the dither pattern consistently with the snapping. Upscale by an integer factor.
Field marks
- Moving lights shift GI slightly and make pixels flip between neighbouring palette colours; add hysteresis or temporal smoothing before quantizing.
- Cascade ringing at interval boundaries turns into visible palette bands.
- A world-space 3D cascade variant needs far more memory than the screen-space form.
- Screen-space cascades lose off-screen light, which is very visible in small fixed frames.
Prior art
No prior art found on 2026-11-29.
Searches run (4)
- arXiv: all:"radiance cascades" AND all:"pixel art" → 0 results
- GitHub repos: "radiance cascades" "pixel art" → 0 results
- arXiv: all:"global illumination" AND all:"palette" AND all:"pixel art" → 0 results
- GitHub repos: "global illumination" palette "pixel art" → 0 results