---
id: "instant-radiosity"
title: "Instant Radiosity (Virtual Point Lights)"
aliases: [VPL, many-lights GI]
domain: "gi"
stage: "lighting"
realtime: "interactive"
platforms: [desktop-gpu, cpu]
year_introduced: 1997
inputs: [mesh, gbuffer]
outputs: [radiance]
style: "photoreal"
dynamic: "dynamic"
cost: "heavy"
authority: "Keller, 1997"
url: "https://texelatlas.vercel.app/t/instant-radiosity/"
sources_verified_at: "2026-11-29"
---
# Instant Radiosity (Virtual Point Lights) (Keller, 1997)

> Approximates indirect light by tracing random particles from the light and placing a virtual point light at each hit, then lighting the scene with all those point lights using standard shadow-mapped direct lighting.

## Reach for it when

- want dynamic diffuse bounce light using ordinary shadow maps
- prototype global illumination quickly
- indirect lighting without precomputed bake
- approximate light bounces with many small lights
- colour bleeding in a real-time scene

## How it works

Indirect illumination is just direct illumination from surfaces that were lit. Instant radiosity makes this literal. A quasi-random walk is traced from each light source. Each time the particle hits a diffuse surface, the renderer drops a **virtual point light** there with a flux scaled by surface reflectance and the walk's survival probability, and the walk continues by Russian roulette.

The scene is then rendered as if lit by a few hundred to thousands of ordinary point lights, each with its own shadow map or ray cast. Because the VPLs form a Monte Carlo estimator of the path integral, the sum converges to indirect lighting. The same VPL set can be reused across frames (with changes only when lights move) and across the whole image, which is why this gave early interactive GI on GPUs.

The big flaw is that a point light has an unbounded `1/r^2` near-field, so surfaces close to a VPL show bright splotches. Clamping the contribution or using bounded-kernel virtual sphere lights trades this singularity for bias.

## When to use it

Choose it to prototype dynamic diffuse GI with ordinary shadow mapping, or as the conceptual basis for many-light rendering.

Prefer [reflective-shadow-maps](reflective-shadow-maps) when only one-bounce indirect from a single light is needed and no shadow maps per VPL are affordable. Prefer [lightcuts](lightcuts) or [light-bvh-many-lights](light-bvh-many-lights) when thousands of VPLs must be gathered efficiently and cleanly. Prefer [path-tracing](path-tracing) for unbiased final images and [ddgi](ddgi) for today's real-time dynamic GI.

## Cost

heavy — Shadow maps per VPL dominate; interactive on 1997-era hardware only for small VPL counts, and modern variants use imperfect shadow maps or ray tracing.
Measured GPU Weight: 30.53× baseline (heavy) — 0.9587 ms median / 1.0267 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 30.37× baseline (heavy) — 0.4799 ms median (2× faster on L4).
Ampere A100 scaling: 18.57× baseline (moderate) — 0.5348 ms median (1.79× faster on A100).

## Failure modes

- Bright splotches and spikes near each VPL because of the singular 1/r^2 falloff
- Banding or a visible grid of overlapping VPL shadows when the VPL count is low
- Low-frequency-only: glossy transfer through VPLs is poor and very bright lamps cause noise
- Cost grows linearly with the VPL count times pixels unless gathered hierarchically

## Dataflow

- Inputs: mesh, gbuffer
- Outputs: radiance
- Platforms: desktop-gpu, cpu

## Presets

### Instant Radiosity (VPLs) — bounce-spawned Virtual Point Lights & singularity clamp control (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_VPL_GAIN": 1.3,
  "P_CLAMP_EPS": 0.28,
  "P_SHOW_VPLS": 1,
  "P_BEAM_SPEED": 1
}
```

```glsl
const float P_VPL_GAIN = 1.3; // P VPL Bounce Gain [0.0, 2.6, 0.05]
const float P_CLAMP_EPS = 0.28; // P Clamp Radius [0.04, 0.75, 0.02]
const float P_SHOW_VPLS = 1.0; // P Show VPL Nodes [0.0, 1.5, 0.05]
const float P_BEAM_SPEED = 1.0; // P Light Orbit [0.0, 2.5, 0.05]

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 mapRoom(vec3 p) {
  vec2 res = vec2(1.0 + p.y, 1.0); // floor
  float cD = 1.0 - p.y; if (cD < res.x) res = vec2(cD, 1.0);
  float bD = 1.45 + p.z; if (bD < res.x) res = vec2(bD, 1.0);
  float lD = 1.45 + p.x; if (lD < res.x) res = vec2(lD, 2.0); // ruby red wall
  float rD = 1.45 - p.x; if (rD < res.x) res = vec2(rD, 3.0); // emerald green wall

  float dB1 = sdBox(p - vec3(-0.48, -0.45, -0.45), vec3(0.28, 0.55, 0.28)) - 0.02;
  if (dB1 < res.x) res = vec2(dB1, 4.0);
  float dB2 = sdBox(p - vec3(0.55, -0.68, -0.15), vec3(0.30, 0.32, 0.30)) - 0.02;
  if (dB2 < res.x) res = vec2(dB2, 4.0);
  return res;
}

vec3 calcNormal(vec3 p) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapRoom(p + e.xyy).x - mapRoom(p - e.xyy).x,
    mapRoom(p + e.yxy).x - mapRoom(p - e.yxy).x,
    mapRoom(p + e.yyx).x - mapRoom(p - e.yyx).x
  ));
}

