Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::warp Namespace Reference

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...
 

Detailed Description

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.

Function Documentation

Float mitsuba::warp::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}

Vector mitsuba::warp::squareToCosineHemisphere ( const Point2 sample)

Sample a cosine-weighted vector on the unit hemisphere with respect to solid angles.

Float mitsuba::warp::squareToCosineHemispherePdf ( const Vector d)
inline

Density of squareToCosineHemisphere() with respect to solid angles.

Point2 mitsuba::warp::squareToStdNormal ( const Point2 sample)

Sample a point on a 2D standard normal distribution.

Internally uses the Box-Muller transformation

Float mitsuba::warp::squareToStdNormalPdf ( const Point2 pos)

Density of squareToStdNormal per unit area.

Point2 mitsuba::warp::squareToTent ( const Point2 sample)

Warp a uniformly distributed square sample to a 2D tent distribution.

Vector mitsuba::warp::squareToUniformCone ( Float  cosCutoff,
const Point2 sample 
)

Uniformly sample a vector that lies within a given cone of angles around the Z axis.

Parameters
cosCutoffCosine of the cutoff angle
sampleA uniformly distributed sample on \([0,1]^2\)
Float mitsuba::warp::squareToUniformConePdf ( Float  cosCutoff)
inline

Uniformly sample a vector that lies within a given cone of angles around the Z axis.

Parameters
cosCutoffCosine of the cutoff angle
sampleA uniformly distributed sample on \([0,1]^2\)
Point2 mitsuba::warp::squareToUniformDisk ( const Point2 sample)

Uniformly sample a vector on a 2D disk.

Point2 mitsuba::warp::squareToUniformDiskConcentric ( const Point2 sample)

Low-distortion concentric square to disk mapping by Peter Shirley (PDF: 1/PI)

Float mitsuba::warp::squareToUniformDiskConcentricPdf ( )
inline

Density of squareToUniformDisk per unit area.

Float mitsuba::warp::squareToUniformDiskPdf ( )
inline

Density of squareToUniformDisk per unit area.

Vector mitsuba::warp::squareToUniformHemisphere ( const Point2 sample)

Uniformly sample a vector on the unit hemisphere with respect to solid angles.

Float mitsuba::warp::squareToUniformHemispherePdf ( )
inline

Density of squareToUniformHemisphere() with respect to solid angles.

Vector mitsuba::warp::squareToUniformSphere ( const Point2 sample)

Uniformly sample a vector on the unit sphere with respect to solid angles.

Float mitsuba::warp::squareToUniformSpherePdf ( )
inline

Density of squareToUniformSphere() with respect to solid angles.

Point2 mitsuba::warp::squareToUniformTriangle ( const Point2 sample)

Convert an uniformly distributed square sample into barycentric coordinates.

Point2 mitsuba::warp::uniformDiskToSquareConcentric ( const Point2 p)

Inverse of the mapping squareToUniformDiskConcentric.