-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Implement particle seek request and seed options. #92089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
One strange thing I noticed though is that when you set particle seed mode to Random then restart particle emission, the seed is changed to a random value which you can see after changing it back to Custom. This makes sense, but this seed is always capped to 1 million due to the inspector hint:
See the second suggestion below which aims to address this.
PS: Are there any plans to expose a high-level GPUParticles3D property that allows for easy seeking, without needing a custom script? I assume this would need to force speed scale to be 0 though (like AnimationPlayer's Manual process mode).
if (fixed_fps > 0) { | ||
frame_time = 1.0 / fixed_fps; | ||
} else { | ||
frame_time = 1.0 / 30.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd document this 30 FPS fallback for particles with fixed FPS set to 0
in the class reference in the fixed_fps
description, as well as RenderingServer.particles_set_request_process_time()
.
Particle trails use the same 30 FPS fallback when Fixed FPS is set to 0.
@Calinou yeah definitely I would like to get to something that has a slider to seek. I don't know yet what should be the design because I have a couple of ideas I want to explore. Those being:
There's also the issue that CPUParticles are not managed by the rendering server so i question whether the rendering server API is the correct way to go, or if i should keep that internal and only expose it via the node with the same interface for cpu and gpuparticles. For now I'm stuck there but I haven't really dedicated more time to this yet. |
Oh and thank you for testing even in the incomplete state!! |
I noticed that as well, and I am not sure why it resets even if the seed is set manually. For what i thought i wrote in the code, it should be possible to override the seed, but it doesn't seem to be working. |
add pre process on clear |
afb2e01
to
8a086b6
Compare
I tested the latest revision of this PR. I've gotten GPUParticles3D seeking to work successfully (it's quite simple to script, only 2 lines of code): $GPUParticles3D.restart()
$GPUParticles3D.request_particles_process(value) Testing project: test_pr_92089.zip particle_seeking.mp4Some remarks:
|
Thank you @Calinou !
Most likely copy-paste error >< i renamed things but I didn't change the little notepad i use to port codeblocks
I had to change something to make it work for gpuparticles, but i didnt for cpuparticles. I need to fix that too, thanks!
Not sure what that is, will investigate.
Likewise, will investigate. |
741b5fd
to
a8ccf34
Compare
38c2599
to
f78e8ad
Compare
f78e8ad
to
49c21ca
Compare
b6eb5df
to
a51b2d4
Compare
a51b2d4
to
fc1337c
Compare
Update: Removed get rid in case we want to manage separate bursts as under-the-hod separate renderingserver particles. Exposed process request on all nodes Documented relevant nodes. Many thanks to @Calinou @AThousandShips and Tuppy |
722a0dd
to
9683d77
Compare
6f355d9
to
7a339a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
aafdd02
to
c40d295
Compare
The purpose of this code is to expose the necessary functions for users and engine devs to develop tooling for properly timing and seeking inside particles. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro> Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
c40d295
to
e9eb0b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me. Have only tested with Calinou's test project and works fine for me as well. Amazing work on this Qbie!
Thanks! |
2024-05-18.18-45-36.mp4
Works ONLY with GPUParticles3D for now.Test project:
particles-skim-test.zip
This PR exposes the required API to then construct better particle timing tools on top of existing particles.
I implemented the seed control in this PR because otherwise any restart() would change the seed, which makes seeking impossible.
TODO
Closes godotengine/godot-proposals#6226
Simpler approach than godotengine/godot-proposals#7085 for editor purposes