From 6b6920cfde43d84c59d757b7b96ccabe46d6d75a Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 24 Feb 2025 03:08:28 -0800 Subject: Extra stencil color pass behaves as base pass when disabled and not locked --- 2ner.cginc | 2 +- 2ner.shader | 2 +- features.cginc | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/2ner.cginc b/2ner.cginc index b4e7d8e..e814fd8 100644 --- a/2ner.cginc +++ b/2ner.cginc @@ -121,7 +121,7 @@ float4 frag(v2f i) : SV_Target { pbr.albedo.a = 1; } -#if defined(EXTRA_STENCIL_COLOR_PASS) +#if defined(EXTRA_STENCIL_COLOR_PASS) && defined(_EXTRA_STENCIL_COLOR_PASS) pbr.albedo = _ExtraStencilColor; #endif diff --git a/2ner.shader b/2ner.shader index 8ccd63c..f6e4626 100644 --- a/2ner.shader +++ b/2ner.shader @@ -340,7 +340,7 @@ Shader "yum_food/2ner" //ifex _ExtraStencilColorPass_Enabled==0 [HideInInspector] m_start_ExtraStencilColorPass("Extra stencil color pass", Float) = 0 - [ThryToggle(_)] _ExtraStencilColorPass_Enabled("Enable", Float) = 0 + [ThryToggle(_EXTRA_STENCIL_COLOR_PASS)] _ExtraStencilColorPass_Enabled("Enable", Float) = 0 _ExtraStencilColor("Color", Color) = (1, 1, 1, 1) [ThryWideEnum(Simple, 0, Front Face vs Back Face, 1)] _ExtraStencilColorType ("Stencil Type", Float) = 0 [IntRange] _ExtraStencilColorRef ("Stencil Reference Value", Range(0, 255)) = 0 diff --git a/features.cginc b/features.cginc index bead254..95928a1 100644 --- a/features.cginc +++ b/features.cginc @@ -91,5 +91,9 @@ #pragma shader_feature_local _LTCGI //endex +//ifex _ExtraStencilColorPass_Enabled==0 +#pragma shader_feature_local _EXTRA_STENCIL_COLOR_PASS +//endex + #endif // __FEATURES_INC -- cgit v1.2.3