‹ BackHN Continuity

Thread

SDF vs. MSDF vs. Slug: GPU Text Rendering

180 points · 72 comments · ibobev

  1. rezmason · · focus · HN ↗
    Slug looks impressive!

    The project I'm most known for is basically an MSDF shader with a bloom pass. It serves my needs 100%, though if I expand to support arbitrary text, I may reach for Slug.

    The one issue with MSDF I want to raise is, it seems everybody uses the same msdfgen texture creation program from Viktor Chlumský's master's thesis 11 years ago. I wish there were other implementations. Who ever heard of a graphics technique that was only ever programmed once, and then used everywhere without substantial iteration? We need to de-XKCD-2347 MSDFs for everyone's sake, including and especially Chlumský.

    1. tripzilch · · focus · HN ↗
      > Who ever heard of a graphics technique that was only ever programmed once, and then used everywhere without substantial iteration?

      while I agree with your general point, since you're asking, the table from Paul Bourke's marching cubes code comes to mind:

      <a href="https:&#x2F;&#x2F;paulbourke.net&#x2F;geometry&#x2F;polygonise&#x2F;" rel="nofollow">https:&#x2F;&#x2F;paulbourke.net&#x2F;geometry&#x2F;polygonise&#x2F;

      another one is the &quot;fast hash&quot; GLSL pseudo random number generator that everyone copies from Inigo Quilez:

          float rand(vec2 co){
              return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
          }
      
      despite those constants clearly being the result of some keyboard-bashing, they are copied far and wide :-)
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.