-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Particles Animation repeat the first frame when using not square sheets #36435
Comments
Workaround: Instead of 3x2 sheet I created a 2x3 sheet with the same frames and it works as expected. |
Can't reproduce in 3.2.2.stable. Minimum reproduction project: 36435.zip |
@tom-jk Thanks for testing it! I'll close this as resolved then. If anyone else can still reproduce this in 3.2.2 or later, please comment so this issue can be reopened. @Anyeos Also, it's best to upload a minimal reproduction project when reporting bugs so people can try reproducing it in the exact same configuration (same renderer, same node properties). |
The problem is still present but different behaviour. And the same behaviour in CPUParticles2D. So it appears to be a bug inside of the sheet handling. Godot Engine v3.2.2.stable.official Here the Godot project to reproduce: |
I looked into this issue and found out that it is caused by an imprecision in the shader when calling floor(). For example the parameter in floor() could be expected to be 1.0 and should be floored to 1.0 but in fact it is something like 0.999999 and gets floored to 0.0 (because of the imprecision). Have a look at my bugfix for the exact line of code #53233 . You will see that I added a 0.5 to the number of frames before using floor which ensures we wont get close to numbers where imprecision might happen. |
Godot version:
3.2 stable
OS/device including version:
Ubuntu 19.10
Issue description:
The Particles2D with Particles Animation repeat the first frame when it animates.
On a 3x2 sheet the Particles Animation shows in this order: 1, 2, 3, 1, 5, 6. But it must be: 1, 2, 3, 4, 5, 6
The sheet is correctly created from left to right and uppter to bottom.
I numerated the sheet and it repeat the number "1". So it is eventualy wrong.
Steps to reproduce:
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: