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

@ripl/webgpu

v1.4.0

Published

WebGPU 3D rendering context for Ripl

Readme

@ripl/webgpu

npm license size

A WebGPU backend for Ripl 3D: the same Shape3D elements as @ripl/3d, rasterized on the GPU instead of face-sorted on a 2D canvas.

Features

  • Hardware depth testing — a real depth buffer replaces the painter's algorithm, so intersecting and self-occluding geometry resolves per fragment rather than per face.
  • WGSL shaders — the fragment shader mirrors @ripl/3d's shadeSurface term for term (ambient, hemisphere, directional, point and spot lights, Blinn-Phong specular, emissive, fog), so a scene shades identically on either backend. The uniform structs are generated from the same descriptor the CPU-side packer writes, so the two cannot disagree about the bytes.
  • 4× MSAA by default, configurable through sampleCount.
  • Its own texture pathTextureManager uploads Texture images to the GPU and caches their bind groups, mapping Ripl's wrap modes to clamp-to-edge/repeat/mirror-repeat and its filters to nearest/linear. Untextured meshes bind a 1×1 white fallback, which keeps the whole backend on a single pipeline rather than one permutation per material.
  • Drop-in swap — shapes, camera, lights, materials, fog and raycasting all come from @ripl/3d unchanged; only the createContext import differs.
  • Configurable clear colour — a straight (non-premultiplied) RGBA clearColor, transparent by default.

Installation

# npm
npm install @ripl/webgpu @ripl/3d @ripl/web

# yarn
yarn add @ripl/webgpu @ripl/3d @ripl/web

# pnpm
pnpm add @ripl/webgpu @ripl/3d @ripl/web

WebGPU needs a browser that supports it (Chrome 113+, Edge 113+, Firefox Nightly). The Canvas Context3D from @ripl/3d stays available as a fallback and takes the same scene.

Quick start

import {
    createContext,
} from '@ripl/webgpu';

import {
    createCamera,
    createCube,
    createDirectionalLight,
    createSphere,
} from '@ripl/3d';

import {
    createRenderer,
    createScene,
} from '@ripl/web';

const context = await createContext('.mount-element');
const scene = createScene(context);

createCamera(context, {
    position: [0, 1.5, 5],
    target: [0, 0, 0],
    interactions: true,
});

context.lights.add(createDirectionalLight({
    direction: [-1, -1, -0.5],
    intensity: 0.8,
}));

scene.add(createCube({
    size: 1,
    x: -1.2,
    fill: '#3a86ff',
}));

scene.add(createSphere({
    radius: 0.6,
    x: 1.2,
    fill: '#ff006e',
}));

createRenderer(scene, {
    autoStop: false,
});

createContext is async — it negotiates a GPU adapter and device before returning.

Key API

| Export | What it does | | --- | --- | | createContext | Async factory returning a WebGPUContext3D | | WebGPUContext3D | The context itself, a Context3D subclass | | requestDevice | Adapter and device negotiation, for reuse or capability checks | | createPipeline | The render pipeline, bind group layouts and vertex buffer layout | | VERTEX_SHADER / FRAGMENT_SHADER | The WGSL source, if you need to read or extend it |

Related packages

  • @ripl/3d — the shapes, camera, lights, materials and textures this backend draws
  • @ripl/web — the scene, renderer and animation
  • @ripl/core — the element and context model underneath both

Documentation

Guides, a live demo and the full API reference are at ripl.run/docs/3d/contexts/webgpu.

License

MIT