Skip to content
Vascool14Public

About

Draw SVG primitives on the GPU at lightning speeds

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

svg2gpu

Render SVG markup with WebGPU, or compile it into typed, GPU-ready geometry.

Website · Playground · Guide · API reference · npm

Try it

Install

npm install svg2gpu
import { Svg2GPU } from "svg2gpu";

const renderer = new Svg2GPU("preview", {
  svg: `<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="40" fill="#2e9dfe" />
  </svg>`,
  fit: "contain",
  antialias: true,
});

await renderer.ready;

For plain HTML, React integration, every renderer option, and embedded examples, read the getting-started guide. For exact classes and types, open the TypeDoc API reference.

Develop locally

git clone https://github.com/Vascool14/Svg2GPU.git
cd Svg2GPU/svg2gpu
npm install
npm test
npm run build

The library is in svg2gpu/, the website is in client/, and the standalone examples are in codepen/.

Screenshots

Playground TypeDoc
Basic geometry playground TypeDoc API reference

License

MIT

About

Draw SVG primitives on the GPU at lightning speeds

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages