{
 "id": "atomic-fixed-point-compute-point-rasterization",
 "title": "Compute-Shader Atomic Fixed-Point Sub-Pixel Point Rasterization",
 "aliases": [
  "compute point rasterization",
  "atomic software point splatting",
  "fixed-point compute point accumulation"
 ],
 "domain": "performance",
 "subdomain": "software rasterization",
 "stage": "performance",
 "realtime": "realtime",
 "platforms": [
  "webgpu",
  "desktop-gpu",
  "cuda"
 ],
 "year_introduced": 2021,
 "inputs": [
  "point-cloud",
  "particles",
  "depth",
  "camera-poses"
 ],
 "outputs": [
  "hdr-image",
  "depth"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Bypasses hardware primitive rasterization by projecting points or sub-pixel particles in a compute shader and writing depth-tested colors or fixed-point additive radiance directly into a screen-sized storage buffer using GPU atomics.",
 "how_it_works": "Hardware graphics pipelines are optimized for multi-pixel triangles; feeding them millions of single-pixel points or sub-pixel dust particles wastes 2×2 pixel-quad shader lanes and bottlenecks fixed-function primitive assembly. Compute-shader software point rasterization sidesteps the raster pipeline altogether by running one compute thread per point.\n\nEach thread transforms its point into clip space, frustum-culls it, and computes the integer pixel coordinate `(x, y)` in a flat screen-sized `uint32` or `uint64` storage buffer. Two atomic accumulation variants serve different visual regimes:\n\n- **Opaque point clouds**: pack quantized depth in the upper bits and color or point ID in the lower bits of a 64-bit integer (or use early depth-buffer rejection followed by `atomicMin` on depth), resolving the nearest point per pixel up to an order of magnitude faster than `GL_POINTS`.\n- **Additive / translucent micro-particles**: test against the scene depth buffer, convert linear RGB radiance to **fixed-point unsigned integers** (e.g., 16 fractional bits per channel to preserve dim colors), and accumulate via `atomicAdd` into RGB storage channels, yielding deterministic, order-independent energy conservation.\n\nA fullscreen resolve pass unpacks the storage buffer into the final HDR framebuffer and clears it for the next frame.",
 "when_to_use": "Choose it when rendering millions of lidar points, dense particle clouds, or tiny single-pixel spores/sparks where hardware quad-overshading and primitive setup dominate frame time.\n\nPrefer [gpu-particle-systems](gpu-particle-systems) using instanced billboard quads whenever particles grow larger than a few pixels or require textured soft sprites and depth-of-field bokeh. Prefer [nanite-virtualized-geometry](nanite-virtualized-geometry) for dense connected triangle surfaces. Prefer [chaotic-attractor-density-rendering](chaotic-attractor-density-rendering) specifically for iterative strange-attractor histogram accumulation.",
 "cost": {
  "class": "cheap",
  "notes": "Schütz et al. (2021, 2022) report rendering hundreds of millions to over 1 billion points in real time on desktop GPUs, substantially outperforming hardware GL_POINTS; performance depends on memory coherence and atomic contention."
 },
 "failure_modes": [
  "Severe atomic contention stalls when millions of points project onto the exact same pixel (e.g., distant dense clusters without LOD or Morton ordering)",
  "Fixed-point 32-bit additive accumulators can overflow and wrap around if extreme particle densities stack without clamping or rescaling",
  "Points larger than 1–2 pixels lose efficiency rapidly compared to hardware triangle rasterization and appear as sparse pinholes up close",
  "64-bit integer atomics are unavailable in core WebGPU WGSL, requiring split 32-bit depth/color passes or additive fixed-point RGB channels"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1111/cgf.14345",
   "type": "paper",
   "title": "Rendering Point Clouds with Compute Shaders and Vertex Order Optimization",
   "authors": [
    "Markus Schütz",
    "Bernhard Kerbl",
    "Michael Wimmer"
   ],
   "year": 2021,
   "venue": "Computer Graphics Forum",
   "url": "https://doi.org/10.1111/cgf.14345",
   "ids": {
    "doi": "10.1111/cgf.14345"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.14345",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.14345",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.14345",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.14345",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1111/cgf.14345",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": 1,
   "__bib": "schtz2021rendering"
  },
  {
   "role": "primary",
   "key": "doi:10.1145/3543863",
   "type": "paper",
   "title": "Software Rasterization of 2 Billion Points in Real Time",
   "authors": [
    "Markus Schütz",
    "Bernhard Kerbl",
    "Michael Wimmer"
   ],
   "year": 2022,
   "venue": "Proceedings of the ACM on Computer Graphics and Interactive Techniques",
   "url": "https://doi.org/10.1145/3543863",
   "ids": {
    "doi": "10.1145/3543863"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3543863",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3543863",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3543863",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3543863",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3543863",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": 1,
   "__bib": "schtz2022software"
  },
  {
   "role": "implementation",
   "key": "gh:m-schuetz/compute_rasterizer",
   "type": "code",
   "title": "m-schuetz/compute_rasterizer",
   "description": "Rendering Point Clouds with Compute Shaders",
   "authors": [
    "m-schuetz"
   ],
   "year": 2019,
   "venue": "GitHub",
   "url": "https://github.com/m-schuetz/compute_rasterizer",
   "ids": {
    "repo": "m-schuetz/compute_rasterizer"
   },
   "license": "NOASSERTION",
   "extra": {
    "stars": 751,
    "stars_checked": "2026-11-30",
    "archived": false,
    "fork": false,
    "pushed_at": "2023-02-02T12:22:42Z",
    "language": "C++",
    "homepage": null,
    "license_name": "Other"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/m-schuetz/compute_rasterizer",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": null,
   "__bib": "mschuetz2019schuetz"
  },
  {
   "role": "implementation",
   "key": "gh:mrdoob/codevember-2026",
   "type": "code",
   "title": "mrdoob/codevember-2026",
   "description": "Daily creative agentic coding experiments for November 2026.",
   "authors": [
    "mrdoob"
   ],
   "year": 2026,
   "venue": "GitHub",
   "url": "https://github.com/mrdoob/codevember-2026",
   "ids": {
    "repo": "mrdoob/codevember-2026"
   },
   "license": "MIT",
   "extra": {
    "stars": 102,
    "stars_checked": "2026-11-30",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-27T06:32:02Z",
    "language": "JavaScript",
    "homepage": "https://mrdoob.github.io/codevember-2026/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/codevember-2026",
     "checked_at": "2026-11-30T17:59:51.239Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-30T17:59:51.239Z",
   "title_sim": null,
   "__bib": "mrdoob2026mrdoob"
  }
 ],
 "presets": [
  {
   "id": "atomic-fixed-point-compute-point-rasterization-live",
   "title": "Atomic Fixed-Point Compute Point Rasterization — hardware 2x2 quad overdraw waste (left) vs sub-pixel fixed-point atomic radiance cloud (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_DENSITY": 1,
    "P_EXPOSURE": 1.15,
    "P_SPIN": 0.55,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_DENSITY = 1.00; // P Point Density [0.4, 1.6, 0.05]\nconst float P_EXPOSURE = 1.15; // P Additive Radiance [0.4, 2.2, 0.05]\nconst float P_SPIN = 0.55; // P Orbit Speed [0.0, 1.8, 0.05]\nconst float P_SPLIT = 0.48; // P 2x2 Quad / Atomic [0.0, 1.0, 0.02]\n\nvec2 rot2(vec2 p, float a) {\n  float c = cos(a);\n  float s = sin(a);\n  return vec2(c * p.x - s * p.y, s * p.x + c * 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 dens = clamp(P_DENSITY, 0.35, 1.8);\n  float expo = clamp(P_EXPOSURE, 0.3, 2.5);\n  float t = iTime * max(P_SPIN, 0.0);\n\n  vec3 bg = mix(vec3(0.02, 0.03, 0.06), vec3(0.06, 0.09, 0.16), smoothstep(-0.5, 0.5, uv.y));\n  // Subtle screen-space compute tile grid (8x8 workgroup overlay on right, 2x2 pixel-quad grid on left)\n  float quadGrid = step(0.86, max(fract(fragCoord.x * 0.125), fract(fragCoord.y * 0.125)));\n  vec3 col = bg + vec3(0.04, 0.07, 0.12) * quadGrid * 0.45;\n\n  // Project 120 3D points along a rotating trefoil torus-knot particle stream\n  vec3 atomicAcc = vec3(0.0);\n  float quadHits = 0.0;\n  float zNearest = 10.0;\n  vec3 nearestCol = vec3(0.0);\n\n  // Quantized 2x2 hardware quad cell for left side overdraw-waste demonstration\n  vec2 quadUv = (floor(fragCoord / 4.0) * 4.0 + 2.0 - 0.5 * iResolution.xy) / iResolution.y;\n\n  for (int i = 0; i < 120; i++) {\n    float fi = float(i);\n    float u = (fi / 120.0) * 6.2831853;\n    float rMaj = 0.34 + 0.13 * cos(3.0 * u + t * 0.4);\n    vec3 p3 = vec3(\n      rMaj * cos(2.0 * u),\n      0.16 * sin(3.0 * u) + 0.07 * sin(fi * 7.3),\n      rMaj * sin(2.0 * u)\n    );\n    // Add radial sub-pixel dust halo offset\n    p3 += vec3(cos(fi * 19.7), sin(fi * 13.1), cos(fi * 29.3)) * 0.055;\n    p3.xz = rot2(p3.xz, t * 0.65);\n    p3.yz = rot2(p3.yz, 0.42 + 0.15 * sin(t * 0.5));\n\n    float zCam = 1.65 - p3.z;\n    vec2 proj = p3.xy / max(zCam * 0.72, 0.25);\n\n    vec3 ptCol = mix(vec3(0.16, 0.78, 1.0), vec3(1.0, 0.52, 0.18), 0.5 + 0.5 * sin(u * 2.0 + p3.y * 4.0));\n    ptCol *= 0.8 + 0.4 * exp(-max(zCam - 1.0, 0.0));\n\n    if (screenX < split) {\n      // Left: Hardware rasterizer forces 2x2 pixel-quad invocations even for 1px points -> overdraw heatmap!\n      vec2 dq = abs(quadUv - proj);\n      if (max(dq.x, dq.y) < 0.022 * dens) {\n        quadHits += 1.0;\n        if (zCam < zNearest) {\n          zNearest = zCam;\n          nearestCol = ptCol;\n        }\n      }\n    } else {\n      // Right: Compute-shader atomic fixed-point additive radiance + depth-packed crisp sub-pixel splat\n      float d = length(uv - proj);\n      float core = exp(-(d * d) / max(0.00016 * dens * dens, 1e-6));\n      float halo = exp(-(d * d) / max(0.0014 * dens * dens, 1e-5)) * 0.22;\n      // Simulate fixed-point 16-bit integer atomicAdd quantization steps subtly\n      vec3 contrib = ptCol * (core + halo) * expo;\n      atomicAcc += floor(contrib * 64.0 + 0.5) / 64.0;\n    }\n  }\n\n  if (screenX < split) {\n    // Visualize wasted 2x2 helper-lane quad coverage (amber/magenta heat for overlapping quads)\n    if (quadHits > 0.5) {\n      float heat = clamp(quadHits / 6.0, 0.0, 1.0);\n      vec3 overdrawCol = mix(vec3(0.20, 0.55, 0.95), vec3(1.0, 0.24, 0.36), heat);\n      // Show active pixel (1 of 4) vs 3 wasted helper lanes inside each 2x2 quad\n      vec2 subQ = mod(floor(fragCoord / 2.0), 2.0);\n      float helperLane = step(0.5, subQ.x + subQ.y);\n      col = mix(nearestCol * 1.15, overdrawCol * 0.55, helperLane * 0.72);\n    }\n  } else {\n    col += atomicAcc * 0.65;\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": "atomic-fixed-point-compute-point-rasterization",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:05.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.3902,
      "std": 0.1948,
      "min": 0.1671,
      "max": 0.948
     },
     "image": "/specimens/atomic-fixed-point-compute-point-rasterization-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "gpu-driven-rendering",
  "gpu-particle-systems",
  "visibility-buffer",
  "nanite-virtualized-geometry",
  "chaotic-attractor-density-rendering"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "gpu-particle-systems",
   "why": "Renders GPU-simulated micro-particles directly from storage buffers with order-independent fixed-point atomic radiance accumulation."
  },
  {
   "id": "depth-of-field-scatter-as-gather",
   "why": "Splits in-focus sub-pixel particles onto the fast atomic compute path while sending larger defocused bokeh sprites to normal rasterization."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-30T17:59:51.239Z",
  "draft": "data/drafts/performance/atomic-fixed-point-compute-point-rasterization.json"
 },
 "solves": [
  "drawing millions of tiny 1-pixel points or particles bottlenecks hardware rasterizer",
  "avoid 2x2 pixel quad overshading waste on dense lidar or spore point clouds",
  "software rasterize sub-pixel points in compute with lock-free depth testing",
  "pack depth and color into 64-bit atomics for fast compute point visibility",
  "composite massive compute-driven particle fields cleanly against scene depth"
 ],
 "authority": "Schütz et al., 2021",
 "url": "https://texelatlas.vercel.app/t/atomic-fixed-point-compute-point-rasterization/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 145.24,
  "tier": "extreme",
  "p50_ms": 4.7784,
  "p95_ms": 4.8419,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "atomic-fixed-point-compute-point-rasterization-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 153.47,
   "tier": "extreme",
   "p50_ms": 2.4402,
   "p95_ms": 2.5022,
   "speedup_x": 1.96,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 108.84,
   "tier": "extreme",
   "p50_ms": 3.1345,
   "p95_ms": 3.1385,
   "speedup_x": 1.52,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}