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

ParticleProcessMaterial ignores the value set for particle_flag_damping_as_friction #84009

Closed
cherriesandmochi opened this issue Oct 26, 2023 · 6 comments · Fixed by #84028
Closed

Comments

@cherriesandmochi
Copy link

Godot version

v4.2.beta3.official [e8d57af]

System information

Godot v4.2.beta3 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 960 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz (4 Threads)

Issue description

ParticleProcessMaterial will always generate a shader that uses the realistic friction formula for damping, wheter 'particle_flag_damping_as_friction' has been enabled or not.
It's pretty safe to assume that the bug got introduced with #79527.
Additionally, the check for that very flag seems to be inverted:

if (!particle_flags[PARTICLE_FLAG_DAMPING_AS_FRICTION]) {

Steps to reproduce

  • Create a GPUParticles3D node.
  • Assign a new ParticleProcessMaterial to 'process_material'.
  • Convert the ParticleProcessMaterial to a ShaderMaterial
  • Open the shader and go to line 300 to see the "realistic friction" code, which shouldn't have been generated, as 'particle_flag_damping_as_friction' is disabled by default.

Minimal reproduction project

N/A

@akien-mga
Copy link
Member

CC @QbieShay

@QbieShay QbieShay self-assigned this Oct 26, 2023
@QbieShay
Copy link
Contributor

@cherriesandmochi
Copy link
Author

I don't think #84028 closes this issue.
Sorry, I probably wasn't very clear in my report, but the else-branch never gets taken, resulting in the same shader being generated, no matter the value set for 'particle_flag_damping_as_friction'.
I think I should have opened 2 separate issues.

particle_flag_damping_as_friction = false
Screenshot 2023-10-27 144550

particle_flag_damping_as_friction = true
Screenshot 2023-10-27 144604

@QbieShay
Copy link
Contributor

I also opened #84029

Could you verify if it changes by reloading the scene?

@cherriesandmochi
Copy link
Author

cherriesandmochi commented Oct 27, 2023

Reloading the scene and then converting the particle materials into shader materials will still result in identical code, albeit the opposite branch:
grafik

@QbieShay
Copy link
Contributor

Then the two PR i created yesterday should address this issue 👍

@akien-mga akien-mga changed the title ParticleProcessMaterial ignores the value set for 'particle_flag_damping_as_friction' ParticleProcessMaterial ignores the value set for particle_flag_damping_as_friction Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants