npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zushah/wasmgpu

v0.8.0

Published

WebGPU × WebAssembly rendering and computing engine for scientific workloads in the browser.

Readme

About

  • 🔥 WebGPU × WebAssembly rendering and computing engine for scientific workloads in the browser.
  • 🚀 Latest release: v0.8.0.
  • 💡 Website: https://zushah.github.io/WasmGPU.
  • ⚙️ WebGPU engine written in TypeScript, spanning scene & assets (meshes, pointclouds, glyphfields, nodelinks, data materials, lights, cameras, glTF 2.0 assets with over a dozen extensions, metadata, and animation-extension coverage, mipmapped texture sampling, transparency including transmission rendering, animations, 4- or 8-influence skinning, and rich built-in geometry including cartesian and parametric curves and surfaces for mathematics); rendering architecture (WebAssembly-powered frustum culling, previous-frame occlusion culling, opaque draw batching with automatic instanced rendering, optional subpixel morphological anti-aliasing, configurable canvas format selection, and GPU ID-pass picking for both single-hit queries and rectangular or lasso region queries with typed results); interaction, overlays, & diagnostics (orbit/trackball orthographic/perspective camera navigation with bounds-based scene framing, inspection views, and a composable overlay and annotation toolkit with triads, grids, legends, markers, probes, and measurements); and compute & interop (a first-class compute subsystem with reusable pipelines and buffers, an extensive kernels library, an ndarray abstraction, asynchronous readback utilities, a unified scale-transform model shared across rendering and computing workflows, external WebAssembly module interoperability, and Python-in-the-browser interoperability).
  • 🦀 WebAssembly driver written in Rust, spanning data layout & transforms (transforms stored in SoA memory with per-index dirty tracking and partial local or world propagation plus model and normal matrix packing); animation & asset hot paths (animation sampling and joint-matrix generation executed in WebAssembly together with glTF accessor deinterleaving, sparse patch application, numeric conversion, richer import-side data preparation, and mesh normal generation); bounds, culling, & visibility (world-space bounds computation for geometry, pointclouds, glyphfields, and nodelinks together with frustum plane extraction, sphere-frustum culling kernels, and CPU-side support for render-only occlusion filtering); array semantics & zero-copy staging (ndarray indexing utilities for explicit shape-and-stride byte-offset math plus uniforms and instance data staged as zero-copy views into WebAssembly memory with explicit typed-slice handles and module-facing views for external WebAssembly interoperability); and performance envelope (hot-path allocations avoided via cached pipelines and bind-group layouts plus a frame arena and user heap arenas, with builds optimized via LLVM and Binaryen and SIMD128 enabled for even higher throughput).

Architecture Diagram

The diagram below reflects the implemented architecture of WasmGPU v0.8.0.

Solid arrows indicate creation, ownership, stored references, or call direction. Dashed arrows indicate data movement through WebAssembly memory or WebGPU resources.

Click here to interactively view the diagram if it doesn't properly appear below.

