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

GPUParticles2D offsets on collision with LightOccluder2D but ONLY when the Camera2D node is rotated. #92049

Open
Awfyboy opened this issue May 17, 2024 · 3 comments

Comments

@Awfyboy
Copy link

Awfyboy commented May 17, 2024

Tested versions

  • Reproducable in Godot 4.2.1 and 4.2.2

System information

Windows 11 - Godot v4.2.1 - Compatibility Renderer - Intel UHD Graphics 630

Issue description

particle_collision_bug_godot

This is a basic GPUParticle2D node colliding with a LightOccluder2D. It has collisions mode set as Rigid and a Bounce of 0.6. While it works without the Camera being rotated, it seems to break when the Camera rotates. The particles offset after it collides with the Light Occluder, and it ONLY happens when the Camera2D node is rotated. This issue occurs regardless of Bounce or Friction being greater than 0. It always occurs when collisions mode is set as Rigid. No other option seems to cause the issue. I have checked the project in Mobile and Forward+ as well and the issue persists.

The scale of the particles also doesn't change the outcome nor does the rotation. Use Scale is turned on, but turning it off doesn't solve the issue either. Local Coords option on the Particle node is off so I don't think that is the issue, and the GPUParticles2D node is not the parent of the Camera2D node so I don't think it's an issue with SceneTree order either. Fixed FPS is set to 0 in this example, but setting it to the default value of 30 doesn't solve the issue, nor does setting it to a higher value. This appears to be an issue with how physics is calculated on Particle instances.

Steps to reproduce

  1. Create a new project and make a new scene.
  2. Add a LightOccluder2D to your scene.
  3. Add a GPUParticles2D and set collision mode to Rigid.
  4. Add a Camera2D, rotate the node, then turn Ignore Rotation off.

Minimal reproduction project (MRP)

GodotParticles2DCollisionsBug.zip

@greycheeked
Copy link

I think I ran into the same problem. With the help of a test particle shader, I was able to make the problem a little clearer.
When the particles collide, I set their speed to 0 and increase their lifetime slightly.
In the video you can see how the particles stick to the obstacles.
After I rotated the camera a little, the particles suddenly stick to invisible obstacles.
Based on the shape and position, I would say that the camera angle has been doubled during the particle collision. (I have of course also tried other angles).

Particles.Collision.Issue.640x360.mp4.mov

@Awfyboy
Copy link
Author

Awfyboy commented Jun 6, 2024

Oh, interesting. So it appears to be a miscalculation of the viewport rotation?

@greycheeked
Copy link

Unfortunately, I don't understand enough about it, but I'm assuming that during particle collision detection, a transformation is wrong.

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