Path Class Reference
Core data structure for manipulating a sequence x0,x1,...,xk of points on scene surfaces. Paths are the central unit in the path integral formulation of light transport, upon which path tracing, bidirectional path tracing, and MLT are all founded. More...
#include <Path.h>
Public Member Functions | |
Constructors | |
| Path (const PathVertexList &vertices, Renderer *renderer) | |
| Path (Renderer *renderer) | |
Functionality related to path as a whole | |
| real_t | getContribution () const |
| SpectralSampleSet | getRadiance () const |
| SpectralSampleSet | getContribution (unsigned s, unsigned t, bool tentative=false) |
| real_t | getPdf (unsigned s, unsigned t, bool tentative=false) |
| void | getPdfs (unsigned k, unsigned actualS, real_t *pdfs) |
| void | preview () |
| Draws an OpenGL preview of this path by rendering edges between adjacent vertices using a single GL_LINE_STRIP. | |
Path deletion operations | |
| void | clear () |
| Clears this Path of all vertices, resulting in an empty path. | |
| Path | left (unsigned n) |
| Path | right (unsigned n) |
| void | pop_back () |
| Removes the back vertex (last light vertex) in this Path. | |
| void | pop_front () |
| Removes the front vertex (last eye vertex) in this Path. | |
Path addition operations | |
| bool | append (bool roulette=false) |
| Samples the BSDF at the end of this light path, and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary. | |
| bool | prepend (bool roulette=false) |
| Samples the BSDF at the end of this eye path, and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary. | |
| bool | prepend (const PathVertex &v1) |
| Adds the given PathVertex at the end of this eye path. | |
| bool | append (const Path &path) |
| Appends the given eye subpath onto this light subpath, updating both the cumulative eye and light contributions along the way. | |
PathVertex accessors | |
| PathVertex & | operator[] (unsigned index) |
| const PathVertex & | operator[] (unsigned index) const |
| PathVertex & | front () |
| const PathVertex & | front () const |
| PathVertex & | back () |
| const PathVertex & | back () const |
Size accessors | |
| unsigned | length () const |
| unsigned | getNoVertices () const |
| unsigned | getNoEdges () const |
Miscellaneous functionality | |
| Renderer * | getRenderer () |
| void | setRenderer (Renderer *renderer) |
| std::string | toHeckbertNotation () const |
Protected Member Functions | |
| bool | _samplePathVertex (bool roulette, bool adjoint) |
| Samples the BSDF at the end of the path (which end is determined implicitly by the adjoint parameter), and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary. | |
| bool | _initL (PathVertex &y, const Vector3 &wo, real_t t, SurfacePoint *pt, SpectralSampleSet &alphaL, real_t &pL, bool roulette=false) const |
Initializes light-path vertex y with respect to the point given. | |
| bool | _initE (PathVertex &z, const Vector3 &wo, real_t t, SurfacePoint *pt, SpectralSampleSet &alphaE, real_t &pE, bool roulette=false) const |
Initializes eye-path vertex z with respect to the point given. | |
Protected Attributes | |
| PathVertexList | m_vertices |
| Renderer * | m_renderer |
Detailed Description
Core data structure for manipulating a sequence x0,x1,...,xk of points on scene surfaces. Paths are the central unit in the path integral formulation of light transport, upon which path tracing, bidirectional path tracing, and MLT are all founded.
- Date:
- Fall 2008
Definition at line 25 of file Path.h.
Constructor & Destructor Documentation
| Path::Path | ( | const PathVertexList & | vertices, | |
| Renderer * | renderer | |||
| ) | [inline] |
Member Function Documentation
| real_t Path::getContribution | ( | ) | const [inline] |
| SpectralSampleSet Path::getRadiance | ( | ) | const [inline] |
| SpectralSampleSet Path::getContribution | ( | unsigned | s, | |
| unsigned | t, | |||
| bool | tentative = false | |||
| ) |
- Returns:
- the unweighted contribution of this path broken up into a light subpath prefix of length
sand an eye subpath suffix of lengtht
- Note:
- this method contains an implicit visibility check between the connecting edge which will not be performed if (s + t) is equal to the length of this path (since this path is already assumed to be 'valid', visibility is therefore guaranteed in this case)
if
tentativeis true, the aforementioned visibility check will not be evaluated (visibility is assumed)either this light subpath or the given eye subpath may be empty, but not both (an empty path is considered invalid), which implies that (s + t) >= 2
- See also:
- section 10.2 (pgs 302-305) of Veach's thesis for more details
| real_t Path::getPdf | ( | unsigned | s, | |
| unsigned | t, | |||
| bool | tentative = false | |||
| ) |
| void Path::getPdfs | ( | unsigned | k, | |
| unsigned | actualS, | |||
| real_t * | pdfs | |||
| ) |
- Returns:
- an array of
k+ 1 probability densities inpdfs, corresponding to all of thek+ 1 ways in which this path withkvertices could be broken up into different length light and eye subpaths
- Parameters:
-
k denotes the path length of interest (k <= the length of this path) actualS denotes the length of the actual light path which this path was generated from (actualS <= the length of this path) pdfs is an out-array which is assumed to be preallocated to hold at least k+ 1 real_ts
- Note:
- probability densities are with respect to a surface area measure on the space of all paths
- See also:
- section 10.2 (pgs 302-305) of Veach's thesis for more details
| void Path::preview | ( | ) |
Draws an OpenGL preview of this path by rendering edges between adjacent vertices using a single GL_LINE_STRIP.
| void Path::clear | ( | ) | [inline] |
| Path Path::left | ( | unsigned | n | ) | [inline] |
| Path Path::right | ( | unsigned | n | ) | [inline] |
| void Path::pop_back | ( | ) | [inline] |
| void Path::pop_front | ( | ) | [inline] |
| bool Path::append | ( | bool | roulette = false |
) |
Samples the BSDF at the end of this light path, and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary.
- Parameters:
-
roulette denotes whether or not to apply standard russian roulette to the decision of whether or not to add a vertex
- Returns:
- whether or not a vertex was successfully added
- Note:
- may return false if no surface was found in the sampled direction or if
rouletteis true and the random walk is terminated via russian roulette
| bool Path::prepend | ( | bool | roulette = false |
) |
Samples the BSDF at the end of this eye path, and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary.
- Parameters:
-
roulette denotes whether or not to apply standard russian roulette to the decision of whether or not to add a vertex
- Returns:
- whether or not a vertex was successfully added
- Note:
- may return false if no surface was found in the sampled direction or if
rouletteis true and the random walk is terminated via russian roulette
(camera->getSurfaceArea());
| bool Path::prepend | ( | const PathVertex & | v1 | ) |
Adds the given PathVertex at the end of this eye path.
- Note:
- only valid if the current path is empty, and 'v1' is assumed to be on a sensor
- Returns:
- true if the point was successfully added or false if the operation would invalidate this path
| bool Path::append | ( | const Path & | path | ) |
Appends the given eye subpath onto this light subpath, updating both the cumulative eye and light contributions along the way.
- Note:
- either there are no restrictions or edge cases with respect to path lengths; either or both paths may be empty
- Returns:
- true if the resulting path is valid, false otherwise (the resulting path will be invalid -- zero contribution -- if the last light subpath vertex first eye subpath vertex are not mutually visible)
| PathVertex& Path::operator[] | ( | unsigned | index | ) | [inline] |
| const PathVertex& Path::operator[] | ( | unsigned | index | ) | const [inline] |
| PathVertex& Path::front | ( | ) | [inline] |
| const PathVertex& Path::front | ( | ) | const [inline] |
| PathVertex& Path::back | ( | ) | [inline] |
| const PathVertex& Path::back | ( | ) | const [inline] |
| bool Path::_samplePathVertex | ( | bool | roulette, | |
| bool | adjoint | |||
| ) | [protected] |
Samples the BSDF at the end of the path (which end is determined implicitly by the adjoint parameter), and attempts to add a new PathVertex corresponding to the first surface intersected in the sampled direction, updating all internal data as necessary.
- Parameters:
-
roulette denotes whether or not to apply standard russian roulette to the decision of whether or not to add a vertex
- Returns:
- whether or not a vertex was successfully added
- Note:
- may return false if no surface was found in the sampled direction or if
rouletteis true and the random walk is terminated via russian roulette
| bool Path::_initL | ( | PathVertex & | y, | |
| const Vector3 & | wo, | |||
| real_t | t, | |||
| SurfacePoint * | pt, | |||
| SpectralSampleSet & | alphaL, | |||
| real_t & | pL, | |||
| bool | roulette = false | |||
| ) | const [protected] |
Initializes light-path vertex y with respect to the point given.
- Parameters:
-
roulette denotes whether or not to apply standard russian roulette to the decision of whether or not to add a vertex
- Note:
yandptare assumed to be mutually visible to each other
- Returns:
- the updated cumulative light subpath contribution (
alphaL) and the updated cumulative light subpath probability density (pL) and whether or not to add the vertex (if russian roulette is disabled or succeeded)
| bool Path::_initE | ( | PathVertex & | z, | |
| const Vector3 & | wo, | |||
| real_t | t, | |||
| SurfacePoint * | pt, | |||
| SpectralSampleSet & | alphaE, | |||
| real_t & | pE, | |||
| bool | roulette = false | |||
| ) | const [protected] |
Initializes eye-path vertex z with respect to the point given.
- Parameters:
-
roulette denotes whether or not to apply standard russian roulette to the decision of whether or not to add a vertex
- Note:
zandptare assumed to be mutually visible to each other
- Returns:
- the updated cumulative eye subpath contribution (
alphaE) and the updated cumulative eye subpath probability density (pE) and whether or not to add the vertex (if russian roulette is disabled or succeeded)
Member Data Documentation
PathVertexList Path::m_vertices [protected] |
Renderer* Path::m_renderer [protected] |
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6