UI Corner
GPU-accelerated rounded and chamfered corners for Unity UI elements
com.iraklichkuaseli.uicorner 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/uicorner.git README Markdown
Copy this to your project's README.md
## Installation
Add **UI Corner** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/uicorner.git
```
[](https://www.pkglnk.dev/pkg/uicorner)README
UICorner
GPU-accelerated rounded and chamfered corners for Unity UI elements.
Installation
Via OpenUPM (Recommended)
Install via OpenUPM CLI:
openupm add com.iraklichkuaseli.uicorner
Or 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"
}
}
Via Git URL
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
Requirements
- Unity 2021.3 or later
Features
- 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
Usage
- Add
UICornercomponent to any UI Image - Configure each corner independently:
- Style: Rounded or Chamfered
- Size: Corner radius (auto-clamped to prevent overlap)
Technical Details
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
Integration API
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
};
Package Structure
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)
Credits
SDF technique based on Inigo Quilez's 2D distance functions
No comments yet. Be the first!