From b7eac1cb4497015e233d4144fd06b0c5a63f9214 Mon Sep 17 00:00:00 2001 From: Kenan Date: Thu, 27 Nov 2025 11:09:47 -0800 Subject: [PATCH 1/2] Update QuadtreeRenderer.cs --- .../Runtime/Scripts/Water/QuadtreeRenderer.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs b/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs index 5fee38f..35096e7 100644 --- a/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs +++ b/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs @@ -132,19 +132,19 @@ public void BeginContextRendering(List cameras, MaterialPropertyBlock pr // If a skirting range is required if (m_skirtingSize > m_size) { - using (ListPool.Get(out var skirtingMatrices)) - { - var offsetMatrix = Matrix4x4.Translate(m_currentGridCenter); - skirtingMatrices.Add(offsetMatrix * Matrix4x4.LookAt(Vector3.zero, new Vector3(0f, 0f, 1f), Vector3.up)); - skirtingMatrices.Add(offsetMatrix * Matrix4x4.LookAt(Vector3.zero, new Vector3(1f, 0f, 0f), Vector3.up)); - skirtingMatrices.Add(offsetMatrix * Matrix4x4.LookAt(Vector3.zero, new Vector3(0f, 0f, -1f), Vector3.up)); - skirtingMatrices.Add(offsetMatrix * Matrix4x4.LookAt(Vector3.zero, new Vector3(-1f, 0f, 0f), Vector3.up)); - foreach (var matrix in skirtingMatrices) - { - // These are drawn with DrawMesh so that they can cull individually and be depth sorted correctly - Graphics.DrawMesh(m_skirtingMesh, matrix, Material, gameObject.layer, camera, 0, propertyBlock, ShadowCastingMode.Off, false, null, LightProbeUsage.Off); - } - } + RenderParams rp = new RenderParams(Material); + rp.camera = camera; + //rp.worldBounds //Let Graphics.RenderMesh use the mesh local bounds transformed to world space + rp.matProps = propertyBlock; + rp.shadowCastingMode = ShadowCastingMode.Off; + rp.layer = gameObject.layer; + rp.receiveShadows = false; + rp.lightProbeUsage = LightProbeUsage.Off; + + Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 0f, 0f), Vector3.one)); + Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 90f, 0f), Vector3.one)); + Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 180f, 0f), Vector3.one)); + Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 270f, 0f), Vector3.one)); } } } From 31943d8f2ac2898cf6cc067aa1ca14ff99aa1762 Mon Sep 17 00:00:00 2001 From: Kenan Date: Tue, 2 Dec 2025 21:45:43 -0800 Subject: [PATCH 2/2] Update QuadtreeRenderer.cs --- .../Runtime/Scripts/Water/QuadtreeRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs b/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs index 35096e7..29fbca7 100644 --- a/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs +++ b/com.meta.utilities.environment/Runtime/Scripts/Water/QuadtreeRenderer.cs @@ -132,15 +132,15 @@ public void BeginContextRendering(List cameras, MaterialPropertyBlock pr // If a skirting range is required if (m_skirtingSize > m_size) { - RenderParams rp = new RenderParams(Material); + var rp = new RenderParams(Material); rp.camera = camera; - //rp.worldBounds //Let Graphics.RenderMesh use the mesh local bounds transformed to world space rp.matProps = propertyBlock; rp.shadowCastingMode = ShadowCastingMode.Off; rp.layer = gameObject.layer; rp.receiveShadows = false; rp.lightProbeUsage = LightProbeUsage.Off; + //Updated Graphics.DrawMesh to newer Graphics.RenderMesh. Graphics.DrawMesh is obsolete per the Unity documentation Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 0f, 0f), Vector3.one)); Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 90f, 0f), Vector3.one)); Graphics.RenderMesh(rp, m_skirtingMesh, 0, Matrix4x4.TRS(m_currentGridCenter, Quaternion.Euler(0f, 180f, 0f), Vector3.one));