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

More control on Particles randomness #13488

Closed
matrem opened this issue Dec 1, 2017 · 8 comments
Closed

More control on Particles randomness #13488

matrem opened this issue Dec 1, 2017 · 8 comments

Comments

@matrem
Copy link
Contributor

matrem commented Dec 1, 2017

Operating system or device, Godot version, GPU Model and driver (if graphics related):

Issue description:

Only providing one scalar in [0, 1] in random fields, is a bit limitating (for example with particles).

I think random should not be clamped so we can get a random value around ( not clamped) the initial one .
Now we can only have a value between initial and 1 (with random to 1 or even a lesser range with random < 1).

Steps to reproduce:

Link to minimal example project:

@ghost
Copy link

ghost commented Dec 1, 2017

randf() * N would give a random float from 0 to N

edit: not sure if that's what you mean

@matrem
Copy link
Contributor Author

matrem commented Dec 1, 2017

I mean something like that (for example on particle scale) :
https://github.com/matrem/godot/commit/02d0d698b1606246253027432431b02e01a6e4ed
So I can set my scale to X and then configure its randomness in [X-R, X+R] (instead of [X, 1]).

I know that we can do what we want converting the particles materials to shader material, but I think the default particles material should get basic users more possibilities.

@Chaosus
Copy link
Member

Chaosus commented Aug 13, 2019

The randf_range function is fixes this issue ? cc @akien-mga

@bojidar-bg
Copy link
Contributor

@Chaosus this issue is about CpuParticles/ParticleMaterial, not the Random class.

@Chaosus
Copy link
Member

Chaosus commented Aug 13, 2019

Ah.. right

@akien-mga akien-mga changed the title Random, can we have more control More control on Particles randomness Aug 13, 2019
@Calinou
Copy link
Member

Calinou commented Aug 13, 2019

Maybe the *_random properties could be changed to add/remove a random offset with the specified value. For example, if the *_random property was set to 1, the old behaviour could be restored by halving the property and setting the *_random property to the same value.

This means that if initial_velocity is 200 and initial_velocity_random is 50, it would have to be read as "200 ±50" (which is [150; 250]). Random values that exceed logically possible values (such as going below 0 for a property that only accepts values above 0) would likely have to be clamped.

This would break compatibility, so it will have to be done for 4.0.

@Chaosus Chaosus added this to the 4.0 milestone Aug 13, 2019
@pwab
Copy link

pwab commented Jun 16, 2020

I'll just link here to make it part of the discussion in the GIP:
godotengine/godot-proposals#815

@akien-mga
Copy link
Member

Superseded by godotengine/godot-proposals#815.

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

7 participants
@Calinou @Chaosus @akien-mga @bojidar-bg @matrem @pwab and others