Hacker News new | ask | show | jobs
by yesimahuman 703 days 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?

2 comments

Some historic articles on software rendering (the original Bill Atkinson stuff) https://www.folklore.org/Round_Rects_Are_Everywhere.html 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-wit...

I 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-shadow... https://madebyevan.com/webgl-path-tracing/

Probably signed distance fields (SDF).