diff --git a/UiRoundedCorners/IndependentRoundedCorners.shader b/UiRoundedCorners/IndependentRoundedCorners.shader index 2db567d..0884cd2 100644 --- a/UiRoundedCorners/IndependentRoundedCorners.shader +++ b/UiRoundedCorners/IndependentRoundedCorners.shader @@ -78,6 +78,11 @@ } float alpha = CalcAlphaForIndependentCorners(i.uv, _halfSize.xy, _rect2props, _r); + + #ifdef UNITY_UI_ALPHACLIP + clip(alpha - 0.001); + #endif + return mixAlpha(tex2D(_MainTex, i.uv), i.color, alpha); } diff --git a/UiRoundedCorners/RoundedCorners.shader b/UiRoundedCorners/RoundedCorners.shader index 7a0ff1b..3465c68 100644 --- a/UiRoundedCorners/RoundedCorners.shader +++ b/UiRoundedCorners/RoundedCorners.shader @@ -74,6 +74,11 @@ Shader "UI/RoundedCorners/RoundedCorners" { } float alpha = CalcAlpha(i.uv, _WidthHeightRadius.xy, _WidthHeightRadius.z); + + #ifdef UNITY_UI_ALPHACLIP + clip(alpha - 0.001); + #endif + return mixAlpha(tex2D(_MainTex, i.uv), i.color, alpha); }