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

CPUParticles2D wrong color from color_ramp on frames when node transform is updated in _process() #47920

Open
TheRealOrangus opened this issue Apr 15, 2021 · 0 comments

Comments

@TheRealOrangus
Copy link

Godot version: 3.3 RC 8

It doesn't happen in 3.1.1-stable, but does happen in 3.1.2-stable

OS/device including version:

Windows 10 64bit
Core i5-2400
GTX 750
happens on both GLES2 and GLES3

Issue description:

What expected:
Particles spawn and update their color from color_ramp throughout their life

What happened:
At frames when transform of CPUParticles2D node was updated then all particles would show wrong color from color_ramp, as though instead of particles changing their color, it's the emitter that changes color(see GIF). That only happens when I play the scene, not in editor, and not if transform is updated in _physics_process(), and only after at all particles were emitted.

Here particles move from left to right, bottom one display the correct and expected behaviour, the top one actual behaviour
The particles on the top don't change color throughout their life, they just spawn with different colors
screenshot
also GIF
video-gif

Steps to reproduce:

  1. Create 2d scene
  2. Add CPUParticles2D (Particles2D work fine) with local coords off, lifetime draw order, scale 60, 0 spread, 0 gravity, intial velocity 250 and color_ramp with just 2 different colors like red/blue
  3. Add script that updates transform of that CPUParticles2D node (or of its parent, or its parent's parent, etc) in _process()
  4. Play, as it doesn't happen in editor
  5. Wait until ALL particles are emitted (until particles die and respawn) as that starts to happen only after that moment

Minimal reproduction project:

CPUParticles2dBug.zip
Play project scene
It contains 3 instances of CPUParticles2D with top one being updated every frame, botton one not updated at all, and middle one toggling between updated and not updated every half a second

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

No branches or pull requests

3 participants