7. The LCG Random library

the random library implements basic random routines.

7.1. Unit functions

int4 random_seed(seed:int32)

constructs seed vector out of single integer seed

int random_int(seed:int4)

random integer 0..32767

int4 random_int4(seed:int4)

random int4, each component is 0..32767

float random_float(seed:int4)

random float 0..1

float4 random_float4(seed:int4)

random float4, each component is 0..1

7.2. Distribution functions

float3 random_unit_vector(seed:int4)

random float3 unit vector (length=1)

float3 random_in_unit_sphere(seed:int4)

random float3 unit vector (length=1) which happens to be inside a sphere R=1

float3 random_in_unit_disk(seed:int4)

random float3 unit vector (length=1) which happens to be inside a disk R=1, Z=0