8 ms·
HarfBuzz Slug Support with WebGL
- jasonjmcghee 6mo agoNote to author: the WebGL has great zoom settings, but WebGPU has different ones that feel very low-sensitivity (at least on trackpad on macos)
- eviks 6mo agoAre there good explanations/demos comparing this to msdf?
- behdad 6mo agomsdf still suffers from detail loss at large sizes, which this method doesn't have.
- eviks 6mo agoThanks, how large of a size? And at lower sizes, what's the performance/quality like? Is this the silver bullet?
- amitp 5mo agoSlug preserves the vector shapes. MSDF first converts to a texture, which can lose small details. How much depends on the size of your texture and the complexity of the font. I expect MSDF will never look better than Slug. However, MSDF can handle lots of distance-based effects (glow, shadow, outline, gradient, etc.)[1], and I don't think Slug does that. And MSDF is constant time whereas (I think) Slug is going to vary depending on the complexity of the font. The Slug paper [2] says: All of the techniques that store data in a texture atlas are inherently using a discrete sampling of what is actually an infinitely precise description of a glyph outline. This inescapably leads to limitations that can be mitigated by increasing the resolution of the texture atlas, but that can never be completely removed. For applications that need to render a wide range of characters at potentially large font sizes, a texture atlas capable of producing glyphs at an acceptable level of quality may have prohibitively large storage requirements. [1] https://www.redblobgames.com/articles/sdf-fonts/#demo https://www.redblobgames.com/articles/sdf-fonts/#demo [2] https://jcgt.org/published/0006/02/02/ https://jcgt.org/published/0006/02/02/
- tikimcfee 6mo agoVery cool. I've noticed slug popping up more often on HN and I've been thinking of finding a way to incorporate it into my project as well. Is this yours? What's your rendering system like - anything novel or fun you run into when working with text and GPU parallelism?
- mcraiha 6mo agoNot mine. I noticed that Aras was mentioning it https://mastodon.gamedev.place/@aras/116335267839588454 https://mastodon.gamedev.place/@aras/116335267839588454
- notachatbot123 6mo agoHarfBuzz = text shaping engine, https://github.com/harfbuzz/harfbuzz https://github.com/harfbuzz/harfbuzz Slug = Formely patented font rendering algorithm for GPUs, freed 2 weeks ago https://terathon.com/blog/decade-slug.html https://terathon.com/blog/decade-slug.html