Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMCL-0000: Backport efficiency note to CM2 for confiner 2d. #907

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
Expand All @@ -25,6 +27,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:

Expand Down
Loading