Surfel-Based Global Illumination (GIBS)
Covers visible geometry with small oriented discs (surfels) that cache irradiance, updated by hardware ray tracing and reused across frames; pixels shade by gathering nearby surfels. No bake, no UVs.
Also known as GIBS, surfel cache
In the family Light transport & global illumination, hybrid tracing GI
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | HDRP uses Adaptive Probe Volumes, SSGI, and RTGI rather than GIBS-style surfel global illumination. |
| Unreal 5.7 | Built in | Lumen Global Illumination parameterizes scene geometry into Surface Cache Mesh Cards and world-space Radiance Cache probes docs |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Surfels are position, normal and radius records spawned on demand from the G-buffer. Each frame the pipeline tests screen tiles for coverage by existing surfels; where coverage is insufficient, new surfels are spawned (and ones that fall out of use are recycled), so the cache follows the camera. A spatial hash or grid lets any point quickly find the surfels around it.
Each surfel owns a small budget of rays per frame. It traces them with hardware ray tracing, shading hits using the surfel cache itself as a source of multi-bounce light, and blends the new samples into the stored irradiance (stored as a low-order basis or a small octahedral map). Allocating more rays to surfels that are new or whose result changed concentrates work where it matters.
At shading time, a pixel finds nearby surfels whose disks contain its position, weights them by distance and normal, and sums their irradiance. The result is combined with other contributors in a lighting buffer.
When to choose it
Reach for it when
- dynamic gi without probes or baked data
- indirect light on large open worlds in real time
- diffuse bounce that follows geometry detail
- gi must work with fully dynamic scenes cheaply
Choose it for fully dynamic diffuse GI in an engine where baking or UV unwrapping is not acceptable, you can afford hardware ray tracing, and the camera sees a bounded amount of geometry.
Prefer Dynamic Diffuse Global Illumination (DDGI) when you want a regular grid with simple lookups and a fixed memory footprint. Prefer SDF-Based Software Ray Tracing GI (Lumen-style) for SDF-based software tracing and large scenes. Prefer ReSTIR GI: Path Resampling for Real-Time Path Tracing when you need per-pixel indirect accuracy. Prefer Lightmap Baking when the scene is static and you need the lowest runtime cost.
Field marks
- Surfel popping and temporal instability when surfels spawn or retire as the camera moves
- Light leaking at thin walls or corners where a surfel disk spans two surfaces
- Coverage gaps and noise in fast-moving or newly revealed areas until the cache converges
- Large dynamic moving objects can invalidate surfels and produce trailing lighting
Presets
Surfel GI (GIBS) — world-space oriented surfel disks (left) vs filtered surfel irradiance (right)
{
"P_SURFEL_SIZE": 0.16,
"P_BOUNCE_GAIN": 1.3,
"P_DISK_EDGE": 0.85,
"P_SPLIT": 0.48
}Show GLSL (146 lines)
const float P_SURFEL_SIZE = 0.16; // P Surfel Radius [0.08, 0.28, 0.01]
const float P_BOUNCE_GAIN = 1.30; // P Indirect GI [0.3, 2.2, 0.05]
const float P_DISK_EDGE = 0.85; // P Disk Outlines [0.0, 1.5, 0.05]
const float P_SPLIT = 0.48; // P Surfels / GI Split [0.0, 1.0, 0.02]
vec3 hash33(vec3 p) {
p = fract(p * vec3(0.1031, 0.1030, 0.0973));
p += dot(p, p.yxz + 33.33);
return fract((p.xxy + p.yxx) * p.zyx);
}
float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
vec2 mapScene(vec3 p) {
vec2 res = vec2(p.y + 0.85, 1.0);
float dC = 1.05 - p.y; if (dC < res.x) res = vec2(dC, 1.0);
float dB = p.z + 1.42; if (dB < res.x) res = vec2(dB, 1.0);
float dL = p.x + 1.30; if (dL < res.x) res = vec2(dL, 2.0);
float dR = 1.30 - p.x; if (dR < res.x) res = vec2(dR, 3.0);
float dSph = length(p - vec3(-0.32, -0.45, -0.20)) - 0.39;
if (dSph < res.x) res = vec2(dSph, 4.0);
float dBlk = sdBox(p - vec3(0.50, -0.50, -0.32), vec3(0.28, 0.35, 0.28)) - 0.02;
if (dBlk < res.x) res = vec2(dBlk, 4.0);
return res;
}
vec3 calcNormal(vec3 p) {
vec2 e = vec2(0.0022, 0.0);
return normalize(vec3(
mapScene(p + e.xyy).x - mapScene(p - e.xyy).x,
mapScene(p + e.yxy).x - mapScene(p - e.yxy).x,
mapScene(p + e.yyx).x - mapScene(p - e.yyx).x
));
}
vec3 evalBounce(vec3 p, vec3 n, float t) {
vec3 sunHit = vec3(0.42 * sin(t * 0.6), -0.84, -0.25);
float dSun = length(p - sunHit);
vec3 warmBounce = vec3(1.25, 0.72, 0.28) * exp(-dSun * 1.15) * (0.35 + 0.65 * max(dot(n, normalize(sunHit - p)), 0.0));
vec3 redWall = vec3(0.90, 0.22, 0.20) * clamp(1.0 - (p.x + 1.30) * 0.5, 0.0, 1.0) * 0.55;
vec3 tealWall = vec3(0.14, 0.76, 0.82) * clamp(1.0 - (1.30 - p.x) * 0.5, 0.0, 1.0) * 0.55;
float ao = clamp(0.38 + 0.62 * mapScene(p + n * 0.26).x / 0.26, 0.18, 1.0);
return (warmBounce + redWall + tealWall + vec3(0.14, 0.16, 0.22)) * ao;
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool isSmooth = screenX >= split;
float sRad = clamp(P_SURFEL_SIZE, 0.07, 0.30);
float giGain = clamp(P_BOUNCE_GAIN, 0.2, 2.4);
float edgeVis = clamp(P_DISK_EDGE, 0.0, 1.5);
vec3 ro = vec3(0.0, 0.04, 2.35);
vec3 rd = normalize(vec3(uv, -1.52));
vec3 col = vec3(0.02);
float t = 0.0;
float matId = 0.0;
bool hit = false;
for (int i = 0; i < 64; i++) {
vec2 h = mapScene(ro + rd * t);
if (h.x < 0.002) { hit = true; matId = h.y; break; }
t += h.x;
if (t > 9.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p);
vec3 alb = vec3(0.76, 0.76, 0.78);
if (matId > 1.5 && matId < 2.5) alb = vec3(0.90, 0.24, 0.20);
if (matId > 2.5 && matId < 3.5) alb = vec3(0.14, 0.74, 0.80);
vec3 lPos = vec3(0.42 * sin(iTime * 0.6), 0.94, -0.20);
vec3 lDir = normalize(lPos - p);
float ndl = max(dot(n, lDir), 0.0);
// Allocate world-space surfels in a 3D uniform hash grid and gather Mahalanobis disk weights
float cell = sRad * 1.15;
vec3 cid = floor(p / cell);
vec3 surfelIrr = vec3(0.0);
float wTot = 0.0;
float bestD = 1e5;
vec3 bestIdCol = vec3(0.5);
vec3 bestIrr = vec3(0.0);
float diskRim = 0.0;
for (int dz = -1; dz <= 1; dz++) {
for (int dy = -1; dy <= 1; dy++) {
for (int dx = -1; dx <= 1; dx++) {
vec3 nb = cid + vec3(float(dx), float(dy), float(dz));
vec3 rnd = hash33(nb);
vec3 sp = (nb + 0.18 + 0.64 * rnd) * cell;
// Project surfel disk onto surface plane so disks tile cleanly across geometry
vec3 sOnSurf = sp - n * dot(sp - p, n);
float d = length(p - sOnSurf);
float q = d / max(sRad, 0.04);
if (q < 1.0) {
// Smooth cubic surfel kernel weight (1 - q)^2
float w = (1.0 - q) * (1.0 - q);
vec3 irr = evalBounce(sOnSurf, n, iTime) * giGain;
surfelIrr += irr * w;
wTot += w;
diskRim = max(diskRim, smoothstep(0.09, 0.015, abs(q - 0.86)));
}
if (d < bestD) {
bestD = d;
bestIdCol = 0.35 + 0.65 * hash33(nb + 19.7);
bestIrr = evalBounce(sOnSurf, n, iTime) * giGain;
}
}
}
}
vec3 filteredGI = (wTot > 1e-4) ? (surfelIrr / wTot) : evalBounce(p, n, iTime) * giGain;
if (!isSmooth) {
// Left: raw discrete world-space surfel disks showing cached radiance & allocation tiling
float inDisk = smoothstep(sRad * 0.94, sRad * 0.84, bestD);
vec3 diskFill = mix(bestIrr * 0.85, bestIdCol * 0.45 + bestIrr * 0.65, 0.25);
col = mix(vec3(0.05, 0.07, 0.10), diskFill, inDisk);
col = mix(col, vec3(0.95, 0.97, 1.0), diskRim * 0.42 * min(edgeVis, 1.2));
} else {
// Right: smoothly filtered surfel GI + direct key light
col = alb * (ndl * 0.55 + filteredGI);
}
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| surfel-gi-live | Tesla T4 1920x1080 | 69.8× baseline (extreme) · 2.16 ms / 2.31 ms | opengl-timer-query · 36 frames · GPU Weight Atlas · Colab T4 sweep |
| surfel-gi-live | NVIDIA L4 1920x1080 | 60.0× baseline (heavy) · 0.954 ms / 0.974 ms · 2.3× faster on L4 | opengl-timer-query · Cross-architecture validation |
| surfel-gi-live | NVIDIA A100-SXM4-40GB 1920x1080 | 47.9× baseline (heavy) · 1.38 ms / 1.38 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Crosses
- Dynamic surfel GI inside carved snow trenches and footprints: Deep footprints, vehicle tracks, and plowed snow berms dynamically shift real-time bounce lighting — casting cool blue sky-filled shadows inside fresh trenches and warm sunlight bounce off steep compressed snow walls.
- ReSTIR GI: Path Resampling for Real-Time Path Tracing: Surfel irradiance gives a stable low-frequency fallback while resampling adds detail.
Sources
- primaryHenrik Halen, Andreas Brinck, Kyle Hayward, Xiangshun Bei. Global Illumination Based on Surfels. SIGGRAPH 2021 Advances in Real-Time Rendering.Verified via live page · 2026-11-29