News for hackers. Stuff that matters.
Re:WebGPU Fundamentals by pavlov on Saturday April 15, 2023 @09:01AM (#35580258)
Note that this approach is useless on its own if your app needs to render user-created text because nowadays everybody expects emojis to work and look roughly the same as on Apple’s platforms, which means detailed multi-colored layered vector shapes that SDF font renderers can’t handle.
Re:WebGPU Fundamentals by esperent on Saturday April 15, 2023 @09:28AM (#35580463)
The solution I've used for this, which was a bit tedious but not that hard to implement, was sprites for the icons/emojis and SDF for everything else. I'm sure there would be other solutions too, like layering. So it's not useless, you just need to get creative to overcome the limitations. Like everything else in 3D graphics.
Re:WebGPU Fundamentals by pavlov on Saturday April 15, 2023 @10:15AM (#35580816)
Yes, I agree — I did write “useless on its own” to highlight that you need to extend the SDF rendering model with a different one to handle actual user-generated text.
Re:WebGPU Fundamentals by unconed on Saturday April 15, 2023 @02:41PM (#35583346)
Use.GPU handles this just fine: it uses a subpixel SDF mask with a plain color image. You get crisp edges, just the interior is a bit blurry.