3 ms·
Is there an expression for determining whether a pixel is on a bezier curve?
by skykooler 5y ago
Is there an expression for determining whether a pixel is on a bezier curve?
- pengaru 5y agoSearch in [0] for "bezier", iquilez is a magician in this department. [0] https://iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm https://iquilezles.org/www/articles/distfunctions2d/distfunc...
- djmips 5y agoPretty good overview of what you asked about - https://medium.com/@evanwallace/easy-scalable-text-rendering-on-the-gpu-c3f4d782c5ac https://medium.com/@evanwallace/easy-scalable-text-rendering... Other links https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-effects/chapter-25-rendering-vector-art-gpu https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-... https://jcgt.org/published/0006/02/02/ https://jcgt.org/published/0006/02/02/ Also (https://terathon.com/i3d2018_lengyel.pdf https://terathon.com/i3d2018_lengyel.pdf) Which was developed into a product IIRC. Another GPU text renderer https://github.com/hypernewbie/VEFontCache https://github.com/hypernewbie/VEFontCache There's been other development and some posts on Hacker News about rendering fonts on the GPU
- Jasper_ 5y agoBoth of the sibling comments describe quadratic Bezier curves (used often in font rendering because TrueType only supports quadratic), while graphics APIs and CFF font outlines often mandate support for cubic Beziers. Cubics are a lot more challenging to build a closed-form solution for, and also have things like self-intersection which makes it a lot more challenging. Most production renderers, sometimes even ones on the CPU, approximate cubic Bezier curves with a number of quadratic Bezier curves. This is a preprocessing step which needs to be done on the CPU. While it it could be done on the GPU, doing it in the pixel shader would be really wasteful.