GPU-accelerated rounded and chamfered corners for Unity UI elements.
Install via OpenUPM CLI:
openupm add com.iraklichkuaseli.uicornerOr add the package via OpenUPM scoped registry in Packages/manifest.json:
{
"scopedRegistries": [
{
"name": "OpenUPM",
"url": "https://package.openupm.com",
"scopes": ["com.iraklichkuaseli"]
}
],
"dependencies": {
"com.iraklichkuaseli.uicorner": "1.1.1"
}
}Add this line to your Packages/manifest.json:
{
"dependencies": {
"com.iraklichkuaseli.uicorner": "https://github.com/irakli/ui-corner.git"
}
}Or install via Package Manager:
- Open Window → Package Manager
- Click the
+button - Select "Add package from git URL"
- Enter:
https://github.com/irakli/ui-corner.git
- Unity 2021.3 or later
- Dual Corner Styles: Rounded (circular arc) and Chamfered (45-degree diagonal cut)
- Per-Corner Control: Mix and match styles independently for each corner
- High Performance: 2.5-3.1× faster than comparable solutions
- Single quadrant selection (vs calculating all 4 corners)
- Minimal GPU operations (1 sqrt vs 6+ in alternatives)
- No trigonometric functions
- Responsive Inspector: Clean UI that works on narrow inspector windows
- Production Ready: Automatic size clamping prevents geometry breakdown
- Add
UICornercomponent to any UI Image - Configure each corner independently:
- Style: Rounded or Chamfered
- Size: Corner radius (auto-clamped to prevent overlap)
Implementation: Signed Distance Field (SDF) rendering using Inigo Quilez's quadrant-selection technique
Compatibility: Works with Unity UI Mask system and all standard Image features
UICorner exposes a PropertiesChanged event that fires whenever corner properties (radius or style) change. This allows you to react to changes for animations, shadow updates, or other visual effects.
var uiCorner = GetComponent<UICorner>();
uiCorner.PropertiesChanged += () => {
// React to corner property changes
};com.iraklichkuaseli.uicorner/
├── package.json # UPM package manifest
├── README.md # This file
├── CHANGELOG.md # Version history
├── LICENSE.md # MIT License
├── Runtime/
│ ├── UICorner.cs # Main component
│ ├── IrakliChkuaseli.UICorner.asmdef
│ └── Shaders/
│ ├── UICorner.shader # Main shader
│ └── UICornerSDF.cginc # SDF calculations
├── Editor/
│ ├── UICornerEditor.cs # Custom inspector
│ └── IrakliChkuaseli.UICorner.Editor.asmdef
├── Icons/
│ └── UICornerIcon.png # Component icon
└── Tests/
├── Editor/ # Editor tests (placeholder)
└── Runtime/ # Runtime tests (placeholder)
SDF technique based on Inigo Quilez's 2D distance functions