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

Disable interpolation and use variable FPS in GPUParticles by default #70777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Dec 31, 2022

This fixes various issues caused by simulating particles at a low framerate (then interpolating the result), such as:

  • Curve properties (scale, color) not being interpolated.
  • Jitter at low speed scale, or when moving particles with global coordinates.
  • Collision issues (tunneling, poor friction/bounce response).

From testing on two different GPUs (GeForce GTX 1080 and Radeon RX 6900 XT), simulating particles at a lower framerate then interpolating the result had very little performance benefit in most cases.

Instead, it's better to enable interpolation and reduce simulation rate only when it provides a tangible performance benefit. This may be the case with 100,000+ particles, not so much with a few thousand particles.

One downside of variable-rate simulation is that collision response may vary slightly depending on the rendering FPS. This can be alleviated by using a high fixed FPS value (200 or more), but this can have a noticeable performance impact. In most scenarios, the visual difference is hardly noticeable unless you specifically look for it.

This also improves the documentation for fixed_fps and interpolate properties in GPUParticles2D and GPUParticles3D.

This partially addresses #50824, #51318 and #70748.

@akien-mga
Copy link
Member

There's an issue with the class reference to fix.

There wasn't a lot of feedback on this PR, I guess this will have to wait for 4.1 as it might be too late for changing this (unless there's strong support from the rendering team).

@akien-mga akien-mga modified the milestones: 4.0, 4.1 Feb 10, 2023
This fixes various issues caused by simulating particles at a low framerate
(then interpolating the result), such as:

- Curve properties (scale, color) not being interpolated.
- Jitter at low speed scale, or when moving particles with global coordinates.
- Collision issues (tunneling, poor friction/bounce response).

From testing on two different GPUs (GeForce GTX 1080 and Radeon RX 6900 XT),
simulating particles at a lower framerate then interpolating the result had
very little performance benefit in most cases.

Instead, it's better to enable interpolation and reduce simulation rate
only when it provides a tangible performance benefit.
This may be the case with 100,000+ particles, not so much with
a few thousand particles.
@Calinou Calinou force-pushed the particles-disable-interpolation branch from 25c1d23 to fb59589 Compare February 19, 2023 01:49
@clayjohn clayjohn modified the milestones: 4.1, 4.x May 23, 2023
Copy link
Contributor

@QbieShay QbieShay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After using 4.x for a bit in my free time making VFX, i can tell that almost all issues and gliches i had with my particles disappeared when turning off interpolation. I ended up having it off most of the time. Additionally, for stylized VFX usage, the number of particles total, even in a big VFX, is below 100. Imo not worth the hassle at all for now.

@reduz
Copy link
Member

reduz commented Aug 23, 2023

Two comments on this:

  • If there are glitches, it does not sound like a great idea to turn off a feature by default instead of figuring out what is going on. It's not healthy to do this.
  • If you disable this, I think trails will either not work or they may still revert to fixed fps even if you have it disabled (you can't have trails without fixed fps). I suggest investigating this.

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

Successfully merging this pull request may close these issues.

5 participants