From cd10b0140515cd70630564694dcff0f4616b2e4d Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 24 Feb 2025 02:33:23 -0800 Subject: fix extra stencil pass on transparent (cutout) materials --- 2ner.cginc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/2ner.cginc b/2ner.cginc index 9096923..b4e7d8e 100644 --- a/2ner.cginc +++ b/2ner.cginc @@ -114,9 +114,6 @@ float4 frag(v2f i) : SV_Target { #if defined(_EYE_EFFECT_00) pbr.normal = eye_effect_00.normal; #endif -#if defined(EXTRA_STENCIL_COLOR_PASS) - pbr.albedo = _ExtraStencilColor; -#endif UNITY_BRANCH if (_Mode == 1) { @@ -124,6 +121,10 @@ float4 frag(v2f i) : SV_Target { pbr.albedo.a = 1; } +#if defined(EXTRA_STENCIL_COLOR_PASS) + pbr.albedo = _ExtraStencilColor; +#endif + #if defined(FORWARD_BASE_PASS) applyMatcapsAndRimLighting(i, pbr); #endif -- cgit v1.2.3