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

Vulkan: GPUParticles3D angular velocity has jumps #49767

Closed
QbieShay opened this issue Jun 20, 2021 · 9 comments · Fixed by #75999
Closed

Vulkan: GPUParticles3D angular velocity has jumps #49767

QbieShay opened this issue Jun 20, 2021 · 9 comments · Fixed by #75999

Comments

@QbieShay
Copy link
Contributor

Godot version

v4.0.dev.custom_build [1acc76f]

System information

Linux Arch, Radeon RX 590

Issue description

Enabling angular velocity results in the particle angle to abruptly jump during the particle lifetime

https://gfycat.com/difficultweebrontosaurus

Steps to reproduce

  • Create a 3D scene with a particle node
  • Assign quad material with particle billboard
  • Enable angular velocity

Minimal reproduction project

No response

@QbieShay QbieShay added this to the 4.0 milestone Jun 20, 2021
@Calinou
Copy link
Member

Calinou commented May 29, 2022

@QbieShay Can you still reproduce this on 4.0.alpha8? Also, can you reproduce this after setting Fixed FPS to 0 on the GPUParticles3D? If not, this might be due to the same cause as #51318.

@Calinou Calinou changed the title Particle angular velocity has jumps Vulkan: GPUParticles3D angular velocity has jumps May 29, 2022
@QbieShay
Copy link
Contributor Author

Still observing strange jumps as of RC2. unfa in rocket chat had a way to repro the issue.

@akien-mga akien-mga modified the milestones: 4.0, 4.x Feb 22, 2023
@akien-mga
Copy link
Member

CC @unfa. Moving to 4.x for now as it's unlikely to be fixed this week.

@Calinou
Copy link
Member

Calinou commented Feb 22, 2023

I can't reproduce this on 4.0.rc3 when using angular velocity + particle billboard in both 2D and 3D after setting Fixed FPS to 0 and disabling Interpolate.

It should be noted that angular velocity does nothing if not using Particle Billboard, which I find a bit surprising.
Edit: This is probably related to #49766.

Minimal reproduction project: test_particle_angular_velocity.zip

2D

simplescreenrecorder-2023-02-22_18.46.29.mp4

3D

There's an initial stray particle at the center that stays until its lifetime ends. This is a GPUParticles3D bug that doesn't occur in 2D.

simplescreenrecorder-2023-02-22_18.46.37.mp4

@unfa
Copy link

unfa commented Feb 23, 2023

I am not sure if this is the same bug, or a different one, but it's been affecting me since the beginning of Godot 4:

All I did here was added randomized angle and damping.

Particle Rotation Jolt.zip

The first frame of a particle existing has a different angle than next one the middle of the motion, and once damping brings the particle to a complete stop, the angle is changed again.
The expected behavior here is the particle orientation to be constant throughout it's lifespan.

SSR-2023-02-23_02.19.57.webm

This "first frame is different" is something that still makes particles sometimes cover the whole screen, be emissive and have weird colors and generally try to trigger photosensitive epilepsy. It used to be so bad I had to stop using particles at all for some time, and then slowly start with CPU particles because the issue was less pronounced with them.

@QbieShay
Copy link
Contributor Author

I have the same with random angle. I feel like there's some strange stuff happening between the moment a particle dies and the moment it is respawned after. I took a video of what I was experiencing (and i could fix it by fading in the particle later).

I am not sure what it is. I have tried making changes to the particle shader (for example angle is not taking into account the lifetime, but it takes directly CUSTOM.y which ignores random lifetime) but even fixing that doesn't fix the issue of the angle. I think it's a discrepancy on how particle data is handled. It doesn't even look like it's an issue with particle index because even when using a constant number for the random, it still shows.

2023-03-25.17-36-35.mp4

@QbieShay
Copy link
Contributor Author

This is in 4.0 stable ^

@clayjohn
Copy link
Member

Taking a look into this.

The base angle is stored in CUSTOM.x in the start() function:

code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, angle_rand);\n";
code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle

Then it is updated in the process() function:

code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, rand_from_seed(alt_seed));\n";
code += " base_angle += CUSTOM.y * LIFETIME * (tex_angular_velocity) * mix(angular_velocity_min,angular_velocity_max, rand_from_seed(alt_seed));\n";
code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle

Note how angle_rand is used the first time, but the second time a new random amount is generated

@QbieShay
Copy link
Contributor Author

Thank you Clay!

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.

8 participants