‹ BackHN Continuity

Thread

SDF vs. MSDF vs. Slug: GPU Text Rendering

180 points · 72 comments · ibobev

  1. sirwhinesalot · · focus · HN ↗
    There's another GPU text rendering algorithm missing from the comparison: Rook & Possum's Scanline Sweeper:

    <a href="https:&#x2F;&#x2F;rookandpossum.com&#x2F;posts&#x2F;scanline-sweeper&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rookandpossum.com&#x2F;posts&#x2F;scanline-sweeper&#x2F;

    Sean Barret (creator of the stb public domain libraries) independently invented a CPU-based implementation of the same idea, used in stb_truetype.

    1. cubicool · · focus · HN ↗
      I put a ScanlineSweeper impl into slughorn a day or two after he released it (and he was even cool enough to hop on our Discord and help me fix 2 bugs) :) The quality is really great, but without the &quot;banding&quot; (partitioning) that Slug uses, it doesn&#x27;t run quite as fast (and Slug is already a tradeoff in speed for increased quality). It&#x27;s also easier to understand (without all the &quot;tricks&quot; you need for the Slug bands &quot;early discard&quot;), and uses up less VRAM.

      I&#x27;ll be keeping my eye on it, for sure. Like I mentioned elsewhere, slughorn has become WAY more than &quot;just text.&quot; Glyph-centric usage is what made Slug popular, but I&#x27;ve been spending my free time lately trying to figure out how to make it work for vector graphics IN GENERAL (to varying degrees of success, based on the amount of time I can dedicate to it...)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.