JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28
  • Score
    100M100P100Q84508F
  • License Apache-2.0

Framework-agnostic WebGPU renderer runtime for Plasius projects.

Package Exports

  • @plasius/gpu-renderer
  • @plasius/gpu-renderer/package.json

Readme

@plasius/gpu-renderer

npm version Build Status coverage License Code of Conduct Security Policy Changelog

license

Framework-agnostic WebGPU renderer runtime for Plasius projects. This package is intended to replace Three.js-dependent render orchestration with an explicit WebGPU-first runtime that can be consumed from React, vanilla, or worker-driven app surfaces.

Apache-2.0. ESM + CJS builds.

Install

npm install @plasius/gpu-renderer

Usage

import { createGpuRenderer } from "@plasius/gpu-renderer";

const renderer = await createGpuRenderer({
  canvas: document.querySelector("#scene"),
  clearColor: "#102035",
});

renderer.resize(window.innerWidth, window.innerHeight);
renderer.start();

XR integration

import { createXrManager } from "@plasius/gpu-xr";
import { createGpuRenderer } from "@plasius/gpu-renderer";

const renderer = await createGpuRenderer({ canvas: "#scene" });
const xr = createXrManager();

renderer.bindXrManager(xr, {
  onSessionStart: () => console.log("XR active"),
  onSessionEnd: () => console.log("XR inactive"),
});

API

  • supportsWebGpu(options)
  • createGpuRenderer(options)
  • bindRendererToXrManager(renderer, xrManager, options)
  • defaultRendererClearColor

Demo

Run the demo server from the repo root:

cd gpu-renderer
npm run demo

Then open http://localhost:8000/gpu-renderer/demo/.

Development Checks

npm run lint
npm run typecheck
npm run test:coverage
npm run build
npm run pack:check

Files

  • src/index.js: WebGPU renderer runtime and XR binding helper.
  • src/index.d.ts: public API typings.
  • tests/package.test.js: unit tests for renderer lifecycle behavior.
  • docs/adrs/*: architecture decisions for renderer runtime design.