flowchart LR
    subgraph API["Public API"]
        APP["User Application"]
        ENG["WasmGPU v0.8.0"]
        FAC["Factory surface: scene, camera, controls, geometry, material, texture, mesh, pointcloud, glyphfield, nodelink, light, asset import, animation, overlay, annotation, interop"]
    end

    subgraph WGPU["WebGPU Engine"]
        LOOP["Frame loop"]
        REND["Renderer"]
        SCALE["Scaling service"]
        OVER["Overlay framework"]
        ANNO["Annotation toolkit"]
        PICK["Picking utility"]
        COMP["Compute subsystem"]
        CBUF["Buffer resource manager"]
        CPIP["Pipeline controller"]
        CDIS["Dispatch workgroup planner"]
        CKER["Kernels library"]
        CND["N-dimensional array model for CPU & GPU memory"]
        CREAD["Asynchronous readback ring"]
        CSCR["Scratch buffer pool"]
    end

    subgraph DATA["Object & Data Model"]
        SCN["Scene"]
        TSTORE["Transform store in SoA memory"]
        MESH["Mesh with geometry, material, texture, morphing, & skinning"]
        PGN["Pointcloud, glyphfield, & nodelink"]
        CMAP["Colormapping"]
        SKIN["Skinning instance data"]
        ASTORE["Annotation store"]
        ALOAD["Loader for glTF 2.0 asset data"]
        ADEC["Accessor decoding & data conversion"]
        AIMP["Importer from asset data to scene resources"]
        AMETA["Imported nodes, metadata, variants, cameras, & lights"]
        WINT["WebAssembly interop"]
        PY["Python interop"]
    end

    subgraph WASM["WebAssembly Driver"]
        WHEAP["Heap allocation for persistent typed memory"]
        WFRAME["Frame arena for transient typed memory"]
        WTRANS["Transform propagation"]
        WMATH["Matrix, vector, & quaternion mathematics"]
        WND["N-dimensional array indexing & stride-offsetting"]
        WNORM["Mesh normal generation"]
        WGLTF["glTF accessor decoding, sparse patching, & numeric conversion"]
        WANIM["Animation sampling & joint matrix generation"]
        WBOUNDS["Bounds computation"]
        WCULL["Frustum culling"]
    end

    subgraph GPU["Browser Resources"]
        DEV["Graphics device & queue"]
        CACHE["Pipeline cache & bindgroup cache"]
        RES["Buffers, textures, & samplers"]
        RPASS["Render passes for opaques, transparents, transmissions, post-processing, & user interaction"]
        CPASS["Compute passes for kernels"]
    end

    classDef darkblue fill:#4E79FF,stroke:#0B2B8F,stroke-width:2px,color:#06153D;
    classDef green fill:#22D37D,stroke:#0A6D3C,stroke-width:2px,color:#04311A;
    classDef lightblue fill:#17C9FF,stroke:#005E80,stroke-width:2px,color:#022433;
    classDef yellow fill:#FFB238,stroke:#9A4D00,stroke-width:2px,color:#5A2C00;
    classDef purple fill:#B18AFF,stroke:#5A2FA6,stroke-width:2px,color:#2E165E;
    classDef pink fill:#FF5EA8,stroke:#9A2E62,stroke-width:2px,color:#4D1532;

    class APP,ENG,FAC darkblue;
    class LOOP,REND,SCALE,OVER,ANNO,PICK green;
    class COMP,CBUF,CPIP,CDIS,CKER,CND,CREAD,CSCR lightblue;
    class SCN,TSTORE,MESH,PGN,CMAP,SKIN,ASTORE,ALOAD,ADEC,AIMP,AMETA,WINT,PY yellow;
    class WHEAP,WFRAME,WTRANS,WMATH,WND,WNORM,WGLTF,WANIM,WBOUNDS,WCULL purple;
    class DEV,CACHE,RES,RPASS,CPASS pink;

    APP --> ENG
    ENG --> FAC
    ENG --> LOOP
    ENG --> REND
    ENG --> COMP
    ENG --> SCALE
    ENG --> OVER
    ENG --> ANNO
    FAC --> SCN
    FAC --> TSTORE
    FAC --> MESH
    FAC --> PGN
    FAC --> ALOAD
    FAC --> AIMP
    FAC --> WINT
    FAC --> PY

    SCN --> MESH
    SCN --> PGN
    MESH --> TSTORE
    PGN --> TSTORE
    SKIN --> MESH
    ALOAD --> ADEC
    ADEC --> AIMP
    AIMP --> SCN
    AIMP --> MESH
    AIMP --> SKIN
    AIMP --> AMETA
    CMAP --> MESH
    CMAP --> PGN
    SCALE --> CMAP
    SCALE --> PGN

    LOOP --> REND
    LOOP --> WFRAME
    REND --> DEV
    REND --> CACHE
    REND --> RES
    REND --> RPASS
    REND --> PICK
    REND --> SCN
    REND --> TSTORE
    REND --> WCULL
    REND --> WBOUNDS
    PICK --> RPASS
    OVER --> SCN
    ANNO --> ASTORE
    ANNO --> PICK
    ANNO --> SCN

    COMP --> CBUF
    COMP --> CPIP
    COMP --> CDIS
    COMP --> CKER
    COMP --> CND
    COMP --> CREAD
    COMP --> CSCR
    CBUF --> RES
    CPIP --> CPASS
    CDIS --> CPASS
    CKER --> CPASS
    CND --> CBUF
    CREAD --> RES
    CSCR --> RES
    CPASS --> DEV

    TSTORE -.-> WTRANS
    MESH -.-> WNORM
    MESH -.-> WBOUNDS
    PGN -.-> WBOUNDS
    ADEC -.-> WGLTF
    SKIN -.-> WANIM
    CND -.-> WND
    REND -.-> WFRAME
    REND -.-> WMATH
    COMP -.-> WHEAP
    WINT -.-> CBUF
    PY --> WHEAP
    PY --> WFRAME
    WHEAP -.-> RES
    WFRAME -.-> RES

