‹ BackHN Continuity

Thread

SDF vs. MSDF vs. Slug: GPU Text Rendering

180 points · 72 comments · ibobev

  1. zackmorris · · focus · HN ↗
    Everything old is new again (in this case, 27 years old):

    <a href="https:&#x2F;&#x2F;gamedev.net&#x2F;tutorials&#x2F;programming&#x2F;graphics&#x2F;s-buffer-faq-r668" rel="nofollow">https:&#x2F;&#x2F;gamedev.net&#x2F;tutorials&#x2F;programming&#x2F;graphics&#x2F;s-buffer-...

    <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Scanline_rendering" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Scanline_rendering

    <a href="https:&#x2F;&#x2F;mcejp.github.io&#x2F;2021&#x2F;02&#x2F;17&#x2F;s-buffers.html" rel="nofollow">https:&#x2F;&#x2F;mcejp.github.io&#x2F;2021&#x2F;02&#x2F;17&#x2F;s-buffers.html

    It works great except it can have z-fighting issues, especially near t-junctions.

    I&#x27;m wondering if there&#x27;s a way to calculate scan lines along 2 or more axes, then choose the ones with the least uncertainty.

    A similar issue happens with convex hull algorithms. If we wrap along the x axis, we might get a different triangle mesh than if we wrap along the y or z axis, because vertices may be coplanar along an axis. I&#x27;ve considered wrapping along all 3 axes, then choosing the mesh that matches in the most axes.

    Is there a general solution for this? Some point clouds have sets of vertices that are coplanar regardless of which axis we use. I suspect that the number of axes needed might be proportional to the number of vertices. I wonder if we could use something like change of coordinates to wrap the mesh from the frame of reference of each vertex.

    If we had that technique, we could apply it to Slug and render glyphs having minimal error, regardless of how they&#x27;re transformed, if we&#x27;re willing to sacrifice some performance.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.