rand(float seed, float seed2)... seed2?
1745 6 0- plagelpuss
- Member
- 11 posts
- Joined: Nov. 2017
- Offline
- tamte
- Member
- 8444 posts
- Joined: July 2007
- Offline
for convenience
2 and more separate seeds are very common
As one can be promoted to ui and another can be internal, hence you can have multiple different random numbers controlled just by single seed value from UI
like:
2 and more separate seeds are very common
As one can be promoted to ui and another can be internal, hence you can have multiple different random numbers controlled just by single seed value from UI
like:
float seed = chf("seed"); float r1 = rand(seed, 1); float r2 = rand(seed, 2);
Edited by tamte - July 16, 2019 00:06:43
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jsmack
- Member
- 7658 posts
- Joined: Sept. 2011
- Online
- plagelpuss
- Member
- 11 posts
- Joined: Nov. 2017
- Offline
hmm I guess I am just trying to figure out why you would go through the trouble of creating the signature when there isnt much difference between (as far as code length/ “typing effort”)…
float seed = chf(“seed”);
float r1 = rand(seed, 1);
float r2 = rand(seed, 2);
and
float seed = chf(“seed”);
float r1 = rand(seed + 1);
float r2 = rand(seed + 2);
Does anyone know what the function does with the 2 parameters under the hood?
float seed = chf(“seed”);
float r1 = rand(seed, 1);
float r2 = rand(seed, 2);
and
float seed = chf(“seed”);
float r1 = rand(seed + 1);
float r2 = rand(seed + 2);
Does anyone know what the function does with the 2 parameters under the hood?
Edited by plagelpuss - July 16, 2019 21:59:45
- plagelpuss
- Member
- 11 posts
- Joined: Nov. 2017
- Offline
- tamte
- Member
- 8444 posts
- Joined: July 2007
- Offline
that's exactly the point
functions with 1D seed have this annoying workflow where you do seed+1 or seed*10+55 or whatever arbitrary expression just to try to get a unique set of random numbers
however there is either a large chance of repeating patterns for simple offset expressions or risk of running out of numbers with a crazy multiplier expressions
2D or nD seed simply allows for very clean workflow where you can change random sequence just by changing the seed in different dimension
similarly to a noise based on just a single float and noise based on vector2 or vector3, …
functions with 1D seed have this annoying workflow where you do seed+1 or seed*10+55 or whatever arbitrary expression just to try to get a unique set of random numbers
however there is either a large chance of repeating patterns for simple offset expressions or risk of running out of numbers with a crazy multiplier expressions
2D or nD seed simply allows for very clean workflow where you can change random sequence just by changing the seed in different dimension
similarly to a noise based on just a single float and noise based on vector2 or vector3, …
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- plagelpuss
- Member
- 11 posts
- Joined: Nov. 2017
- Offline
-
- Quick Links