Implements common warping techniques that map from the unit square to other domains, such as spheres, hemispheres, etc. More...
Functions | |
Warping techniques related to spheres and subsets | |
Vector | squareToUniformSphere (const Point2 &sample) |
Uniformly sample a vector on the unit sphere with respect to solid angles. More... | |
Float | squareToUniformSpherePdf () |
Density of squareToUniformSphere() with respect to solid angles. More... | |
Vector | squareToUniformHemisphere (const Point2 &sample) |
Uniformly sample a vector on the unit hemisphere with respect to solid angles. More... | |
Float | squareToUniformHemispherePdf () |
Density of squareToUniformHemisphere() with respect to solid angles. More... | |
Vector | squareToCosineHemisphere (const Point2 &sample) |
Sample a cosine-weighted vector on the unit hemisphere with respect to solid angles. More... | |
Float | squareToCosineHemispherePdf (const Vector &d) |
Density of squareToCosineHemisphere() with respect to solid angles. More... | |
Vector | squareToUniformCone (Float cosCutoff, const Point2 &sample) |
Uniformly sample a vector that lies within a given cone of angles around the Z axis. More... | |
Float | squareToUniformConePdf (Float cosCutoff) |
Uniformly sample a vector that lies within a given cone of angles around the Z axis. More... | |
Warping techniques that operate in the plane | |
Point2 | squareToUniformDisk (const Point2 &sample) |
Uniformly sample a vector on a 2D disk. More... | |
Float | squareToUniformDiskPdf () |
Density of squareToUniformDisk per unit area. More... | |
Point2 | squareToUniformDiskConcentric (const Point2 &sample) |
Low-distortion concentric square to disk mapping by Peter Shirley (PDF: 1/PI) More... | |
Point2 | uniformDiskToSquareConcentric (const Point2 &p) |
Inverse of the mapping squareToUniformDiskConcentric. More... | |
Float | squareToUniformDiskConcentricPdf () |
Density of squareToUniformDisk per unit area. More... | |
Point2 | squareToUniformTriangle (const Point2 &sample) |
Convert an uniformly distributed square sample into barycentric coordinates. More... | |
Point2 | squareToStdNormal (const Point2 &sample) |
Sample a point on a 2D standard normal distribution. More... | |
Float | squareToStdNormalPdf (const Point2 &pos) |
Density of squareToStdNormal per unit area. More... | |
Point2 | squareToTent (const Point2 &sample) |
Warp a uniformly distributed square sample to a 2D tent distribution. More... | |
Float | intervalToNonuniformTent (Float a, Float b, Float c, Float sample) |
Warp a uniformly distributed sample on [0, 1] to a nonuniform tent distribution with nodes {a, b, c} More... | |
Implements common warping techniques that map from the unit square to other domains, such as spheres, hemispheres, etc.
The main application of this class is to generate uniformly distributed or weighted point sets in certain common target domains.
Warp a uniformly distributed sample on [0, 1] to a nonuniform tent distribution with nodes {a, b, c}
Sample a cosine-weighted vector on the unit hemisphere with respect to solid angles.
Density of squareToCosineHemisphere() with respect to solid angles.
Sample a point on a 2D standard normal distribution.
Internally uses the Box-Muller transformation
Density of squareToStdNormal per unit area.
Warp a uniformly distributed square sample to a 2D tent distribution.
Uniformly sample a vector that lies within a given cone of angles around the Z axis.
cosCutoff | Cosine of the cutoff angle |
sample | A uniformly distributed sample on \([0,1]^2\) |
Uniformly sample a vector that lies within a given cone of angles around the Z axis.
cosCutoff | Cosine of the cutoff angle |
sample | A uniformly distributed sample on \([0,1]^2\) |
Uniformly sample a vector on a 2D disk.
Low-distortion concentric square to disk mapping by Peter Shirley (PDF: 1/PI)
|
inline |
Density of squareToUniformDisk per unit area.
|
inline |
Density of squareToUniformDisk per unit area.
Uniformly sample a vector on the unit hemisphere with respect to solid angles.
|
inline |
Density of squareToUniformHemisphere() with respect to solid angles.
Uniformly sample a vector on the unit sphere with respect to solid angles.
|
inline |
Density of squareToUniformSphere() with respect to solid angles.
Convert an uniformly distributed square sample into barycentric coordinates.
Inverse of the mapping squareToUniformDiskConcentric.