From 73a232ed7a570aa2e821e26ed7c0fd3db210d246 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 3 Jun 2025 03:14:20 -0700 Subject: Add depth prepass and more c30 stuff --- 2ner.cginc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to '2ner.cginc') diff --git a/2ner.cginc b/2ner.cginc index ba8b6c8..c0f2ac1 100644 --- a/2ner.cginc +++ b/2ner.cginc @@ -167,7 +167,7 @@ v2f vert(appdata v) { } float4 frag(v2f i, uint facing : SV_IsFrontFace -#if defined(_HARNACK_TRACING) || defined(_SHATTER_WAVE) || defined(_VERTEX_DOMAIN_WARPING) || defined(_CUSTOM30) +#if defined(_HARNACK_TRACING) || defined(_SHATTER_WAVE) || defined(_VERTEX_DOMAIN_WARPING) || (defined(_CUSTOM30) && !defined(_DEPTH_PREPASS)) , out float depth : SV_DepthLessEqual #endif ) : SV_Target { @@ -217,18 +217,33 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace i.uv01.xy = eye_effect_00.uv; #endif +#if defined(_CUSTOM30) && defined(FORWARD_BASE_PASS) #if defined(_CUSTOM30_BASICCUBE) Custom30Output basic_cube_output = BasicCube(i); i.pos = UnityObjectToClipPos(basic_cube_output.objPos); i.normal = basic_cube_output.normal; +#if !defined(_DEPTH_PREPASS) depth = basic_cube_output.depth; #endif +#endif #if defined(_CUSTOM30_BASICWEDGE) Custom30Output basic_wedge_output = BasicWedge(i); i.pos = UnityObjectToClipPos(basic_wedge_output.objPos); i.normal = basic_wedge_output.normal; +#if !defined(_DEPTH_PREPASS) depth = basic_wedge_output.depth; +#endif +#endif +#endif // FORWARD_BASE_PASS + +#if defined(_CUSTOM30_BASICPLATFORM) + Custom30Output basic_platform_output = BasicPlatform(i); + i.pos = UnityObjectToClipPos(basic_platform_output.objPos); + i.normal = basic_platform_output.normal; +#if !defined(_DEPTH_PREPASS) + depth = basic_platform_output.depth; +#endif #endif YumPbr pbr = GetYumPbr(i); @@ -334,7 +349,7 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace UNITY_APPLY_FOG(_unity_fogCoord, lit.rgb); return lit; -#elif defined(SHADOW_CASTER_PASS) || defined(MASKED_STENCIL1_PASS) || defined(MASKED_STENCIL2_PASS) || defined(MASKED_STENCIL3_PASS) || defined(MASKED_STENCIL4_PASS) +#elif defined(SHADOW_CASTER_PASS) || defined(MASKED_STENCIL1_PASS) || defined(MASKED_STENCIL2_PASS) || defined(MASKED_STENCIL3_PASS) || defined(MASKED_STENCIL4_PASS) || defined(DEPTH_PREPASS) return 0; #endif } -- cgit v1.2.3