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

FlexEGs behaving incorrectly for shape values between -1 and 0 / 0 and +1 #1176

Closed
Lyve1981 opened this issue Jul 19, 2023 · 1 comment · Fixed by #1177
Closed

FlexEGs behaving incorrectly for shape values between -1 and 0 / 0 and +1 #1176

Lyve1981 opened this issue Jul 19, 2023 · 1 comment · Fixed by #1177

Comments

@Lyve1981
Copy link

According to the specification, a shape value of 0 should be linear, values < 0 should be faster, values > 0 slower. However, this does not apply for values that are between -1 and +1 (and not 0):

I looked up the code and found the formula, which is:

For positive shape values:
std::pow(x, shape);

For negative shape values:
1 - std::pow(1 - x, -shape)

Note that, in both cases above, a shape value of 1 results in a linear curve, even though this should happen for a value of 0 (which it does because for the value 0, a default curve is returned).

However, this causes the curve to be the opposite of what you want if the value is -1 < shape < 0 or 0 < shape < 1

For a shape value of -6, its looking good:
image

But notice what happens for a shape value of -1:
image

A very extreme case, a shape value of -0.1, this should be very close to being linear, but it isn't:
image

The correct formula should be:

For positive shape values:
std::pow(x, shape + 1);

For negative shape values:
1 - std::pow(1 - x, -shape + 1)

@PythonBlue
Copy link
Contributor

Speaking as the person responsible for the pull requests that, among other things, added this feature, I appreciate your corrections. I fully admit my own appreoach was a bit crude and may not have been completely accurate to the ARIA implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants