{
 "id": "nvidia-nrd-relax-reblur",
 "title": "NVIDIA Real-time Denoisers (ReBLUR, ReLAX)",
 "aliases": [
  "NRD",
  "ReBLUR",
  "ReLAX",
  "SIGMA"
 ],
 "domain": "post",
 "subdomain": "path-tracing denoising",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "desktop-gpu",
  "unreal",
  "unity"
 ],
 "year_introduced": 2021,
 "inputs": [
  "radiance",
  "gbuffer",
  "normals",
  "depth"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "dynamic",
 "summary": "A spatio-temporal denoising library with separate denoisers for diffuse, specular and shadow signals from sparse ray tracing, built for engine integration across D3D12, Vulkan and D3D11.",
 "how_it_works": "NRD is not one filter but a set of denoisers sharing a common input contract: noisy hit signals with hit distance, view-space depth or linear Z, world or view normals with roughness, and motion vectors. **ReBLUR** is a recurrent, hit-distance-aware blur: it accumulates history with reprojection, estimates how much history there is per pixel, and sizes a blur kernel from accumulation count, roughness and the distance the ray travelled, so contact reflections stay sharp while distant ones soften. **ReLAX** is closer to SVGF: it was designed for ReSTIR-style signals, keeps luminance variance, clamps history against a local neighbourhood and runs an à-trous cascade, and it expects diffuse and specular radiance pre-divided by albedo or Fresnel. **SIGMA** denoises soft shadows from penumbra-distance inputs. Engines pass in packed inputs, call the dispatch list NRD emits, and remodulate the result.",
 "when_to_use": "Choose it for shipping real-time ray-traced games or renderers that need reliable diffuse, specular and shadow denoising with documented input packing and temporal stability. Prefer `svgf` when you want a compact algorithm you can read and port to WebGPU, `open-image-denoise` for final-frame offline output, and learned reconstruction such as `dlss` when ray reconstruction is available on the target hardware.",
 "cost": {
  "class": "medium",
  "notes": "Runs as a multi-pass compute chain per signal; budget depends on how many signals (diffuse, specular, shadows) and the resolution. No benchmark figures are stated here."
 },
 "failure_modes": [
  "Wrong input packing (hit distance, roughness, normals encoding, pre-division by albedo) is the most common cause of smearing or dark results",
  "Lag and ghosting in indirect lighting on fast changes, and disocclusion trails behind moving objects",
  "Over-blurring of glossy reflections when hit distance is missing or inaccurate",
  "Residual low-frequency flicker when upstream sampling changes noise distribution frame to frame",
  "Sample-based integration requires a proprietary-licensed binary/headers; check redistribution terms"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "gh:nvidia-rtx/nrd",
   "type": "code",
   "title": "NVIDIA-RTX/NRD",
   "description": "NVIDIA Real-time Denoising (NRD) library",
   "authors": [
    "NVIDIA-RTX"
   ],
   "year": 2020,
   "venue": "GitHub",
   "url": "https://github.com/NVIDIA-RTX/NRD",
   "ids": {
    "repo": "NVIDIA-RTX/NRD"
   },
   "license": "NOASSERTION",
   "extra": {
    "stars": 896,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-27T05:52:05Z",
    "language": "HLSL",
    "homepage": null,
    "license_name": "Other"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "nvidiartx2020nvidia"
  },
  {
   "role": "implementation",
   "key": "gh:nvidia-rtx/nrd-sample",
   "type": "code",
   "title": "NVIDIA-RTX/NRD-Sample",
   "description": "NRD sample and sandbox, demonstrating path tracing and denoising best practices",
   "authors": [
    "NVIDIA-RTX"
   ],
   "year": 2021,
   "venue": "GitHub",
   "url": "https://github.com/NVIDIA-RTX/NRD-Sample",
   "ids": {
    "repo": "NVIDIA-RTX/NRD-Sample"
   },
   "license": null,
   "extra": {
    "stars": 217,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-27T08:27:47Z",
    "language": "C++",
    "homepage": null,
    "license_name": null
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/NVIDIA-RTX/NRD-Sample",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "nvidiartx2021nvidia"
  }
 ],
 "presets": [
  {
   "id": "nvidia-nrd-relax-reblur-live",
   "title": "NVIDIA NRD (ReBLUR / ReLAX) — 1-spp noisy ray-traced specular & shadow (left) vs hit-distance-aware denoised output (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_ROUGHNESS": 0.34,
    "P_HIT_DIST_AWARE": 1,
    "P_NOISE_AMP": 0.8,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_ROUGHNESS = 0.34; // P Floor Roughness [0.08, 0.78, 0.02]\nconst float P_HIT_DIST_AWARE = 1.00; // P Hit-Dist Scaling [0.0, 1.0, 0.05]\nconst float P_NOISE_AMP = 0.80; // P Ray Noise [0.2, 1.4, 0.05]\nconst float P_SPLIT = 0.48; // P 1-spp / NRD ReBLUR [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// Scene with glossy floor reflecting emissive neon pillars at varying hit distances (near contact vs far reflection!)\nvoid evalNRDScene(vec2 uv, float rough, float t, out vec3 clean, out float hitDist, out vec3 nrm, out float linZ) {\n  vec3 ro = vec3(0.35 * sin(t * 0.45), 0.42, 2.25);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.10, -1.45));\n  vec3 bg = mix(vec3(0.03, 0.04, 0.07), vec3(0.08, 0.12, 0.20), smoothstep(-0.1, 0.6, rd.y));\n\n  clean = bg;\n  hitDist = 6.0;\n  nrm = vec3(0.0, 0.0, 1.0);\n  linZ = 12.0;\n\n  // Emissive cyan & amber pillars\n  vec3 p1c = vec3(-0.55, 0.15, -0.35);\n  vec3 p2c = vec3(0.58, 0.18, -0.85);\n  vec3 p3c = vec3(0.05, -0.05, 0.28);\n\n  // Glossy ground plane y = -0.42\n  if (rd.y < -0.005) {\n    float tf = (-0.42 - ro.y) / rd.y;\n    if (tf > 0.05 && tf < 14.0) {\n      linZ = tf;\n      vec3 hp = ro + rd * tf;\n      nrm = vec3(0.0, 1.0, 0.0);\n      vec3 r = reflect(rd, nrm);\n\n      // Compute reflection hit distance to nearest pillar/sphere\n      float d1 = length(hp.xz - p1c.xz);\n      float d2 = length(hp.xz - p2c.xz);\n      float d3 = length(hp.xz - p3c.xz);\n      hitDist = min(d1, min(d2, d3));\n\n      // Reflection lobe widens physically with hitDist * roughness (core ReBLUR principle!)\n      float lobe = rough * (0.18 + 0.65 * hitDist);\n      vec3 refl = bg;\n      vec3 to1 = normalize(vec3(p1c.x, 0.25, p1c.z) - hp);\n      vec3 to2 = normalize(vec3(p2c.x, 0.25, p2c.z) - hp);\n      vec3 to3 = normalize(vec3(p3c.x, -0.05, p3c.z) - hp);\n      refl += vec3(0.18, 0.92, 1.0) * exp(-pow(1.0 - max(dot(r, to1), 0.0), 1.0) / max(0.008 + lobe * lobe * 0.25, 0.005)) * 1.7 / (0.4 + d1 * 0.6);\n      refl += vec3(1.0, 0.48, 0.18) * exp(-pow(1.0 - max(dot(r, to2), 0.0), 1.0) / max(0.008 + lobe * lobe * 0.25, 0.005)) * 1.9 / (0.4 + d2 * 0.6);\n      refl += vec3(0.95, 0.85, 0.55) * exp(-pow(1.0 - max(dot(r, to3), 0.0), 1.0) / max(0.006 + lobe * lobe * 0.20, 0.004)) * 1.3 / (0.3 + d3 * 0.7);\n\n      // Contact shadow directly under foreground sphere p3c\n      float contactSh = smoothstep(0.16, 0.44, d3);\n      float fres = 0.08 + 0.88 * pow(1.0 - max(dot(nrm, -rd), 0.0), 4.0);\n      vec3 floorBase = vec3(0.12, 0.13, 0.16) * (0.35 + 0.65 * contactSh);\n      clean = mix(floorBase, refl * (0.45 + 0.55 * contactSh), fres);\n    }\n  }\n\n  // Intersect foreground sphere (p3c, R=0.35)\n  vec3 oc = ro - p3c;\n  float b = dot(oc, rd), c = dot(oc, oc) - 0.35 * 0.35;\n  float disc = b * b - c;\n  if (disc > 0.0) {\n    float ts = -b - sqrt(disc);\n    if (ts > 0.05 && ts < linZ) {\n      linZ = ts;\n      vec3 hp = ro + rd * ts;\n      nrm = normalize(hp - p3c);\n      hitDist = 0.12;\n      vec3 l1 = normalize(p1c - hp);\n      vec3 l2 = normalize(p2c - hp);\n      clean = vec3(0.24, 0.26, 0.30) * 0.3\n            + vec3(0.18, 0.92, 1.0) * max(dot(nrm, l1), 0.0) * 0.95\n            + vec3(1.0, 0.52, 0.22) * max(dot(nrm, l2), 0.0) * 0.85\n            + vec3(0.9, 0.94, 1.0) * pow(max(dot(reflect(rd, nrm), l1), 0.0), 28.0) * 0.8;\n    }\n  }\n\n  // Emissive vertical neon monolith cylinders (p1c & p2c)\n  for (int k = 0; k < 2; k++) {\n    vec3 pc = (k == 0) ? p1c : p2c;\n    vec2 ro2 = ro.xz - pc.xz;\n    vec2 rd2 = rd.xz;\n    float A = dot(rd2, rd2);\n    float B = dot(ro2, rd2);\n    float C = dot(ro2, ro2) - 0.13 * 0.13;\n    float D = B * B - A * C;\n    if (D > 0.0) {\n      float tc = (-B - sqrt(D)) / max(A, 1e-5);\n      if (tc > 0.05 && tc < linZ) {\n        vec3 hp = ro + rd * tc;\n        if (hp.y > -0.42 && hp.y < 0.78) {\n          linZ = tc;\n          nrm = normalize(vec3(hp.x - pc.x, 0.0, hp.z - pc.z));\n          hitDist = 0.05;\n          clean = (k == 0) ? vec3(0.32, 1.55, 1.75) : vec3(1.75, 0.72, 0.26);\n        }\n      }\n    }\n  }\n}\n\nvec3 noisySample(vec2 fc, float rough, float noiseAmp, float t, out float hitDist, out vec3 nrm, out float linZ) {\n  vec2 uv = (fc - 0.5 * iResolution.xy) / iResolution.y;\n  vec3 clean;\n  evalNRDScene(uv, rough, t, clean, hitDist, nrm, linZ);\n  float fr = floor(t * 14.0) * 0.19;\n  vec2 p = floor(fc);\n  vec3 rnd = vec3(\n    hash21(p + vec2(fr * 13.7, 5.1)),\n    hash21(p + vec2(31.3, fr * 29.1)),\n    hash21(p + vec2(fr * 41.3, 67.7))\n  ) - 0.5;\n  // Noise variance scales with roughness & hit distance (near contacts have crisp short rays; far rough reflections are noisy!)\n  float sigma = noiseAmp * clamp(0.18 + rough * (0.4 + 0.9 * hitDist), 0.05, 1.6);\n  return max(clean + rnd * sigma * (0.4 + clean * 1.1), 0.0);\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 rough = clamp(P_ROUGHNESS, 0.06, 0.85);\n  float hdAware = clamp(P_HIT_DIST_AWARE, 0.0, 1.0);\n  float noiseAmp = clamp(P_NOISE_AMP, 0.1, 1.6);\n\n  float cHD, cZ;\n  vec3 cN;\n  vec3 raw = noisySample(fragCoord, rough, noiseAmp, iTime, cHD, cN, cZ);\n  vec3 col = raw;\n\n  if (screenX >= split) {\n    // Right: ReBLUR hit-distance-aware anisotropic kernel -- tight near contact hits, broad on distant rough hits\n    float kernelR = mix(2.4, clamp(0.6 + cHD * rough * 5.2, 0.6, 4.8), hdAware);\n    vec3 acc = vec3(0.0);\n    float wSum = 0.0;\n    for (int j = -2; j <= 2; j++) {\n      for (int i = -2; i <= 2; i++) {\n        vec2 off = vec2(float(i), float(j)) * kernelR;\n        float qHD, qZ;\n        vec3 qN;\n        vec3 qCol = noisySample(fragCoord + off, rough, noiseAmp, iTime, qHD, qN, qZ);\n        float wN = pow(max(dot(cN, qN), 0.0), 16.0);\n        float wZ = exp(-abs(cZ - qZ) * 4.5);\n        float wG = exp(-dot(vec2(float(i), float(j)), vec2(float(i), float(j))) * 0.28);\n        float w = wN * wZ * wG;\n        acc += qCol * w;\n        wSum += w;\n      }\n    }\n    col = acc / max(wSum, 1e-4);\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": "nvidia-nrd-relax-reblur",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:20.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.4471,
      "std": 0.2338,
      "min": 0,
      "max": 0.9135
     },
     "image": "/specimens/nvidia-nrd-relax-reblur-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "svgf",
  "atrous-wavelet-filter",
  "open-image-denoise",
  "restir-di",
  "restir-gi",
  "ray-traced-shadows",
  "ray-traced-ambient-occlusion",
  "dlss"
 ],
 "extends": [
  "svgf"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "restir-di",
   "why": "ReSTIR direct lighting produces sparse, correlated samples that ReLAX is tuned to clean up."
  },
  {
   "id": "ray-traced-shadows",
   "why": "Shadow rays with penumbra-distance output feed the shadow denoiser to get soft stable shadows."
  }
 ],
 "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/nvidia-nrd-relax-reblur.json"
 },
 "solves": [
  "ray traced reflections and diffuse look grainy in my game",
  "need a production denoiser for sparse ray tracing signals",
  "glossy ray traced reflections smear after denoising",
  "want one library to denoise shadows diffuse and specular",
  "restir output still has speckle noise on screen"
 ],
 "authority": "NVIDIA-RTX, 2020",
 "url": "https://texelatlas.vercel.app/t/nvidia-nrd-relax-reblur/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 51.13,
  "tier": "heavy",
  "p50_ms": 1.6823,
  "p95_ms": 1.8128,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "nvidia-nrd-relax-reblur-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 45.08,
   "tier": "heavy",
   "p50_ms": 0.7168,
   "p95_ms": 0.731,
   "speedup_x": 2.35,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 34.13,
   "tier": "heavy",
   "p50_ms": 0.9828,
   "p95_ms": 1.0022,
   "speedup_x": 1.71,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}