| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using DCL.Models; |
| | 5 | | using UnityEngine; |
| | 6 | | using UnityEngine.Rendering; |
| | 7 | | using UniversalRenderPipelineAsset = UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset; |
| | 8 | | using static DCL.Rendering.CullingControllerUtils; |
| | 9 | |
|
| | 10 | | namespace DCL.Rendering |
| | 11 | | { |
| | 12 | | /// <summary> |
| | 13 | | /// CullingController has the following responsibilities: |
| | 14 | | /// - Hides small renderers (detail objects). |
| | 15 | | /// - Disable unneeded shadows. |
| | 16 | | /// - Enable/disable animation culling for skinned renderers and animation components. |
| | 17 | | /// </summary> |
| | 18 | | public class CullingController : ICullingController |
| | 19 | | { |
| | 20 | | internal List<CullingControllerProfile> profiles = null; |
| | 21 | |
|
| | 22 | | private CullingControllerSettings settings; |
| | 23 | |
|
| 65 | 24 | | private HashSet<Renderer> hiddenRenderers = new HashSet<Renderer>(); |
| 65 | 25 | | private HashSet<Renderer> shadowlessRenderers = new HashSet<Renderer>(); |
| | 26 | |
|
| | 27 | | public UniversalRenderPipelineAsset urpAsset; |
| | 28 | |
|
| 58 | 29 | | public ICullingObjectsTracker objectsTracker { get; private set; } |
| | 30 | | private Coroutine updateCoroutine; |
| | 31 | | private float timeBudgetCount = 0; |
| | 32 | | private bool resetObjectsNextFrame = false; |
| | 33 | | private bool playerPositionDirty; |
| | 34 | | private bool objectPositionsDirty; |
| | 35 | | private bool running = false; |
| | 36 | |
|
| | 37 | | public event ICullingController.DataReport OnDataReport; |
| | 38 | |
|
| | 39 | | public static CullingController Create() |
| | 40 | | { |
| 55 | 41 | | return new CullingController( |
| | 42 | | GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset, |
| | 43 | | new CullingControllerSettings() |
| | 44 | | ); |
| | 45 | | } |
| | 46 | |
|
| 0 | 47 | | private CullingController() { } |
| | 48 | |
|
| 65 | 49 | | public CullingController(UniversalRenderPipelineAsset urpAsset, CullingControllerSettings settings, ICullingObje |
| | 50 | | { |
| 65 | 51 | | if (cullingObjectsTracker == null) |
| 55 | 52 | | objectsTracker = new CullingObjectsTracker(); |
| | 53 | | else |
| 10 | 54 | | objectsTracker = cullingObjectsTracker; |
| | 55 | |
|
| 65 | 56 | | objectsTracker.SetIgnoredLayersMask(settings.ignoredLayersMask); |
| | 57 | |
|
| 65 | 58 | | this.urpAsset = urpAsset; |
| 65 | 59 | | this.settings = settings; |
| 65 | 60 | | } |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Starts culling update coroutine. |
| | 64 | | /// The coroutine will keep running until Stop() is called or this class is disposed. |
| | 65 | | /// </summary> |
| | 66 | | public void Start() |
| | 67 | | { |
| 59 | 68 | | if (running) |
| 0 | 69 | | return; |
| | 70 | |
|
| 59 | 71 | | running = true; |
| 59 | 72 | | CommonScriptableObjects.rendererState.OnChange += OnRendererStateChange; |
| 59 | 73 | | CommonScriptableObjects.playerUnityPosition.OnChange += OnPlayerUnityPositionChange; |
| 59 | 74 | | MeshesInfo.OnAnyUpdated += MarkDirty; |
| 59 | 75 | | objectsTracker?.MarkDirty(); |
| 59 | 76 | | StartInternal(); |
| 59 | 77 | | } |
| | 78 | |
|
| | 79 | | private void StartInternal() |
| | 80 | | { |
| 60 | 81 | | if (updateCoroutine != null) |
| 0 | 82 | | return; |
| | 83 | |
|
| 60 | 84 | | RaiseDataReport(); |
| 60 | 85 | | profiles = new List<CullingControllerProfile> { settings.rendererProfile, settings.skinnedRendererProfile }; |
| 60 | 86 | | updateCoroutine = CoroutineStarter.Start(UpdateCoroutine()); |
| 60 | 87 | | } |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// Stops culling update coroutine. |
| | 91 | | /// </summary> |
| | 92 | | public void Stop() |
| | 93 | | { |
| 69 | 94 | | if (!running) |
| 10 | 95 | | return; |
| | 96 | |
|
| 59 | 97 | | running = false; |
| 59 | 98 | | CommonScriptableObjects.rendererState.OnChange -= OnRendererStateChange; |
| 59 | 99 | | CommonScriptableObjects.playerUnityPosition.OnChange -= OnPlayerUnityPositionChange; |
| 59 | 100 | | MeshesInfo.OnAnyUpdated -= MarkDirty; |
| 59 | 101 | | StopInternal(); |
| 59 | 102 | | objectsTracker?.ForcePopulateRenderersList(true); |
| 59 | 103 | | ResetObjects(); |
| 59 | 104 | | } |
| | 105 | |
|
| | 106 | | public void StopInternal() |
| | 107 | | { |
| 61 | 108 | | if (updateCoroutine == null) |
| 1 | 109 | | return; |
| | 110 | |
|
| 60 | 111 | | CoroutineStarter.Stop(updateCoroutine); |
| 60 | 112 | | updateCoroutine = null; |
| 60 | 113 | | } |
| | 114 | |
|
| | 115 | | /// <summary> |
| | 116 | | /// Process all sceneObject renderers with the parameters set by the given profile. |
| | 117 | | /// </summary> |
| | 118 | | /// <param name="profile">any CullingControllerProfile</param> |
| | 119 | | /// <returns>IEnumerator to be yielded.</returns> |
| | 120 | | internal IEnumerator ProcessProfile(CullingControllerProfile profile) |
| | 121 | | { |
| | 122 | | Renderer[] renderers; |
| | 123 | |
|
| | 124 | | // If profile matches the skinned renderer profile in settings, |
| | 125 | | // the skinned renderers are going to be used. |
| 18 | 126 | | if (profile == settings.rendererProfile) |
| 9 | 127 | | renderers = objectsTracker.GetRenderers(); |
| | 128 | | else |
| 9 | 129 | | renderers = objectsTracker.GetSkinnedRenderers(); |
| | 130 | |
|
| | 131 | |
|
| 82 | 132 | | for (var i = 0; i < renderers.Length; i++) |
| | 133 | | { |
| 23 | 134 | | if (timeBudgetCount > settings.maxTimeBudget) |
| | 135 | | { |
| 0 | 136 | | timeBudgetCount = 0; |
| 0 | 137 | | yield return null; |
| | 138 | | } |
| | 139 | |
|
| 23 | 140 | | Renderer r = renderers[i]; |
| | 141 | |
|
| 23 | 142 | | if (r == null) |
| | 143 | | continue; |
| | 144 | |
|
| 23 | 145 | | bool rendererIsInIgnoreLayer = ((1 << r.gameObject.layer) & settings.ignoredLayersMask) != 0; |
| | 146 | |
|
| 23 | 147 | | if (rendererIsInIgnoreLayer) |
| | 148 | | { |
| 0 | 149 | | SetCullingForRenderer(r, true, true); |
| 0 | 150 | | continue; |
| | 151 | | } |
| | 152 | |
|
| | 153 | |
|
| 23 | 154 | | float startTime = Time.realtimeSinceStartup; |
| | 155 | |
|
| | 156 | | //NOTE(Brian): Need to retrieve positions every frame to take into account |
| | 157 | | // world repositioning. |
| 23 | 158 | | Vector3 playerPosition = CommonScriptableObjects.playerUnityPosition; |
| | 159 | |
|
| 23 | 160 | | Bounds bounds = r.GetSafeBounds(); |
| | 161 | |
|
| 23 | 162 | | Vector3 boundingPoint = bounds.ClosestPoint(playerPosition); |
| 23 | 163 | | float distance = Vector3.Distance(playerPosition, boundingPoint); |
| 23 | 164 | | bool boundsContainsPlayer = bounds.Contains(playerPosition); |
| 23 | 165 | | float boundsSize = bounds.size.magnitude; |
| 23 | 166 | | float viewportSize = (boundsSize / distance) * Mathf.Rad2Deg; |
| | 167 | |
|
| 23 | 168 | | bool isEmissive = IsEmissive(r); |
| 23 | 169 | | bool isOpaque = IsOpaque(r); |
| | 170 | |
|
| 23 | 171 | | float shadowTexelSize = ComputeShadowMapTexelSize(boundsSize, urpAsset.shadowDistance, urpAsset.mainLigh |
| | 172 | |
|
| 23 | 173 | | bool shouldBeVisible = !settings.enableObjectCulling || TestRendererVisibleRule(profile, viewportSize, d |
| 23 | 174 | | bool shouldHaveShadow = !settings.enableShadowCulling || TestRendererShadowRule(profile, viewportSize, d |
| | 175 | |
|
| 23 | 176 | | if (r is SkinnedMeshRenderer skr) |
| | 177 | | { |
| 5 | 178 | | Material mat = skr.sharedMaterial; |
| 5 | 179 | | bool isAvatarRenderer = false; |
| | 180 | |
|
| 5 | 181 | | if (mat != null && mat.shader != null) |
| 0 | 182 | | isAvatarRenderer = mat.shader.name == "DCL/Toon Shader"; |
| | 183 | |
|
| 5 | 184 | | if (isAvatarRenderer) |
| | 185 | | { |
| 0 | 186 | | shouldHaveShadow &= TestAvatarShadowRule(profile, distance); |
| | 187 | | } |
| | 188 | |
|
| 5 | 189 | | skr.updateWhenOffscreen = TestSkinnedRendererOffscreenRule(settings, distance); |
| | 190 | | } |
| | 191 | |
|
| 23 | 192 | | if (OnDataReport != null) |
| | 193 | | { |
| 0 | 194 | | if (!shouldBeVisible && !hiddenRenderers.Contains(r)) |
| 0 | 195 | | hiddenRenderers.Add(r); |
| | 196 | |
|
| 0 | 197 | | if (shouldBeVisible && !shouldHaveShadow && !shadowlessRenderers.Contains(r)) |
| 0 | 198 | | shadowlessRenderers.Add(r); |
| | 199 | | } |
| | 200 | |
|
| 23 | 201 | | SetCullingForRenderer(r, shouldBeVisible, shouldHaveShadow); |
| | 202 | | #if UNITY_EDITOR |
| 23 | 203 | | DrawDebugGizmos(shouldBeVisible, bounds, boundingPoint); |
| | 204 | | #endif |
| 23 | 205 | | timeBudgetCount += Time.realtimeSinceStartup - startTime; |
| | 206 | | } |
| 18 | 207 | | } |
| | 208 | |
|
| | 209 | | /// <summary> |
| | 210 | | /// Main culling loop. Controlled by Start() and Stop() methods. |
| | 211 | | /// </summary> |
| | 212 | | IEnumerator UpdateCoroutine() |
| | 213 | | { |
| 5 | 214 | | while (true) |
| | 215 | | { |
| 834 | 216 | | bool shouldCheck = objectPositionsDirty || playerPositionDirty; |
| | 217 | |
|
| 834 | 218 | | playerPositionDirty = false; |
| 834 | 219 | | objectPositionsDirty = false; |
| | 220 | |
|
| 834 | 221 | | if (!shouldCheck) |
| | 222 | | { |
| 821 | 223 | | timeBudgetCount = 0; |
| 821 | 224 | | yield return null; |
| 769 | 225 | | continue; |
| | 226 | | } |
| | 227 | |
|
| 13 | 228 | | yield return objectsTracker.PopulateRenderersList(); |
| | 229 | |
|
| 8 | 230 | | if (resetObjectsNextFrame) |
| | 231 | | { |
| 4 | 232 | | ResetObjects(); |
| 4 | 233 | | resetObjectsNextFrame = false; |
| | 234 | | } |
| | 235 | |
|
| 8 | 236 | | yield return ProcessAnimations(); |
| | 237 | |
|
| 8 | 238 | | if (OnDataReport != null) |
| | 239 | | { |
| 0 | 240 | | hiddenRenderers.Clear(); |
| 0 | 241 | | shadowlessRenderers.Clear(); |
| | 242 | | } |
| | 243 | |
|
| 8 | 244 | | int profilesCount = profiles.Count; |
| | 245 | |
|
| 44 | 246 | | for (var pIndex = 0; pIndex < profilesCount; pIndex++) |
| | 247 | | { |
| 16 | 248 | | yield return ProcessProfile(profiles[pIndex]); |
| | 249 | | } |
| | 250 | |
|
| 6 | 251 | | RaiseDataReport(); |
| 6 | 252 | | timeBudgetCount = 0; |
| 6 | 253 | | yield return null; |
| | 254 | | } |
| | 255 | | } |
| | 256 | |
|
| | 257 | | /// <summary> |
| | 258 | | /// Sets shadows and visibility for a given renderer. |
| | 259 | | /// </summary> |
| | 260 | | /// <param name="r">Renderer to be culled</param> |
| | 261 | | /// <param name="shouldBeVisible">If false, the renderer visibility will be set to false.</param> |
| | 262 | | /// <param name="shouldHaveShadow">If false, the renderer shadow will be toggled off.</param> |
| | 263 | | internal void SetCullingForRenderer(Renderer r, bool shouldBeVisible, bool shouldHaveShadow) |
| | 264 | | { |
| 33 | 265 | | var targetMode = shouldHaveShadow ? ShadowCastingMode.On : ShadowCastingMode.Off; |
| | 266 | |
|
| 33 | 267 | | if (r.forceRenderingOff != !shouldBeVisible) |
| 14 | 268 | | r.forceRenderingOff = !shouldBeVisible; |
| | 269 | |
|
| 33 | 270 | | if (r.shadowCastingMode != targetMode) |
| 15 | 271 | | r.shadowCastingMode = targetMode; |
| 33 | 272 | | } |
| | 273 | |
|
| | 274 | | /// <summary> |
| | 275 | | /// Sets cullingType to all tracked animation components according to our culling rules. |
| | 276 | | /// </summary> |
| | 277 | | /// <returns>IEnumerator to be yielded.</returns> |
| | 278 | | internal IEnumerator ProcessAnimations() |
| | 279 | | { |
| 12 | 280 | | if (!settings.enableAnimationCulling) |
| 9 | 281 | | yield break; |
| | 282 | |
|
| 3 | 283 | | Animation[] animations = objectsTracker.GetAnimations(); |
| 3 | 284 | | int animsLength = animations.Length; |
| | 285 | |
|
| 24 | 286 | | for (var i = 0; i < animsLength; i++) |
| | 287 | | { |
| 9 | 288 | | if (timeBudgetCount > settings.maxTimeBudget) |
| | 289 | | { |
| 0 | 290 | | timeBudgetCount = 0; |
| 0 | 291 | | yield return null; |
| | 292 | | } |
| | 293 | |
|
| 9 | 294 | | Animation anim = animations[i]; |
| | 295 | |
|
| 9 | 296 | | if (anim == null) |
| | 297 | | continue; |
| | 298 | |
|
| 9 | 299 | | float startTime = Time.realtimeSinceStartup; |
| 9 | 300 | | Transform t = anim.transform; |
| | 301 | |
|
| 9 | 302 | | Vector3 playerPosition = CommonScriptableObjects.playerUnityPosition; |
| 9 | 303 | | float distance = Vector3.Distance(playerPosition, t.position); |
| | 304 | |
|
| 9 | 305 | | if (distance > settings.enableAnimationCullingDistance) |
| 4 | 306 | | anim.cullingType = AnimationCullingType.BasedOnRenderers; |
| | 307 | | else |
| 5 | 308 | | anim.cullingType = AnimationCullingType.AlwaysAnimate; |
| | 309 | |
|
| 9 | 310 | | timeBudgetCount += Time.realtimeSinceStartup - startTime; |
| | 311 | | } |
| 3 | 312 | | } |
| | 313 | |
|
| | 314 | | /// <summary> |
| | 315 | | /// Reset all tracked renderers properties. Needed when toggling or changing settings. |
| | 316 | | /// </summary> |
| | 317 | | internal void ResetObjects() |
| | 318 | | { |
| 64 | 319 | | var skinnedRenderers = objectsTracker.GetSkinnedRenderers(); |
| 64 | 320 | | var renderers = objectsTracker.GetRenderers(); |
| 64 | 321 | | var animations = objectsTracker.GetAnimations(); |
| | 322 | |
|
| 130 | 323 | | for (var i = 0; i < skinnedRenderers?.Length; i++) |
| | 324 | | { |
| 1 | 325 | | if (skinnedRenderers[i] != null) |
| 1 | 326 | | skinnedRenderers[i].updateWhenOffscreen = true; |
| | 327 | | } |
| | 328 | |
|
| 130 | 329 | | for (var i = 0; i < animations?.Length; i++) |
| | 330 | | { |
| 1 | 331 | | if (animations[i] != null) |
| 1 | 332 | | animations[i].cullingType = AnimationCullingType.AlwaysAnimate; |
| | 333 | | } |
| | 334 | |
|
| 654 | 335 | | for (var i = 0; i < renderers?.Length; i++) |
| | 336 | | { |
| 263 | 337 | | if (renderers[i] != null) |
| 263 | 338 | | renderers[i].forceRenderingOff = false; |
| | 339 | | } |
| 64 | 340 | | } |
| | 341 | |
|
| | 342 | | public void Dispose() |
| | 343 | | { |
| 64 | 344 | | objectsTracker.Dispose(); |
| 64 | 345 | | Stop(); |
| 64 | 346 | | } |
| | 347 | |
|
| | 348 | | public void Initialize() |
| | 349 | | { |
| 55 | 350 | | Start(); |
| 55 | 351 | | } |
| | 352 | |
|
| | 353 | | /// <summary> |
| | 354 | | /// Method suscribed to renderer state change |
| | 355 | | /// </summary> |
| | 356 | | private void OnRendererStateChange(bool rendererState, bool oldRendererState) |
| | 357 | | { |
| 3 | 358 | | if (!running) |
| 0 | 359 | | return; |
| | 360 | |
|
| 3 | 361 | | MarkDirty(); |
| | 362 | |
|
| 3 | 363 | | if (rendererState) |
| 1 | 364 | | StartInternal(); |
| | 365 | | else |
| 2 | 366 | | StopInternal(); |
| 2 | 367 | | } |
| | 368 | |
|
| | 369 | | /// <summary> |
| | 370 | | /// Method suscribed to playerUnityPosition change |
| | 371 | | /// </summary> |
| 82 | 372 | | private void OnPlayerUnityPositionChange(Vector3 previous, Vector3 current) { playerPositionDirty = true; } |
| | 373 | |
|
| | 374 | | /// <summary> |
| | 375 | | /// Sets the scene objects dirtiness. |
| | 376 | | /// In the next update iteration, all the scene objects are going to be gathered. |
| | 377 | | /// This method has performance impact. |
| | 378 | | /// </summary> |
| 24 | 379 | | public void MarkDirty() { objectPositionsDirty = true; } |
| | 380 | |
|
| | 381 | | /// <summary> |
| | 382 | | /// Gets the scene objects dirtiness. |
| | 383 | | /// </summary> |
| 3 | 384 | | public bool IsDirty() { return objectPositionsDirty; } |
| | 385 | |
|
| | 386 | | /// <summary> |
| | 387 | | /// Set settings. This will dirty the scene objects and has performance impact. |
| | 388 | | /// </summary> |
| | 389 | | /// <param name="settings">Settings to be set</param> |
| | 390 | | public void SetSettings(CullingControllerSettings settings) |
| | 391 | | { |
| 18 | 392 | | this.settings = settings; |
| 18 | 393 | | profiles = new List<CullingControllerProfile> { settings.rendererProfile, settings.skinnedRendererProfile }; |
| | 394 | |
|
| 18 | 395 | | objectsTracker?.SetIgnoredLayersMask(settings.ignoredLayersMask); |
| 18 | 396 | | objectsTracker?.MarkDirty(); |
| 18 | 397 | | MarkDirty(); |
| 18 | 398 | | resetObjectsNextFrame = true; |
| 18 | 399 | | } |
| | 400 | |
|
| | 401 | | /// <summary> |
| | 402 | | /// Get current settings copy. If you need to modify it, you must set them via SetSettings afterwards. |
| | 403 | | /// </summary> |
| | 404 | | /// <returns>Current settings object copy.</returns> |
| 7 | 405 | | public CullingControllerSettings GetSettingsCopy() { return settings.Clone(); } |
| | 406 | |
|
| | 407 | | /// <summary> |
| | 408 | | /// Enable or disable object visibility culling. |
| | 409 | | /// </summary> |
| | 410 | | /// <param name="enabled">If disabled, object visibility culling will be toggled. |
| | 411 | | /// </param> |
| | 412 | | public void SetObjectCulling(bool enabled) |
| | 413 | | { |
| 0 | 414 | | if (settings.enableObjectCulling == enabled) |
| 0 | 415 | | return; |
| | 416 | |
|
| 0 | 417 | | settings.enableObjectCulling = enabled; |
| 0 | 418 | | resetObjectsNextFrame = true; |
| 0 | 419 | | MarkDirty(); |
| 0 | 420 | | objectsTracker?.MarkDirty(); |
| 0 | 421 | | } |
| | 422 | |
|
| | 423 | | /// <summary> |
| | 424 | | /// Enable or disable animation culling. |
| | 425 | | /// </summary> |
| | 426 | | /// <param name="enabled">If disabled, animation culling will be toggled.</param> |
| | 427 | | public void SetAnimationCulling(bool enabled) |
| | 428 | | { |
| 0 | 429 | | if (settings.enableAnimationCulling == enabled) |
| 0 | 430 | | return; |
| | 431 | |
|
| 0 | 432 | | settings.enableAnimationCulling = enabled; |
| 0 | 433 | | resetObjectsNextFrame = true; |
| 0 | 434 | | MarkDirty(); |
| 0 | 435 | | objectsTracker?.MarkDirty(); |
| 0 | 436 | | } |
| | 437 | |
|
| | 438 | | /// <summary> |
| | 439 | | /// Enable or disable shadow culling |
| | 440 | | /// </summary> |
| | 441 | | /// <param name="enabled">If disabled, no shadows will be toggled.</param> |
| | 442 | | public void SetShadowCulling(bool enabled) |
| | 443 | | { |
| 0 | 444 | | if (settings.enableShadowCulling == enabled) |
| 0 | 445 | | return; |
| | 446 | |
|
| 0 | 447 | | settings.enableShadowCulling = enabled; |
| 0 | 448 | | resetObjectsNextFrame = true; |
| 0 | 449 | | MarkDirty(); |
| 0 | 450 | | objectsTracker?.MarkDirty(); |
| 0 | 451 | | } |
| | 452 | |
|
| | 453 | | /// <summary> |
| | 454 | | /// Fire the DataReport event. This will be useful for showing stats in a debug panel. |
| | 455 | | /// </summary> |
| | 456 | | private void RaiseDataReport() |
| | 457 | | { |
| 66 | 458 | | if (OnDataReport == null) |
| 66 | 459 | | return; |
| | 460 | |
|
| 0 | 461 | | int rendererCount = (objectsTracker.GetRenderers()?.Length ?? 0) + (objectsTracker.GetSkinnedRenderers()?.Le |
| | 462 | |
|
| 0 | 463 | | OnDataReport.Invoke(rendererCount, hiddenRenderers.Count, shadowlessRenderers.Count); |
| 0 | 464 | | } |
| | 465 | |
|
| | 466 | | /// <summary> |
| | 467 | | /// Returns true if the culling loop is running |
| | 468 | | /// </summary> |
| | 469 | | public bool IsRunning() |
| | 470 | | { |
| 6 | 471 | | return updateCoroutine != null; |
| | 472 | | } |
| | 473 | |
|
| | 474 | | /// <summary> |
| | 475 | | /// Draw debug gizmos on the scene view. |
| | 476 | | /// </summary> |
| | 477 | | /// <param name="shouldBeVisible"></param> |
| | 478 | | /// <param name="bounds"></param> |
| | 479 | | /// <param name="boundingPoint"></param> |
| | 480 | | private static void DrawDebugGizmos(bool shouldBeVisible, Bounds bounds, Vector3 boundingPoint) |
| | 481 | | { |
| 23 | 482 | | if (!shouldBeVisible) |
| | 483 | | { |
| 8 | 484 | | CullingControllerUtils.DrawBounds(bounds, Color.blue, 1); |
| 8 | 485 | | CullingControllerUtils.DrawBounds(new Bounds() { center = boundingPoint, size = Vector3.one }, Color.red |
| | 486 | | } |
| 23 | 487 | | } |
| | 488 | | } |
| | 489 | | } |