Wrote SDF shaders for the first time for round corners
I had honestly never used SDFs before, but now I’m a fan. Instead of building extra meshes, masks, or corner textures, the shader just calculates the signed distance to the shape edge and uses that for the fill, border, radius, and antialiasing.
The nice part is how flexible it gets: same base shader, different corner radii, crisp scaling, soft edges, outlines, clipping, etc. A rounded rect is basically just math, and the GPU does the boring part.
It’s one of those things where the concept sounds fancy, but once it clicks, it actually makes the whole UI/rendering side simpler.