diffusionstudio/slug-webgpu
소개
WebGPU implementation of Eric Lengyel's Slug algorithm for resolution-independent vector text rendering on the GPU
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Slug Algorithm (WebGPU)
A WebGPU implementation of the Slug algorithm, originally created by Eric Lengyel.
This project ports the original HLSL shaders to WGSL and demonstrates a modern GPU-driven text rendering pipeline.
Overview
The Slug algorithm renders high-quality vector text entirely on the GPU by converting glyph outlines into a banded Bézier representation.
This repository includes:
- WGSL shader implementations of the Slug algorithm
- A minimal WebGPU rendering setup
- A TypeScript-based shaping pipeline using
text-shaper(a HarfBuzz alternative) - An example using the Inter font
Rendering Pipeline
Text shaping (CPU)
Text is shaped into positioned glyphs usingtext-shaper.Curve extraction (CPU)
Glyph outlines are converted into quadratic Bézier curves.Band organization (CPU)
Curves are partitioned into vertical and horizontal bands.Rendering (GPU)
The Slug algorithm evaluates the bands and rasterizes glyphs fully on the GPU.
Getting Started
Requirements
- Bun v1.2+
- A WebGPU-compatible browser (e.g. Chrome, Edge)
Install
bun install
Acknowledgements
Huge thanks to Eric Lengyel for creating the Slug algorithm and releasing it into the public domain.
Sources
관련 프로젝트 살펴보기
불러오는 중…