Skip to content

melvi-l/msdf-webgpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I abondoned this project but this was the plan.

WebGPU MSDF Font Renderer

This library aims to provide real-time MSDF font rendering using WebGPU, with on-the-fly MSDF generation from .ttf font executed in WebAssembly scripts running in multiple WebWorkers.
The main thread orchestrates the workers, dispatching glyphs for MSDF computation, updating a shared texture atlas and metadata, and persisting both in IndexedDB for efficient caching and session recovery.

Architecture

  • Main Thread

    • Orchestrates workers.
    • Packs glyphs into a texture atlas (using skyline/bin packing).
    • Updates WebGPU texture and glyph metadata.
    • Persists atlas and metadata into IndexedDB.
  • WebWorkers

    • Run Rust-compiled WASM scripts.
    • Compute MSDF bitmaps and glyph metrics for requested characters.
    • Return results (bitmap + metrics) to the main thread.
  • IndexedDB

    • Stores atlas data (raw buffer or PNG) and glyph metadata.
    • Ensures fast reloading and avoids recomputation on subsequent sessions.

Roadmap

  • Setup HTML CSS Layout
  • Setup main script <-> webworker communication
  • Setup WebGPU and Atlas display <- I gave up here
  • Implement MSDF generation wasm script
  • Implement MSDF webGPU rendering
  • Implement IndexedDB persistance logic and lifecycle

License

IDKY Licence - I don't know yet, license

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors