You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used quartic-out in a project and when testing on some older hardware (ATI Radeon HD 2600 Pro 256MB, in a 2008 iMac), I found that it gave crazy results:
I narrowed it down to the pow() call, then found that actually pow(x,y)is undefined when x<0. This pull request just tweaks the shaders so they avoid passing x<0 to pow, which fixes all eases on this hardware:
I also added a blue.glsl to get the tests working.
Only feedback would be the possibility that they could have explicit abs (or alternatively clamp(t, 0.0, 1.0)) so that they extend smoothly to negative numbers. Like if you have floating point -0.0000001, they'll still break badly on some mobile devices, right?
Hi, thanks for reviewing! I considered adding clamp but decided not to for a couple of reasons - I think it's a well known contract with easing functions that t must be in the range[0,1], so it might be better for performance to leave that validation up to the user. And the existing codebase didn't validate input so I didn't want to meddle.
#8 addresses this by just getting pow() to work correctly, perhaps even just by unrolling powers. Not sure whether pow(abs(__), 3.0) or x * x * x is optimal, but that seems a distant second to just getting it consistent. The solution, therefore, is not to clamp but just to make sure the results are not undefined outside the range [0, 1].
Will close this once one patch or another is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I used
quartic-outin a project and when testing on some older hardware (ATI Radeon HD 2600 Pro 256MB, in a 2008 iMac), I found that it gave crazy results:I narrowed it down to the pow() call, then found that actually
pow(x,y)is undefined when x<0. This pull request just tweaks the shaders so they avoid passingx<0topow, which fixes all eases on this hardware:I also added a
blue.glslto get the tests working.