3 ms·
> It also turns out that some smart people figured out maths hacks to draw rounded boxes for super cheap which UI peeps love because with this hack boxes can be
by yesimahuman 2y ago
> It also turns out that some smart people figured out maths hacks to draw rounded boxes for super cheap which UI peeps love because with this hack boxes can be so round as to appear as circles
Any references to learn more about these hacks?
- pmhpereira 2y agoProbably signed distance fields (SDF).
- leecommamichael 2y agoSome historic articles on software rendering (the original Bill Atkinson stuff) https://www.folklore.org/Round_Rects_Are_Everywhere.html https://www.folklore.org/Round_Rects_Are_Everywhere.html http://wg20.criticalcodestudies.com/index.php?p=/discussion/80/code-critique-roundrects-apple-quickdraw-source-code http://wg20.criticalcodestudies.com/index.php?p=/discussion/... A modern 3D accelerated article (using SDF as another commenter suspected) https://mortoray.com/quickly-drawing-a-rounded-rectangle-with-a-gl-shader/ https://mortoray.com/quickly-drawing-a-rounded-rectangle-wit...
- rustystump 2y agoI was thinking SDFs and the Bill stuff at time of writing. Read my mind. Have to add work by Evan Wallace here too as he is a legend. https://madebyevan.com/shaders/fast-rounded-rectangle-shadows/ https://madebyevan.com/shaders/fast-rounded-rectangle-shadow... https://madebyevan.com/webgl-path-tracing/ https://madebyevan.com/webgl-path-tracing/