-
Notifications
You must be signed in to change notification settings - Fork 125
CMCL-866 - Confiner2D precision issues #530
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
Conversation
… flight control) - 2022.1, 2022.2, trunk
Codecov Report
@@ Coverage Diff @@
## release-prep/2.9.0 #530 +/- ##
======================================================
+ Coverage 24.01% 24.03% +0.01%
======================================================
Files 126 126
Lines 18659 18663 +4
======================================================
+ Hits 4481 4485 +4
Misses 14178 14178
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Camera still moves (a little) in the sample scene, even at max quality.
I'm not convinced that this quality business is a good strategy for handling such edge cases. 0.000005f is an insanely small step size. Maybe we can have a discussion about how to solve this better.
const float k_MinStepSize = 0.005f; | ||
|
||
float m_MinStepSize = k_MinStepSize; | ||
const float k_MinStepSize = 0.005f, k_MaxStepSize = 0.000005f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max is smaller than min?
const float k_IntToFloatScaler = 1.0f / k_FloatToIntScaler; | ||
const float k_MinStepSize = 0.005f; | ||
|
||
float m_MinStepSize = k_MinStepSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be called m_StepSize or something like that? It's a bit confusing between m_MinStepSize and k_MinStepSize.
|
||
m_confinerOven = new ConfinerOven(m_OriginalPath, aspectRatio, maxWindowSize); | ||
|
||
quality = (quality - k_QualityMin) / k_QualityMax; // normalize quality to [0-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalization is not guaranteed, because caller can pass anything for quality
No longer relevant. See clipper2 in CM3 |
Purpose of this PR
https://jira.unity3d.com/browse/CMCL-866 (has repro project)
(This fix will need to be added to 3 and 2.8).
The initial fix for this issue was not precise enough. So now we allow equality for the special case.
Change at
line 264
incom.unity.cinemachine/Runtime/Core/ConfinerOven.cs
.Added new m_Quality field.
I played around with the min step size, and it can be used to improve the quality of the confiner in some of these edge cases. I did not find a big performance impact either. I created a prototype quality control, but maybe we should expose the quality parameter as a scripting API only.
Testing status
Documentation status
Technical risk
Comments to reviewers
Package version