Skip to content

Commit 51c4f8c

Browse files
committed
fix box shadow showing behind background of the object
1 parent b103518 commit 51c4f8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: Runtime/Frameworks/UGUI/Shapes/WebShadow.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void SetToMaterial(Material mat)
4848
else
4949
{
5050
mat.SetInt("_StencilReadMask", StencilId);
51-
mat.SetInt("_StencilComp", (int) CompareFunction.LessEqual);
51+
mat.SetInt("_StencilComp", (int) CompareFunction.Greater);
5252
}
5353
}
5454
}
@@ -69,7 +69,7 @@ public override Material materialForRendering
6969
{
7070
var depth = MaskUtilities.GetStencilDepth(MaskRoot, MaskRoot.GetComponentInParent<Canvas>()?.transform ?? MaskRoot.root);
7171
var id = 0;
72-
for (int i = 0; i < depth; i++) id |= 1 << i;
72+
for (int i = 0; i <= depth; i++) id |= 1 << i;
7373
stencilId = id;
7474
}
7575

0 commit comments

Comments
 (0)