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)));