From c05697070e70372356bee0c10e6b2aff557ce750 Mon Sep 17 00:00:00 2001 From: StarBeats <977663818@qq.com> Date: Wed, 25 Jun 2025 15:01:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=94=A5=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/OcclusionCulling/HizObjectsManager.cs | 2 +- .../Runtime/OcclusionCulling/Shaders/HizCull.shader | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/HizObjectsManager.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/HizObjectsManager.cs index f685636..01ea148 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/HizObjectsManager.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/HizObjectsManager.cs @@ -165,7 +165,7 @@ namespace X.Rendering.Feature var rdr = renderers[i]; if (rdr && cullResult.ResultArray.IsCreated) { - bool needCull = cullResult.ResultArray[i] > 0; + bool needCull = cullResult.ResultArray[i] > 0.5f; #if UNITY_EDITOR if (ShowDebug && rdr.GetComponent() is CullDebug cullDebug && cullDebug) { diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/Shaders/HizCull.shader b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/Shaders/HizCull.shader index 24f611b..3755144 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/Shaders/HizCull.shader +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/OcclusionCulling/Shaders/HizCull.shader @@ -107,13 +107,13 @@ #endif } + if(maxXY.x < 0 || maxXY.y < 0 || minXY.x > 1 || minXY.y > 1) + { + return 1; + } + float4 boxUVs = float4(minXY, maxXY); - // if( boxUVs.x < 0 || boxUVs.y < 0 || boxUVs.x > 1 || boxUVs.y > 1 || boxUVs.z >1 || boxUVs.z<0) - // { - // return 1; - // } - float2 size = (boxUVs.zw - boxUVs.xy) * _Mip0Size.xy; float mip = (log2(max(size.x, size.y)));