Architecture Comparison Tables

1. Platform and Toolchain

| | WebGL / WebGPU | Three.js / Babylon.js | WasmGPU | | :--- | :--- | :--- | :--- | | Origin | 2011 / 2023 | 2010 / 2013 | 2026 | | Implementation Language | JavaScript & C++ | JavaScript / TypeScript | TypeScript & Rust | | Application Language | JavaScript & GLSL / WGSL | JavaScript / TypeScript & GLSL / WGSL | JavaScript / TypeScript & WGSL (& Python via Pyodide) | | Buildtime Optimization | Not available | Transpilation, tree-shaking, minification | Transpilation & LLVM, tree-shaking & Binaryen, minification | | Graphics Engine | WebGL / WebGPU | WebGL-native & WebGPU-adoptive | WebGPU-native | | Vectorization | Not available | Scalar | SIMD128 | | API Ergonomics | Verbose | Streamlined | Streamlined |

2. Execution Model and Memory Layout

| | WebGL / WebGPU | Three.js / Babylon.js | WasmGPU | | :--- | :--- | :--- | :--- | | Scene Graph Memory | Not available | Object-oriented (AoS) | Data-oriented (SoA) | | Math Execution | JavaScript | JavaScript | WebAssembly | | Transform Updates | Not available | Recursive traversal | Linear iteration | | Bounds Computation | Manual | JavaScript | WebAssembly | | View Framing | Manual | Helper-based fitting | Bounds-based scene/object fitting | | Garbage Collection | Manual & low/high pressure via JavaScript engine | Automatic & high pressure via JavaScript engine | Automatic & low pressure via WebAssembly driver | | Render Loop | Run by JavaScript | Run by JavaScript | Run by JavaScript & WebAssembly |

3. Rendering Pipeline Infrastructure

| | WebGL / WebGPU | Three.js / Babylon.js | WasmGPU | | :--- | :--- | :--- | :--- | | Uniform Uploads | Manual packing | Extraction & packing | Zero-copy views & no packing | | Render State Caching | Manual | State filtering | Pipeline caching | | Instancing | Manual | Manual | Automatic | | Visibility Culling | Not available | Frustum culling in JavaScript | Frustum & occlusion culling in WebAssembly | | Picking | Manual GPU / CPU picking | Often CPU-centered | GPU ID-pass with typed hits | | Skinning | Not available | Data textures | Storage buffers | | Anti-aliasing | Not available | MSAA | SMAA | | Textures | Manual | Managed objects | Managed objects | | Animation System | Not available | Executed in JavaScript | Executed in WebAssembly | | Asset Importing | Not available | glTF 2.0 | glTF 2.0 | | Camera Controls | Not available | Built-in | Built-in |

4. Compute Workloads and Scientific Visualizations

| | WebGL / WebGPU | Three.js / Babylon.js | WasmGPU | | :--- | :--- | :--- | :--- | | GPGPU | Manual, low-level, high-boilerplate | Integrated, renderer-adjacent, framework-specific | Automated, kernel-driven, compute-optimized | | Ndarray Abstraction | Not available | Not available | CPU & GPU ndarrays | | GPU Readback | Manual | Manual | Async readback ring | | Python Interoperability | Not available | Not available | With Pyodide | | Scientific Primitives | Manual | Manual | Pointclouds, glyphfields, & nodelinks | | Mathematical Geometry | Manual | Manual | Cartesian & parametric curves & surfaces | | Scaling Statistics | Manual | Manual | Min/max & percentile analysis | | Colormap Support | Manual | Manual | Built-ins & custom | | Data-driven Materials | Manual | Manual | Data material | | Scientific Overlays | Manual | Manual | Grids, triads, & legends | | Annotation & Measurement | Manual | Manual | Markers, probes, distance, & angle toolkit |

Getting Started

Examples:

  1. ./examples/benchmark.html to see how the performance of WasmGPU compares to Three.js and Babylon.js for both rendering and computing.
  2. ./examples/esm.html to see how to get started with the ESM build.
  3. ./examples/iife.html to see how to get started with the IIFE build.
  4. ./examples/gltf.html to see how a glTF model of a chessboard can be loaded and imported.
  5. ./examples/controls.html to see how the camera controls and navigation functionalities work.
  6. ./examples/picking.html to see how the picking, probing, and selecting utility works.
  7. ./examples/scaling.html to see how the scaling service and colormapping works.
  8. ./examples/overlay.html to see how the overlay framework and annotation toolkit works.
  9. ./examples/mandelbulb.html to see how the compute subsystem can be used to render a Mandelbulb fractal.
  10. ./examples/galaxy.html to see how a point cloud can be used with Python intero via Pyodide and the compute subsystem to render a realistic galaxy.
  11. ./examples/fluid.html to see how a glyph field and a point cloud can be used with Python interop, the compute subsystem, navigation, selection, and overlay features to render a fluid dynamics demo.
  12. ./examples/graphing.html to see how the mathematical function primitives and data materials can be used with Python interop, navigation, selection, and overlay features to render for a 3D graphing calculator.
  13. ./examples/protein.html to see how a point cloud can be used with Python interop, navigation, selection, colormap, and overlay features to render a visualization of a protein structure (hemoglobin) from the Protein Data Bank.

Super basic example to render a cube:

// Setup
import { WasmGPU } from "@zushah/wasmgpu";
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas, { antialias: true});

// Scene, camera, and controls
const scene = wgpu.createScene([0.05, 0.05, 0.1]);
const camera = wgpu.createCamera.perspective({
    fov: 60,
    near: 0.1,
    far: 1000
});
camera.transform.setPosition(-2, 2, -2);
camera.lookAt(0, 0, 0);
const controls = wgpu.createControls.orbit(camera, canvas);

// Light
scene.addLight(wgpu.createLight.directional({
    direction: [1, -1, -1],
    color: [1, 1, 1],
    intensity: 1.5
}));

// Cube
const cube = wgpu.createMesh(
    wgpu.geometry.box(1, 1, 1),
    wgpu.material.standard({
        color: [1, 0, 0],
        metallic: 0.7
    })
);
scene.add(cube);

// Render
wgpu.run((dt, time) => {
    controls.update(dt);
    wgpu.render(scene, camera);
});

Using the IIFE bundle instead of the ESM bundle is exactly the same as above, except you must use an HTML script tag instead of a JavaScript import statement:

<script src="https://cdn.jsdelivr.net/gh/Zushah/[email protected]/dist/WasmGPU.iife.min.js"></script>

To get started with the comprehensive documentation, consider visiting the pages for these fundamentals first:

Contributing

Asking questions, reporting bugs, suggesting features, and contributing code is very welcome. The guidelines can be found here.

Acknowledgements

License

WasmGPU is available under the Mozilla Public License 2.0.