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

Particles2D - texture animation speed problem with random lifetime #54993

Closed
RPicster opened this issue Nov 15, 2021 · 5 comments
Closed

Particles2D - texture animation speed problem with random lifetime #54993

RPicster opened this issue Nov 15, 2021 · 5 comments

Comments

@RPicster
Copy link
Contributor

RPicster commented Nov 15, 2021

Godot version

3.4 stable

System information

Windows 10 (GLES3)

Issue description

When setting up a Particle2D or CPUParticle2D node with a animated texture (frames setup via a CanvasItemMaterial), the animation won't be fully played when using a random lifetime in the particle system.

The animation will always be played a speed depending on the full lifetime and will be cut off if the particle dies earlier (due to random lifetime)

It can be fixed in the Particle2D node by converting to a shader and changing CUSTOM.y to tv at the anim_speed line.

oQkWu1Mh93.mp4

Steps to reproduce

  • Add a Particle2D or CPUParticle2D node
  • Add a texture (using a spritesheet)
  • Setup the CanvasItemMaterial to be a animated particle texture
  • Add a random lifetime to the Particle node

Minimal reproduction project

3.4_particle_texture_animation_speed.zip

@akien-mga
Copy link
Member

I guess both the current and "fixed" behavior could be considered valid?
How do other parameters behave in relationship to random lifetime, e.g. scale?

@RPicster
Copy link
Contributor Author

RPicster commented Nov 15, 2021

I guess both the current and "fixed" behavior could be considered valid? How do other parameters behave in relationship to random lifetime, e.g. scale?

I remember in the past no other parameters were "influenced" by the random lifetime.
But some time ago this behaviour was changed and now most parameters get influenced by the random lifetime and use the randomized lifetime as their way to measure progressing through time.

After a quick check, following parameters work with a modified random lifetime:

  • color ramp (gradient)
  • angular velocity (curve)
  • orbit velocity (curve)
  • linear acceleration (curve)
  • radial acceleration (curve)
  • tangential acceleration (curve)
  • damping (curve)
  • angle (curve)
  • scale (curve)
  • hue variation (curve)
  • animation offset (curve)

And the following parameters don't work with it:

  • animation speed
  • animation speed (curve)

So I would say that it's really the exception.

@Calinou
Copy link
Member

Calinou commented Nov 15, 2021

Particle random lifetime was originally fixed in #43485, but I guess flipbook animation wasn't taken into account.

Does this bug occur in 3D too?

@akien-mga akien-mga added this to the 3.5 milestone Nov 15, 2021
@RPicster
Copy link
Contributor Author

Particle random lifetime was originally fixed in #43485, but I guess flipbook animation wasn't taken into account.

Does this bug occur in 3D too?

Judging by the code: yes
I tried to reproduce it, but honestly 3D isn't my strength and I didn't find out how to use a flipbook animation in 3D.

RPicster added a commit to RPicster/godot that referenced this issue Nov 23, 2021
…rticle2D gpu + cpu) as mentioned here: godotengine#54993"

This reverts commit 3a18fd0.
RPicster added a commit to RPicster/godot that referenced this issue Nov 26, 2021
@akien-mga
Copy link
Member

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

Successfully merging a pull request may close this issue.

3 participants