diff --git a/Runtime/Frameworks/UGUI/Shapes/WebShadow.cs b/Runtime/Frameworks/UGUI/Shapes/WebShadow.cs index 709b0d22..5090a797 100644 --- a/Runtime/Frameworks/UGUI/Shapes/WebShadow.cs +++ b/Runtime/Frameworks/UGUI/Shapes/WebShadow.cs @@ -48,7 +48,7 @@ public void SetToMaterial(Material mat) else { mat.SetInt("_StencilReadMask", StencilId); - mat.SetInt("_StencilComp", (int) CompareFunction.LessEqual); + mat.SetInt("_StencilComp", (int) CompareFunction.Greater); } } } @@ -69,7 +69,7 @@ public override Material materialForRendering { var depth = MaskUtilities.GetStencilDepth(MaskRoot, MaskRoot.GetComponentInParent()?.transform ?? MaskRoot.root); var id = 0; - for (int i = 0; i < depth; i++) id |= 1 << i; + for (int i = 0; i <= depth; i++) id |= 1 << i; stencilId = id; }