vec3 getAlbedo(float id) {
  if (id < 1.5) return vec3(0.75, 0.75, 0.74);
  if (id < 2.5) return vec3(0.90, 0.16, 0.14);
  if (id < 3.5) return vec3(0.14, 0.80, 0.42);
  return vec3(0.84, 0.84, 0.82);
}

// Compute 6 deterministic first-bounce Virtual Point Lights spawned from the primary light source
void getVPL(int k, vec3 lPos, out vec3 vPos, out vec3 vNorm, out vec3 vFlux) {
  if (k == 0) {
    vPos = vec3(-1.44, -0.10, -0.25); vNorm = vec3(1.0, 0.0, 0.0); vFlux = vec3(1.0, 0.18, 0.15);
  } else if (k == 1) {
    vPos = vec3(-1.44, 0.35, -0.82); vNorm = vec3(1.0, 0.0, 0.0); vFlux = vec3(0.95, 0.16, 0.14);
  } else if (k == 2) {
    vPos = vec3(1.44, -0.15, -0.35); vNorm = vec3(-1.0, 0.0, 0.0); vFlux = vec3(0.16, 0.92, 0.48);
  } else if (k == 3) {
    vPos = vec3(1.44, 0.32, -0.92); vNorm = vec3(-1.0, 0.0, 0.0); vFlux = vec3(0.14, 0.86, 0.44);
  } else if (k == 4) {
    vPos = vec3(0.05, -0.99, -0.45); vNorm = vec3(0.0, 1.0, 0.0); vFlux = vec3(0.88, 0.85, 0.78);
  } else {
    vPos = vec3(0.0, -0.05, -1.44); vNorm = vec3(0.0, 0.0, 1.0); vFlux = vec3(0.86, 0.84, 0.80);
  }
  // Modulate each VPL flux by incident direct illumination from moving primary ceiling lamp
  vec3 toL = lPos - vPos;
  float d = length(toL);
  float inc = max(dot(vNorm, toL / max(d, 1e-4)), 0.0) / (0.45 + 0.35 * d * d);
  vFlux *= inc * 2.2;
}

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 tAnim = iTime * max(P_BEAM_SPEED, 0.0);
  float vplGain = max(P_VPL_GAIN, 0.0);
  float clampEps = max(P_CLAMP_EPS, 0.03);
  float showVpls = clamp(P_SHOW_VPLS, 0.0, 1.6);

  vec3 ro = vec3(0.0, 0.04, 2.38);
  vec3 rd = normalize(vec3(uv, -1.48));
  vec3 lightPos = vec3(0.68 * sin(tAnim * 0.65), 0.78, -0.35 + 0.45 * cos(tAnim * 0.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 = mapRoom(ro + rd * t);
    if (h.x < 0.002) { hit = true; matId = h.y; break; }
    t += h.x;
    if (t > 10.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = calcNormal(p);
    vec3 alb = getAlbedo(matId);

    // Direct primary light with shadow ray
    vec3 toL = lightPos - p;
    float dL = length(toL);
    vec3 lDir = toL / max(dL, 1e-4);
    float sh = 1.0;
    float ts = 0.03;
    for (int i = 0; i < 22; i++) {
      float dh = mapRoom(p + lDir * ts).x;
      if (dh < 0.004) { sh = 0.0; break; }
      ts += dh;
      if (ts > dL - 0.08) break;
    }
    vec3 direct = alb * vec3(1.9, 1.75, 1.45) * max(dot(n, lDir), 0.0) * sh / (0.5 + 0.45 * dL * dL);

    // Instant Radiosity VPL Gather with adjustable weak-singularity clamp (1 / max(r^2, eps^2))
    vec3 vplBounce = vec3(0.0);
    vec3 vplMarker = vec3(0.0);
    for (int k = 0; k < 6; k++) {
      vec3 vp, vn, vf;
      getVPL(k, lightPos, vp, vn, vf);
      vec3 toV = vp - p;
      float r2 = dot(toV, toV);
      float r = sqrt(max(r2, 1e-5));
      vec3 dv = toV / r;
      float cosP = max(dot(n, dv), 0.0);
      float cosV = max(dot(vn, -dv), 0.0);
      // Geometry factor clamped by P_CLAMP_EPS^2 to control bright VPL corner singularities!
      float gTerm = (cosP * cosV) / max(r2, clampEps * clampEps);
      vplBounce += vf * gTerm * 0.24;

      // Render glowing VPL emitter beacon at bounce site
      if (showVpls > 0.01) {
        float dMark = length(p - vp);
        vplMarker += (vf * 1.4 + vec3(0.35)) * smoothstep(0.095, 0.028, dMark) * showVpls;
      }
    }

    col = direct + alb * vplBounce * vplGain + vplMarker;
  }

  // Primary orbiting light bulb flare in space
  vec3 toBulb = lightPos - ro;
  float proj = dot(toBulb, rd);
  if (proj > 0.0 && proj < t) {
    float db = length(ro + rd * proj - lightPos);
    col += vec3(2.8, 2.4, 1.7) * exp(-db * 22.0);
  }

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).

## Combines with

- [Lightcuts](https://texelatlas.vercel.app/t/lightcuts.md): A light cut clusters the VPL set so each pixel evaluates only a small subset.

## Sources

1. [primary] Alexander Keller (1997) Instant radiosity. Proceedings of the 24th annual conference on Computer graphics and interactive techniques  - SIGGRAPH '97. https://doi.org/10.1145/258734.258769 (verified via crossref on 2026-11-29)

## Cite this entry

Texel. "Instant Radiosity (Virtual Point Lights)." https://texelatlas.vercel.app/t/instant-radiosity/ (accessed 2026-12-01).
