Skip to content

Switch to WebGPU #108

Description

@DraTeots

WebGPU is an old new technology that is now supported by all major browsers (including Safari) and three.js. The rationale:

  • GPU-driven rendering — WebGPU compute shaders can handle instanced hit rendering (thousands of BoxHits) entirely on GPU, reducing CPU overhead
  • Compute-based BVH traversal — move raycasting/picking from CPU to GPU compute shaders, significantly faster for large geometries
  • Better batching — WebGPU's bind group model reduces draw call overhead vs WebGL's per-uniform state changes, helping with merged detector geometries
  • GPU-side time filtering — painters currently filter hits/trajectories by time on CPU; a compute shader could cull/animate thousands of objects per frame with near-zero CPU cost
  • Indirect rendering — GPU can decide what to draw (frustum culling, LOD selection) without CPU roundtrips, critical for full-detector views
  • Parallel geometry processing — geometry optimization/merging steps could run as compute passes during load
  • Modern pipeline state — explicit pipeline objects avoid WebGL's hidden state validation overhead, more predictable frame times
  • Larger buffers — WebGPU supports storage buffers well beyond WebGL's uniform buffer limits, enabling bigger event datasets in GPU memory

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions