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

@dydev10/webgpu-renderer

v0.5.0

Published

WebGPU renderer for the browser with a scene API and two-pass composite pipeline.

Downloads

1,067

Readme

webgpu-renderer

A WebGPU renderer for the browser with a scene API, instanced geometry, skybox, and two-pass composite pipeline.

Requires a browser with WebGPU support (Chrome 113+, Edge 113+).

Warning: This package is under active development and has not reached a stable 1.0 release. Expect breaking changes before v1.0.


Installation

npm install @dydev10/webgpu-renderer

TypeScript setup

@webgpu/types is included as a dependency and installed automatically. You still need to tell TypeScript to load it. Add it to your tsconfig.json:

{
  "compilerOptions": {
    "types": ["@webgpu/types"]
  }
}

Without this, navigator.gpu and all WebGPU globals will appear as unknown types.


Usage

Zero config -- blank canvas, managed loop:

import { WebGPURenderer } from '@dydev10/webgpu-renderer';

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const renderer = new WebGPURenderer(canvas);
await renderer.initialize();
renderer.start();

Custom scene:

import { Scene, Camera, ObjGeometry, Material, Mesh, RendererContext } from '@dydev10/webgpu-renderer';

class MyScene extends Scene {
  camera = new Camera([-2, 0, 0.5], 0, 0);  // required -- declare in every subclass

  async onAttach(renderer: RendererContext) {
    await super.onAttach(renderer);
    const geo = await ObjGeometry.load(renderer.device, '/ship.obj');
    const mat = await Material.fromURL(renderer.device, '/ship.png');
    this.add(new Mesh(geo, mat));
  }

  update(dt: number) {
    this.camera.update();  // required every frame
  }
}

const renderer = new WebGPURenderer(canvas, { scene: new MyScene() });
await renderer.initialize();
renderer.start();

Manual loop -- drive the frame yourself:

const renderer = new WebGPURenderer(canvas, { scene: new MyScene() });
await renderer.initialize();

function frame() {
  renderer.renderFrame();
  requestAnimationFrame(frame);
}
requestAnimationFrame(frame);

API

| Export | Description | |--------|-------------| | WebGPURenderer | Main class. Owns the GPU device, pipelines, and resource registry. Use setScene() to hot-swap scenes and destroy() to clean up. | | Scene | Abstract base class. Extend to build custom scenes. | | StarterScene | Built-in demo scene with geometry, skybox, and first-person controller. Requires specific asset files served from /img/ and /model/ -- pass explicitly via config.scene. | | Camera | Position and orientation. Computes view/projection matrices. | | Mesh | Pairs a geometry and material with a transform and render layer. | | Geometry | Abstract base for all geometry types. Call destroy() to free the GPU buffer. | | ObjGeometry | Loads a Wavefront OBJ file from a URL. | | TriangleGeometry | Single equilateral triangle (position + texcoord). | | QuadGeometry | Unit quad (position + texcoord). | | Material | 2D texture. Created from a URL or ImageBitmap. Call destroy() to free the GPU texture. | | FullScreenMaterial | Full-screen shader material driven by a user-supplied WGSL fragment shader. Add with new Mesh(null, mat). Call destroy() to free the uniform buffer. | | MeshShaderMaterial | Per-mesh shader material driven by a user-supplied WGSL fragment shader. Compatible with any world-layer mesh. Call destroy() to free the uniform buffer. | | SkyboxMaterial | Cube-map texture. Assign to scene.skybox to enable sky rendering. Call destroy() to free the GPU texture. | | FirstPersonController | WASD + mouse-look. Attach to a canvas and camera. |

See docs/api.md for full signatures and docs/architecture.md for the render loop, resource registry, and threading model.