Various random functions.

These are wgsl functions, not js functions. The function is enclosed in a js string constant, to be appended into the code to reference it in the string shader.

Source:
core/random.js, line 1

Members

staticconstantrand String

Random number that returns a vec2f.
You have to set the rand_seed before calling rand().

Source:
core/random.js, line 58
Example
import { rand } from 'points/random';
rand_seed.x = .01835255;

// wgsl string
${rand}
let value = rand();
js

staticconstantrand2 String

Random number from vec2f param

Source:
core/random.js, line 82
Example
import { rand2 } from 'points/random';

// wgsl string
${rand2}
let value = rand2(uvr);
js

staticconstantrandom String

Single random number. Use seed to change seed.

Source:
core/random.js, line 25
Example
import { random } from 'points/random';

// wgsl string
${random}
let value = random();
js

MIT

Documentation generated by JSDoc 4.0.4 using Docolatte theme on