Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Someone at work recently copied the ellipse SDF from that page into production code without checking it, and shipped a crash to a ton of people. If you simply glance at it, you’ll see it divides by zero on circles. Then, if you try to check for that, you’ll immediately hit overflow cases for common values in shaders.

I replaced it with correctly designed, numerically robust code.

Don’t use these routines; they’re all similarly land mines of bad numerics. They’re pretty but not robust.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: