{
 "id": "svgf",
 "title": "Spatiotemporal Variance-Guided Filtering (SVGF)",
 "aliases": [
  "SVGF",
  "A-SVGF"
 ],
 "domain": "post",
 "subdomain": "path-tracing denoising",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "desktop-gpu",
  "webgpu",
  "unity",
  "unreal"
 ],
 "year_introduced": 2017,
 "inputs": [
  "radiance",
  "gbuffer",
  "normals",
  "depth"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "dynamic",
 "summary": "A real-time denoiser for 1-sample-per-pixel path-traced lighting: it reprojects history, estimates per-pixel variance, and drives an edge-aware wavelet blur whose strength follows that variance.",
 "how_it_works": "Input is noisy irradiance (demodulated from albedo) at roughly one path per pixel plus a G-buffer with normals, depth and motion vectors. Stage one reprojects the previous frame's accumulated colour and its first two luminance moments, rejecting history at disocclusions or when normals and depth differ, and blends it exponentially. The moments give a temporal variance estimate; where history is too young (just revealed pixels) a small spatial neighbourhood supplies the variance instead. Stage two runs several iterations of an edge-avoiding à-trous wavelet filter (see `atrous-wavelet-filter`), with steps 1, 2, 4, 8, 16. Edge-stopping weights combine depth gradient, normal similarity and a luminance term normalised by the smoothed local standard deviation, so noisy regions blur broadly while clean ones keep detail. The first iteration's output is fed back as next frame's history. The filtered irradiance is finally multiplied by albedo again, preserving texture detail.",
 "when_to_use": "Choose it as the default open, well-documented denoiser for diffuse and rough-glossy path-traced or ray-traced GI and shadows at one sample per pixel. Prefer `nvidia-nrd-relax-reblur` when you want a maintained production library that separates diffuse, specular and shadow signals, `open-image-denoise` for offline or interactive final-quality output, and `neural-radiance-caching` or `restir-gi` to reduce the noise at the source before filtering.",
 "cost": {
  "class": "medium",
  "notes": "Five wavelet passes plus a temporal pass at full resolution; the original paper reports about 10 ms at 720p on a Titan X-class GPU in its own test scenes, so budget scales with resolution."
 },
 "failure_modes": [
  "Ghosting and lag in lighting after fast-moving lights or objects because history rejection is only geometric",
  "Over-blurred sharp specular reflections and mirror-like surfaces, since the filter assumes diffuse-like signals",
  "Blotchy low-frequency 'boiling' where variance estimates are noisy after disocclusion",
  "Loss of fine shadow or contact detail at the largest wavelet steps",
  "Needs accurately demodulated albedo and a clean motion-vector buffer; errors become smear"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/3105762.3105770",
   "type": "paper",
   "title": "Spatiotemporal variance-guided filtering",
   "authors": [
    "Christoph Schied",
    "Anton Kaplanyan",
    "Chris Wyman",
    "Anjul Patney",
    "Chakravarty R. Alla Chaitanya",
    "John Burgess",
    "Shiqiu Liu",
    "Carsten Dachsbacher",
    "Aaron Lefohn",
    "Marco Salvi"
   ],
   "year": 2017,
   "venue": "Proceedings of High Performance Graphics",
   "url": "https://doi.org/10.1145/3105762.3105770",
   "ids": {
    "doi": "10.1145/3105762.3105770"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3105762.3105770",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3105762.3105770",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3105762.3105770",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3105762.3105770",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3105762.3105770",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "schied2017spatiotemporal"
  },
  {
   "role": "primary",
   "key": "url:https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced",
   "type": "web",
   "title": "Spatiotemporal Variance-Guided Filtering: Real-Time Reconstruction for Path-Traced Global Illumination",
   "authors": [
    "Schied et al."
   ],
   "year": null,
   "venue": "research.nvidia.com",
   "url": "https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261015193152/https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced",
     "timestamp": "20261015193152"
    },
    "page_title": "Spatiotemporal Variance-Guided Filtering: Real-Time Reconstruction for Path-Traced Global Illumination | Research",
    "host": "research.nvidia.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://research.nvidia.com/publication/2017-07_spatiotemporal-variance-guided-filtering-real-time-reconstruction-path-traced → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.95,
   "__bib": "alspatiotemporal"
  },
  {
   "role": "implementation",
   "key": "gh:nvidiagameworks/falcor",
   "type": "code",
   "title": "NVIDIAGameWorks/Falcor",
   "description": "Real-Time Rendering Framework",
   "authors": [
    "NVIDIAGameWorks"
   ],
   "year": 2017,
   "venue": "GitHub",
   "url": "https://github.com/NVIDIAGameWorks/Falcor",
   "ids": {
    "repo": "NVIDIAGameWorks/Falcor"
   },
   "license": "NOASSERTION",
   "extra": {
    "stars": 3285,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-09-21T15:12:00Z",
    "language": "C++",
    "homepage": "https://developer.nvidia.com/falcor",
    "license_name": "Other"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIAGameWorks/Falcor",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "nvidiagameworks2017nvidiagameworks"
  }
 ],
 "presets": [
  {
   "id": "svgf-live",
   "title": "SVGF — raw 1-spp path-traced variance (left) vs albedo-demodulated variance-guided a-trous wavelet filter (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_VARIANCE": 0.8,
    "P_ATROUS_STR": 1,
    "P_EDGE_STOP": 0.85,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_VARIANCE = 0.80; // P 1-spp Variance [0.2, 1.5, 0.05]\nconst float P_ATROUS_STR = 1.00; // P Wavelet Stride [0.4, 1.8, 0.05]\nconst float P_EDGE_STOP = 0.85; // P Normal/Depth Stop [0.2, 1.5, 0.05]\nconst float P_SPLIT = 0.48; // P 1-spp / SVGF [0.0, 1.0, 0.02]\n\nfloat hash21(vec2 p) {\n  p = fract(p * vec2(127.1, 311.7));\n  p += dot(p, p + 34.5);\n  return fract(p.x * p.y);\n}\n\n// Architectural room with crisp albedo stripes & shadow boundaries for SVGF demodulation + a-trous wavelet test\nvoid evalSVGFScene(vec2 uv, float t, out vec3 irr, out vec3 alb, out vec3 nrm, out float dep) {\n  vec3 ro = vec3(0.0, 0.30, 2.25);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.08, -1.46));\n  vec3 sun = normalize(vec3(0.62 * cos(t * 0.45), 0.75, 0.45));\n\n  dep = 10.0;\n  alb = vec3(0.18, 0.22, 0.28);\n  nrm = vec3(0.0, 0.0, 1.0);\n  irr = vec3(0.28, 0.38, 0.55);\n\n  // Checker floor\n  if (rd.y < -0.005) {\n    float tf = (-0.52 - ro.y) / rd.y;\n    if (tf > 0.05 && tf < dep) {\n      dep = tf;\n      vec3 hp = ro + rd * tf;\n      nrm = vec3(0.0, 1.0, 0.0);\n      float chk = mod(floor(hp.x * 4.0) + floor(hp.z * 4.0), 2.0);\n      alb = mix(vec3(0.26, 0.30, 0.36), vec3(0.82, 0.80, 0.76), chk);\n      float sh = smoothstep(0.25, 0.56, length(hp.xz - vec2(0.0, -0.05)));\n      irr = vec3(1.35, 1.24, 1.08) * (0.18 + 0.82 * sh) + vec3(0.18, 0.32, 0.52) * 0.45;\n    }\n  }\n\n  // Faceted plinth box + sphere\n  vec3 sc = vec3(0.0, -0.10, -0.05);\n  vec3 oc = ro - sc;\n  float b = dot(oc, rd), d = b * b - (dot(oc, oc) - 0.42 * 0.42);\n  if (d > 0.0) {\n    float ts = -b - sqrt(d);\n    if (ts > 0.05 && ts < dep) {\n      dep = ts;\n      vec3 hp = ro + rd * ts;\n      nrm = normalize(hp - sc);\n      float band = step(0.5, fract(hp.y * 12.0 + hp.x * 4.0));\n      alb = mix(vec3(0.88, 0.42, 0.20), vec3(0.92, 0.86, 0.72), band);\n      float ndl = max(dot(nrm, sun), 0.0);\n      irr = vec3(1.42, 1.28, 1.08) * ndl + vec3(0.22, 0.42, 0.68) * (0.5 + 0.5 * nrm.y) + vec3(0.40, 0.24, 0.16) * max(-nrm.y, 0.0);\n    }\n  }\n\n  // Side accent monolith\n  vec3 bc = vec3(-0.75, -0.04, -0.45);\n  vec3 br = vec3(0.22, 0.48, 0.24);\n  vec3 invR = 1.0 / (rd + vec3(1e-6));\n  vec3 t0 = (bc - br - ro) * invR;\n  vec3 t1 = (bc + br - ro) * invR;\n  vec3 tnV = min(t0, t1);\n  vec3 tfV = max(t0, t1);\n  float tn = max(max(tnV.x, tnV.y), tnV.z);\n  float tf = min(min(tfV.x, tfV.y), tfV.z);\n  if (tf > max(tn, 0.05) && tn < dep) {\n    dep = tn;\n    vec3 hp = ro + rd * tn;\n    vec3 lp = (hp - bc) / br;\n    vec3 ap = abs(lp);\n    nrm = (ap.x > ap.y && ap.x > ap.z) ? vec3(sign(lp.x), 0.0, 0.0)\n        : (ap.y > ap.z ? vec3(0.0, sign(lp.y), 0.0) : vec3(0.0, 0.0, sign(lp.z)));\n    alb = vec3(0.18, 0.72, 0.82);\n    irr = vec3(1.35, 1.24, 1.08) * max(dot(nrm, sun), 0.0) + vec3(0.24, 0.34, 0.48);\n  }\n}\n\nvec3 noisyDemodIrr(vec2 fc, float varAmp, float t, out vec3 alb, out vec3 nrm, out float dep) {\n  vec2 uv = (fc - 0.5 * iResolution.xy) / iResolution.y;\n  vec3 irr;\n  evalSVGFScene(uv, t, irr, alb, nrm, dep);\n  vec2 p = floor(fc);\n  float fr = floor(t * 12.0) * 0.17;\n  vec3 rnd = vec3(\n    hash21(p + vec2(fr * 23.1, 9.7)),\n    hash21(p + vec2(51.3, fr * 17.3)),\n    hash21(p + vec2(fr * 71.7, 37.9))\n  ) - 0.5;\n  return max(irr + rnd * varAmp * (0.5 + 0.75 * irr), 0.0);\n}\n\nfloat luma(vec3 c) {\n  return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  float varAmp = clamp(P_VARIANCE, 0.1, 1.6);\n  float stride = clamp(P_ATROUS_STR, 0.4, 2.2);\n  float edgeStop = clamp(P_EDGE_STOP, 0.1, 1.8);\n\n  vec3 cAlb, cNrm;\n  float cDep;\n  vec3 cIrr = noisyDemodIrr(fragCoord, varAmp, iTime, cAlb, cNrm, cDep);\n  vec3 col = cIrr * cAlb;\n\n  if (screenX >= split) {\n    // Right: SVGF variance-guided edge-stopping a-trous wavelet filter on demodulated irradiance!\n    // Step 1: Estimate local luminance moments (mu1, mu2 -> variance) in 3x3 neighborhood\n    float m1 = 0.0;\n    float m2 = 0.0;\n    for (int j = -1; j <= 1; j++) {\n      for (int i = -1; i <= 1; i++) {\n        vec3 qa, qn; float qd;\n        float yl = luma(noisyDemodIrr(fragCoord + vec2(float(i), float(j)), varAmp, iTime, qa, qn, qd));\n        m1 += yl;\n        m2 += yl * yl;\n      }\n    }\n    m1 /= 9.0;\n    m2 /= 9.0;\n    float localVar = max(m2 - m1 * m1, 0.002);\n    float phiL = 4.0 * sqrt(localVar) + 0.05;\n\n    // Step 2: 5x5 a-trous wavelet pass with B3-spline kernel [1/16, 1/4, 3/8, 1/4, 1/16]\n    float kW[5];\n    kW[0] = 0.0625; kW[1] = 0.25; kW[2] = 0.375; kW[3] = 0.25; kW[4] = 0.0625;\n    float cLuma = luma(cIrr);\n    vec3 acc = vec3(0.0);\n    float wSum = 0.0;\n\n    for (int j = -2; j <= 2; j++) {\n      for (int i = -2; i <= 2; i++) {\n        vec2 off = vec2(float(i), float(j)) * (2.0 * stride);\n        vec3 qAlb, qNrm;\n        float qDep;\n        vec3 qIrr = noisyDemodIrr(fragCoord + off, varAmp, iTime, qAlb, qNrm, qDep);\n        float wKern = kW[i + 2] * kW[j + 2];\n        float wN = pow(max(dot(cNrm, qNrm), 0.0), 28.0 * edgeStop);\n        float wZ = exp(-abs(cDep - qDep) * 5.0 * edgeStop);\n        float wL = exp(-abs(cLuma - luma(qIrr)) / max(phiL, 0.02));\n        float w = wKern * wN * wZ * wL;\n        acc += qIrr * w;\n        wSum += w;\n      }\n    }\n    // Re-modulate filtered irradiance by noise-free G-buffer albedo\n    col = (acc / max(wSum, 1e-4)) * cAlb;\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.95, 0.98, 1.0), sep);\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "svgf",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:27.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5651,
      "std": 0.2435,
      "min": 0.0074,
      "max": 0.9485
     },
     "image": "/specimens/svgf-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "atrous-wavelet-filter",
  "nvidia-nrd-relax-reblur",
  "open-image-denoise",
  "temporal-anti-aliasing",
  "restir-gi",
  "restir-di",
  "path-tracing"
 ],
 "extends": [
  "atrous-wavelet-filter"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "restir-di",
   "why": "ReSTIR reduces direct-lighting variance upstream; SVGF then cleans the remaining per-pixel noise."
  },
  {
   "id": "temporal-anti-aliasing",
   "why": "SVGF's denoised irradiance is remodulated by albedo and then goes through TAA for edge and specular stability."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/post/svgf.json"
 },
 "solves": [
  "path traced one sample per pixel image is very noisy",
  "denoise ray traced global illumination in real time",
  "noisy indirect lighting flickers between frames",
  "need a temporal denoiser that keeps texture detail",
  "ray traced shadows look grainy at low sample counts"
 ],
 "authority": "Schied et al., 2017",
 "url": "https://texelatlas.vercel.app/t/svgf/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 45.88,
  "tier": "heavy",
  "p50_ms": 1.5093,
  "p95_ms": 1.6104,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "svgf-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 43.57,
   "tier": "heavy",
   "p50_ms": 0.6927,
   "p95_ms": 0.7057,
   "speedup_x": 2.18,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 30.56,
   "tier": "heavy",
   "p50_ms": 0.8801,
   "p95_ms": 0.8876,
   "speedup_x": 1.71,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}