Skip to content

Commit b130613

Browse files
committed
Adds support to allow the 'rounded corners' image to BE a mask itself, so that a mask itself can be rounded (via the mask's source image).
1 parent 10116ba commit b130613

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)