GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - diffusionstudio/slug-webgpu: WebGPU implementation of Eric Lengyel's Slug algorithm for resolution-independent vector text rendering on the GPU

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
public
public
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bun.lock
bun.lock
 
 
index.html
index.html
 
 
package.json
package.json
 
 
preview.png
preview.png
 
 
tsconfig.json
tsconfig.json
 
 
vite.config.ts
vite.config.ts
 
 

Repository files navigation

Slug WGSL preview

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

  1. Text shaping (CPU)
    Text is shaped into positioned glyphs using text-shaper.

  2. Curve extraction (CPU)
    Glyph outlines are converted into quadratic Bézier curves.

  3. Band organization (CPU)
    Curves are partitioned into vertical and horizontal bands.

  4. 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

  • https://github.com/EricLengyel/Slug
  • https://terathon.com/blog/decade-slug.html

About

WebGPU implementation of Eric Lengyel's Slug algorithm for resolution-independent vector text rendering on the GPU

Resources

Readme
MIT license
Activity
Custom properties

Stars

228 stars

Watchers

3 watching

Forks

6 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.