Skip to main content

sample_hemisphere_uniform

Function sample_hemisphere_uniform 

Source
pub fn sample_hemisphere_uniform(u1: Real, u2: Real) -> Vec3
Expand description

Uniformly sample a direction on the unit hemisphere (z ≥ 0) given two uniform random numbers u1, u2 ∈ [0, 1).

Returns a unit vector (x, y, z) with z ≥ 0.