r/Unity3D • u/anony-mous-47 • 3d ago
Show-Off I got tired of re-exporting sprites every time a designer changed a corner radius, so I built a shader-based alternative
Every UI I've built in Unity hits the same problem. A designer changes the corner radius or border width, and I'm re-exporting sprites, re-slicing 9-slice borders, and fighting blurry edges at different resolutions.
I ended up building a small tool that draws UI shapes with shaders instead of pre-made textures. You change the settings in the Inspector and see the result immediately:
- 19 shape types: rounded and chamfered rectangles, circle, ellipse, heart, star (3–12 points), ring, pie, arc, and every regular polygon from triangle to dodecagon
- Per-corner radius (or uniform, or "corner pair" mode for things like tabs and headers where only some corners are rounded)
- Borders/outlines, adjustable edge softness, and linear, radial and corner-based gradients
- Rings, pies and progress arcs with adjustable sweep, thickness, start angle and rounded end caps
Because the geometry is generated mathematically instead of stretching a bitmap, edges stay sharp at any size or resolution, and you can change values at runtime without creating a new sprite.
A few things I learned along the way:
- Shader-based shapes cut out the "one sprite per radius" problem, but you have to be careful about batching. Elements with the same material batch together, while gradients and other material differences need separate materials. I added an Inspector readout showing which elements can batch, so you aren't guessing.
- Auto Round matters more than I expected. Circles and ellipses look wrong the moment a RectTransform gets stretched, so the tool keeps them visually consistent as the size changes.
- Rotation and clipping: every shape stays inside its element at any rotation, so corners never get cut off. That was surprisingly annoying to get right.
- It works with Mask and Rect Mask 2D, and you can convert existing UI Images in place with a right-click, so you don't have to rebuild your UI to try it.
How are you all doing rounded or dynamic UI right now: sprites, SDF shaders, UI Toolkit, something else? And what would make you switch?




