-
-
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
Fix GPUParticles2D not randomizing seed when set_one_shot
is called
#101688
Fix GPUParticles2D not randomizing seed when set_one_shot
is called
#101688
Conversation
Why does it want me to update the docs? I presume this is a false flag? All I changed was the internals of the |
It's not a false positive, it changes the default value, as Did you intend this to change the default seed? |
Ah fascinating... This is the same issue we ran into in gpu_particles_3d although it didn't flag the default value change... but it should still apply. Previously this was randomized but in a process method due to the side effect of a boolean. Now it is set directly in the method. This definitely isn't something we took into consideration... what are your thoughts on this @clayjohn and @QbieShay? @AThousandShips here's the convo where we've been discussing in detail: https://chat.godotengine.org/channel/rendering/thread/Mgd4xD8bH3TZKrQND |
@AThousandShips is |
It is if you set the seed, but don't think we do that in the documentation generation, but I think the default seed should probably not be set randomly if it wasn't set to that before, but that needs to be discussed, I think the way this is done should be solved locally (No need to tag me immediately again after tagging me) |
My bad. Won't tag as much. Thanks for the heads up.
What do you mean by that? |
As in it should probably ensure it doesn't reset the seed when constructing, I.e. only when calling |
Ah I see. I like the 2nd approach. Is clean and simple. I will go do that |
Why do you think this PR didn't have the same issue? #101596 |
0c725d0
to
fa4daea
Compare
I don't know I haven't studied the code closely, you'd have to go through the code and see if there are any differences in the initialization |
Sounds good. I don't think either of the 2 PRs need to be held up on those questions though. A third PR to make 2d and 3d particles behave consistently may be better suited as we can discuss all those changes in one place. These 2 PRs should make the behavior of 2d and 3d particles the same going from 4.3 to 4.4. At least as far as clay and qbie noticed in the rocket chat |
fa4daea
to
b461c6e
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.
Looks good to me.
b461c6e
to
e4ecdb7
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.
We spoke about this in the rendering meeting.
if (!use_fixed_seed) {
set_seed(Math::rand());
}
should be removed both from gpuparticle2d and gpuparticle3d.
the function calls in the constructor (set seed and set use fixed seed) should be put both here and in gpuparticles3d
Sounds good. I will do that for this PR and open a new pr for 3d particles |
You can do all in the same PR, it's better for reverting just in case we need to. |
Makes sense! Will do! :) |
e4ecdb7
to
3973c0b
Compare
@QbieShay Done 😎 |
Thanks! |
gpu_particles_2d
not randomizing seed when set_one_shot
is calledset_one_shot
is called
gpu_particelse_2d
needed fixing in this regard as well as pointed out by @clayjohn and @QbieShay: #101596 (comment)The seed should be randomized by calls to
set_one_shot
. Although the behavior is redundant imo, @clayjohn made a solid point that we should still do it so that the behavior remains the same for gpu particles between 4.3 and 4.4.