From c41e2dd1262adb88c88b393ec89c352c48d1810f Mon Sep 17 00:00:00 2001 From: Antoine Charton Date: Fri, 6 Oct 2023 16:25:15 -0400 Subject: [PATCH 1/4] Update CinemachineConfiner2D.md Packport efficiency note --- com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md index 16da59611..12f4a07d9 100644 --- a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md +++ b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md @@ -25,6 +25,9 @@ Skeleton computation is the most resource-heavy part of the cache calculation, s - To optimize the skeleton calculation, set the **Max Window Size** property to the largest size you expect the camera window to have. Cinemachine does not spend time calculating the skeleton for window sizes larger than that. +## Efficiency +It is much more efficient to have more Cinemachine Cameras with different input bounding shapes and blend between them instead of changing one Confiner2D's input bounding shape, because the initial cost of calculating the confiner shape is high. + # Properties: From 4cd3f075c213e2e2c5b11cd6285718e733e33a2c Mon Sep 17 00:00:00 2001 From: Antoine Charton Date: Fri, 6 Oct 2023 16:43:08 -0400 Subject: [PATCH 2/4] Also add InvalidateLensCache to the backport --- com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md index 12f4a07d9..0e92279a2 100644 --- a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md +++ b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md @@ -16,7 +16,9 @@ In these cases, for efficiency reasons, Cinemachine does not automatically regen - the script by calling InvalidateCache, or - the component inspector; to do so, press the **Invalidate Cache** button. -If the input polygon scales uniformly or translates or rotates, the cache remains valid. +If the input polygon scales uniformly or translates or rotates, the cache remains valid. + +When the Orthographic Size or Field of View of the Cinemachine Camera's lens changes, Cinemachine will not automatically adjust the Confiner for efficiency reasons. To adjust the Confiner, call InvalidateLensCache() from script. ## Oversize Windows If sections of the confining polygon are too small to fully contain the camera window, Cinemachine calculates a polygon skeleton for those regions. This is a shape with no area, that serves as a place to put the camera when it is confined to this region of the shape. From 8d039940a6807b61bf4dfad4f9fc072451d6e076 Mon Sep 17 00:00:00 2001 From: Antoine Charton Date: Fri, 6 Oct 2023 16:47:10 -0400 Subject: [PATCH 3/4] Update CHANGELOG.md --- com.unity.cinemachine/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.cinemachine/CHANGELOG.md b/com.unity.cinemachine/CHANGELOG.md index cfd62f88f..25c4dbc60 100644 --- a/com.unity.cinemachine/CHANGELOG.md +++ b/com.unity.cinemachine/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Bugfix: In some circumstances, FramingTransposer was using the wrong FOV or Ortho size for framing. - Regression fix: CinemachineCollider generated NaN positions if no target was set. - Improved OrbitalFollow's ForceCameraPosition algorithm. +- Documented InvalidateLensCache in confiner2D. - Removed CinemachineTollSettings overlay. From e19f30d6239f95345f2341b22dfdf28d83f39c8c Mon Sep 17 00:00:00 2001 From: Antoine Charton Date: Fri, 6 Oct 2023 16:49:50 -0400 Subject: [PATCH 4/4] Update CinemachineConfiner2D.md --- com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md index 0e92279a2..69f201f54 100644 --- a/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md +++ b/com.unity.cinemachine/Documentation~/CinemachineConfiner2D.md @@ -18,7 +18,7 @@ In these cases, for efficiency reasons, Cinemachine does not automatically regen If the input polygon scales uniformly or translates or rotates, the cache remains valid. -When the Orthographic Size or Field of View of the Cinemachine Camera's lens changes, Cinemachine will not automatically adjust the Confiner for efficiency reasons. To adjust the Confiner, call InvalidateLensCache() from script. +When the Orthographic Size or Field of View of the Cinemachine Camera's lens changes, Cinemachine will not automatically adjust the Confiner for efficiency reasons. To adjust the Confiner, call InvalidateCache() from script. ## Oversize Windows If sections of the confining polygon are too small to fully contain the camera window, Cinemachine calculates a polygon skeleton for those regions. This is a shape with no area, that serves as a place to put the camera when it is confined to this region of the shape.