Skip to content

Commit 9f538c7

Browse files
authored
Merge pull request kirevdokimov#39 from ArthurD/support_rounded_masks
Adds support for a mask itself to have 'rounded corners'.
2 parents 10116ba + b130613 commit 9f538c7

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

UiRoundedCorners/IndependentRoundedCorners.shader

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
}
7979

8080
float alpha = CalcAlphaForIndependentCorners(i.uv, _halfSize.xy, _rect2props, _r);
81+
82+
#ifdef UNITY_UI_ALPHACLIP
83+
clip(alpha - 0.001);
84+
#endif
85+
8186
return mixAlpha(tex2D(_MainTex, i.uv), i.color, alpha);
8287
}
8388

UiRoundedCorners/RoundedCorners.shader

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ Shader "UI/RoundedCorners/RoundedCorners" {
7474
}
7575

7676
float alpha = CalcAlpha(i.uv, _WidthHeightRadius.xy, _WidthHeightRadius.z);
77+
78+
#ifdef UNITY_UI_ALPHACLIP
79+
clip(alpha - 0.001);
80+
#endif
81+
7782
return mixAlpha(tex2D(_MainTex, i.uv), i.color, alpha);
7883
}
7984

0 commit comments

Comments
 (0)