{
 "id": "gpu-driven-rendering",
 "title": "GPU-driven rendering",
 "aliases": [
  "GPU-driven pipeline",
  "indirect rendering"
 ],
 "domain": "performance",
 "subdomain": "draw submission",
 "stage": "performance",
 "realtime": "realtime",
 "platforms": [
  "webgpu",
  "desktop-gpu",
  "unity",
  "unreal"
 ],
 "year_introduced": 2015,
 "inputs": [
  "mesh"
 ],
 "outputs": [
  "gbuffer",
  "depth"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Move scene culling, LOD choice and draw-call generation onto the GPU so one indirect call renders a whole scene's visible clusters without CPU per-object work.",
 "how_it_works": "Geometry is kept in a few big vertex and index buffers, and per-instance data lives in a scene buffer. A compute pass tests each instance or cluster against the frustum and a depth pyramid, writes compacted draw arguments, and an indirect multi-draw consumes them.\n\nThe usual refinement is two-pass culling: draw what was visible last frame, rebuild the depth pyramid from that, then test and draw the remainder. Bindless or array-indexed materials keep state changes out of the loop, and a visibility buffer can defer material evaluation.",
 "when_to_use": "Choose it for scenes with tens of thousands of objects where CPU draw submission is the limit. Prefer `gpu-instancing` style batching when many copies of few meshes suffice, which is simpler. Prefer plain engine culling for small scenes. Pair with `mesh-shaders` where hardware supports them.",
 "cost": {
  "class": "cheap",
  "notes": "Culling is a cheap compute pass; the savings are mostly CPU time."
 },
 "failure_modes": [
  "Stale depth pyramid causes flicker or popping of moving objects in one-pass schemes",
  "Needs bindless or large texture arrays, limiting platforms",
  "Indirect draws are harder to debug and profile",
  "Transparent objects need ordering the compute pass does not give"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://advances.realtimerendering.com/s2015/index.html",
   "type": "web",
   "title": "GPU-Driven Rendering Pipelines",
   "authors": [
    "Ulrich Haar",
    "Sebastian Aaltonen"
   ],
   "year": null,
   "venue": "SIGGRAPH 2015 Advances in Real-Time Rendering",
   "url": "https://advances.realtimerendering.com/s2015/index.html",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261015202953/https://advances.realtimerendering.com/s2015/index.html",
     "timestamp": "20261015202953"
    },
    "page_title": "Advances in Real-Time Rendering- SIGGRAPH 2015",
    "host": "advances.realtimerendering.com",
    "title_confirmed_by_page": false,
    "title_unconfirmed": true
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://advances.realtimerendering.com/s2015/index.html → 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": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "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.2,
   "__bib": "haardrivenb"
  },
  {
   "role": "implementation",
   "key": "gh:zeux/niagara",
   "type": "code",
   "title": "zeux/niagara",
   "description": "A Vulkan renderer written from scratch on stream",
   "authors": [
    "zeux"
   ],
   "year": 2018,
   "venue": "GitHub",
   "url": "https://github.com/zeux/niagara",
   "ids": {
    "repo": "zeux/niagara"
   },
   "license": "MIT",
   "extra": {
    "stars": 1797,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-10-09T02:20:14Z",
    "language": "C++",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/zeux/niagara",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "zeux2018zeux"
  }
 ],
 "presets": [
  {
   "id": "gpu-driven-rendering-live",
   "title": "GPU-Driven Rendering — unfiltered CPU draw flood (left) vs compute frustum + Hi-Z occlusion culling & LOD clusters (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_FOV_WIDTH": 0.55,
    "P_OCCLUDER_H": 0.75,
    "P_SCAN_SPEED": 0.55,
    "P_SPLIT": 0.46
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_FOV_WIDTH = 0.55; // P Frustum Half-FOV [0.25, 0.95, 0.05]\nconst float P_OCCLUDER_H = 0.75; // P Hi-Z Occluder Wall [0.0, 1.0, 0.05]\nconst float P_SCAN_SPEED = 0.55; // P Camera Sweep [0.0, 1.6, 0.05]\nconst float P_SPLIT = 0.46; // P CPU Flood / GPU Cull [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\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  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  float fov = clamp(P_FOV_WIDTH, 0.20, 1.05);\n  float occStr = clamp(P_OCCLUDER_H, 0.0, 1.0);\n  float t = iTime * max(P_SCAN_SPEED, 0.0);\n\n  // Angled isometric tactical map of 14x10 GPU-instanced scene clusters\n  vec2 world = uv * 2.35;\n  vec3 col = vec3(0.04, 0.06, 0.10);\n\n  // Subtle spatial hash grid floor\n  vec2 gLine = abs(fract(world * 3.0) - 0.5);\n  float grid = smoothstep(0.05, 0.012, min(gLine.x, gLine.y));\n  col += vec3(0.06, 0.10, 0.16) * grid;\n\n  // Virtual camera orbiting at bottom-left sweeping across the instanced city\n  vec2 camPos = vec2(-0.78, -0.78);\n  float camAng = 0.78 + 0.42 * sin(t * 0.65);\n  vec2 camDir = vec2(cos(camAng), sin(camAng));\n  vec2 camRight = vec2(-camDir.y, camDir.x);\n\n  // Large Hi-Z depth occluder barrier in middle of frustum\n  vec2 occCenter = camPos + camDir * 0.88 + camRight * 0.08;\n  vec2 toOcc = world - occCenter;\n  float occAlong = dot(toOcc, camDir);\n  float occAcross = dot(toOcc, camRight);\n  float occHalfW = 0.28 * occStr;\n\n  // Test instanced clusters on a regular grid\n  vec2 cellScale = vec2(3.6);\n  vec2 cid = floor(world * cellScale);\n  vec2 cf = fract(world * cellScale) - 0.5;\n  vec2 cPos = (cid + 0.5) / cellScale;\n\n  // Cluster geometry & instance bounding box\n  float rnd = hash21(cid + vec2(17.3, 41.1));\n  float boxR = 0.22 + 0.16 * rnd;\n  vec2 dBox = abs(cf) - vec2(boxR);\n  float inCluster = smoothstep(0.03, -0.02, max(dBox.x, dBox.y));\n  float boxBorder = smoothstep(0.055, 0.015, abs(max(dBox.x, dBox.y)));\n\n  // Evaluate frustum & Hi-Z occlusion for cluster center cPos\n  vec2 rel = cPos - camPos;\n  float depth = dot(rel, camDir);\n  float lat = dot(rel, camRight);\n  float halfSpan = max(depth * tan(fov * 0.72), 0.05);\n  bool inFrustum = (depth > 0.12 && depth < 2.25 && abs(lat) < halfSpan);\n\n  // Hi-Z shadow behind occluder wall\n  float occDepth = 0.88;\n  float projLat = (depth > 0.01) ? (lat * (occDepth / max(depth, 0.01))) : 9.0;\n  bool hizOccluded = (occStr > 0.05) && (depth > occDepth + 0.08) && (abs(projLat - 0.08) < occHalfW);\n\n  if (inCluster > 0.01 && length(cPos - camPos) > 0.22) {\n    if (screenX < split) {\n      // Left: CPU submits ALL instances blindly (uniform red-orange draw-call flood)\n      vec3 cpuCol = mix(vec3(0.62, 0.22, 0.18), vec3(0.95, 0.42, 0.24), rnd);\n      col = mix(col, cpuCol * (0.65 + 0.35 * boxBorder), inCluster);\n    } else {\n      // Right: GPU compute culling + indirect draw compaction + distance LOD selection!\n      vec3 instCol;\n      if (!inFrustum) {\n        // Frustum-culled (skipped completely, zero indirect draw command!)\n        instCol = vec3(0.09, 0.12, 0.18);\n      } else if (hizOccluded) {\n        // Hi-Z depth-pyramid occluded (culled in compute pass!)\n        instCol = vec3(0.28, 0.10, 0.18);\n      } else {\n        // Visible -> select LOD tier by screen-space distance (LOD0 emerald, LOD1 cyan, LOD2 amber)\n        if (depth < 0.95) instCol = vec3(0.16, 0.94, 0.56);\n        else if (depth < 1.55) instCol = vec3(0.18, 0.76, 1.0);\n        else instCol = vec3(0.98, 0.74, 0.22);\n      }\n      col = mix(col, instCol * (0.72 + 0.40 * boxBorder), inCluster);\n    }\n  }\n\n  // Draw the glowing frustum cone rays and Hi-Z occluder barrier\n  vec2 relP = world - camPos;\n  float dp = dot(relP, camDir);\n  float lp = dot(relP, camRight);\n  float coneSpan = dp * tan(fov * 0.72);\n  float edgeFrust = smoothstep(0.024, 0.005, abs(abs(lp) - coneSpan)) * step(0.0, dp) * step(dp, 2.25);\n  float farArc = smoothstep(0.024, 0.005, abs(dp - 2.25)) * step(abs(lp), coneSpan);\n  col = mix(col, vec3(0.25, 0.95, 1.0), clamp(edgeFrust + farArc, 0.0, 1.0) * 0.85);\n\n  // Hi-Z occluder wall slab\n  if (occStr > 0.05) {\n    float wall = smoothstep(0.02, -0.01, max(abs(occAlong) - 0.045, abs(occAcross) - occHalfW));\n    col = mix(col, vec3(0.98, 0.34, 0.42), wall);\n  }\n  // Camera icon at apex\n  float camDot = smoothstep(0.07, 0.04, length(world - camPos));\n  col = mix(col, vec3(1.0, 0.96, 0.82), camDot);\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": "gpu-driven-rendering",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:11.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.4183,
      "std": 0.1857,
      "min": 0.2685,
      "max": 0.9014
     },
     "image": "/specimens/gpu-driven-rendering-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "hierarchical-z-occlusion-culling",
  "meshlets",
  "mesh-shaders"
 ],
 "extends": [
  "hierarchical-z-occlusion-culling"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "hierarchical-z-occlusion-culling",
   "why": "The depth pyramid built from last frame's depth is what the culling compute shader samples."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/performance/gpu-driven-rendering.json"
 },
 "solves": [
  "cpu is bottlenecked submitting thousands of draw calls",
  "scene with tens of thousands of objects runs slowly",
  "want culling and lod decided on the gpu",
  "reduce per-object cpu work in big scenes",
  "render a whole scene with one indirect call"
 ],
 "authority": "Haar & Aaltonen",
 "url": "https://texelatlas.vercel.app/t/gpu-driven-rendering/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 3.74,
  "tier": "light",
  "p50_ms": 0.1231,
  "p95_ms": 0.1262,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "gpu-driven-rendering-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 3.06,
   "tier": "light",
   "p50_ms": 0.0486,
   "p95_ms": 0.0486,
   "speedup_x": 2.53,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 2.74,
   "tier": "light",
   "p50_ms": 0.0788,
   "p95_ms": 0.0789,
   "speedup_x": 1.56,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}