Documentation ¶
Overview ¶
Package sequence implements a low-discrepancy sequence for Quasi Monte Carlo integration, and mappings from a uniform sequence to a disk or sphere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CosineSphere ¶
CosineSphere transforms a point (u,v) from the unit square to a vector on the heimsphere around the given normal, cosine weighted. I.e. the resulting vectors are distributed proportionally to the cosine of the angle with the normal, assuming that the original (u,v) are uniformly distributed.
This is used for cosine-weighted importance sampling. E.g. for Lambertian scattering (materials.Matte).
func Halton ¶
Halton(b, i) returns the i'th element of the Halton series with base b. i starts from 0. The base b should be >= 2. See https://en.wikipedia.org/wiki/Halton_sequence
func UniformDisk ¶
UniformDisk maps a point (u,v) from the unit square to the unit disk, preserving uniformity.
This is used for sampling a disk-shaped light source.