[3.x] Physics Interpolation - Fix CPUParticles to work with SceneTreeFTI#104888
Merged
lawnjelly merged 1 commit intogodotengine:3.xfrom Apr 7, 2025
Merged
[3.x] Physics Interpolation - Fix CPUParticles to work with SceneTreeFTI#104888lawnjelly merged 1 commit intogodotengine:3.xfrom
CPUParticles to work with SceneTreeFTI#104888lawnjelly merged 1 commit intogodotengine:3.xfrom
Conversation
CPUParticles to work with SceneTreeFTICPUParticles to work with SceneTreeFTI
rburing
approved these changes
Apr 6, 2025
Member
rburing
left a comment
There was a problem hiding this comment.
I agree that following an interpolated target is the better approach, and probably it's also the only thing that users expect from particles when they turn on FTI.
Member
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes behaviour of
CPUParticlesto behave similarly toParticleswhen using physics interpolation.Notes
SceneTree#103685 while being generally amazing had the unfortunate side effect of breakingCPUParticlessomewhatCPUParticlescontained a lot of specific code to workaround problems caused by the previous server side physics interpolation, these no longer should work in the same wayCPUParticlesis better off using a paradigm of per frame processing, while following an interpolated target (as in [3.x]CPUParticles2D- Add ability to follow physics interpolated target #80931 which does this for 2D). The results are far superior.get_global_transform_interpolated()(which is far more effective now that FTI is done client side)Discussion
In the interests of brevity, this PR currently only changes 2 lines to get the behaviour required. There is therefore quite a lot of unused code now in
CPUParticles, but that might make more sense to remove in a follow up, as it makes this PR easier to review. (Related, the equivalent change in 4.x has less to remove, becauseCPUParticlesphysics interpolation has not yet been forward ported).CPUParticlesnow works perfectly in global and local mode (with physics interpolation on for the branch, withphysics_interpolation_modeset to OFF and an interpolated parent it judders as expected, but users shouldn't normally be using this).GPUParticlesworks perfectly in global and local mode (in bothphysics_interpolation_modesettings for the branch.