Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TPhotonMap< Photon, PhotonStorage > Class Template Referencefinal

Default photon map type. Should be adequate for most cases. More...

#include <TPhotonMap.h>

Classes

struct  PhotonCenterCalculator
 

Public Types

using MapType = math::TIndexedPointKdtree<Photon, uint32, PhotonCenterCalculator, PhotonStorage>
 
using BuildCacheType = MapType::BuildCache
 

Public Member Functions

bool canContribute (const std::size_t viewPathLength, const std::size_t minFullPathLength, const std::size_t maxFullPathLength) const
 
void find (const math::Vector3R &position, const real kernelRadius, std::vector< Photon > &photons) const
 Find all photons in a radius.
 
void find (const math::Vector3R &position, const real kernelRadius, const std::size_t viewPathLength, const std::size_t minFullPathLength, const std::size_t maxFullPathLength, std::vector< Photon > &photons) const
 Find all photons in a radius that can contribute given the path requirements.
 
TPhotonMapInfo< Photon > getInfo () const
 

Public Attributes

MapType map = MapType(2, PhotonCenterCalculator{})
 
std::size_t numPaths = 0
 
uint32 minPathLength = 1
 
uint32 maxPathLength = PMCommonParams::DEFAULT_MAX_PATH_LENGTH
 

Detailed Description

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
class ph::TPhotonMap< Photon, PhotonStorage >

Default photon map type. Should be adequate for most cases.

Member Typedef Documentation

◆ BuildCacheType

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
using ph::TPhotonMap< Photon, PhotonStorage >::BuildCacheType = MapType::BuildCache

◆ MapType

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
using ph::TPhotonMap< Photon, PhotonStorage >::MapType = math::TIndexedPointKdtree<Photon, uint32, PhotonCenterCalculator, PhotonStorage>

Member Function Documentation

◆ canContribute()

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
bool ph::TPhotonMap< Photon, PhotonStorage >::canContribute ( const std::size_t viewPathLength,
const std::size_t minFullPathLength,
const std::size_t maxFullPathLength ) const
inline
Parameters
viewPathLengthThe view path length used for forming a full path.
minFullPathLengthThe minimum full path length to form.
maxFullPathLengthThe maximum full path length to form (inclusive).
Returns
Can this photon map form any paths in the specified full path length range.

◆ find() [1/2]

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
void ph::TPhotonMap< Photon, PhotonStorage >::find ( const math::Vector3R & position,
const real kernelRadius,
const std::size_t viewPathLength,
const std::size_t minFullPathLength,
const std::size_t maxFullPathLength,
std::vector< Photon > & photons ) const
inline

Find all photons in a radius that can contribute given the path requirements.

See also
canContribute().

◆ find() [2/2]

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
void ph::TPhotonMap< Photon, PhotonStorage >::find ( const math::Vector3R & position,
const real kernelRadius,
std::vector< Photon > & photons ) const
inline

Find all photons in a radius.

◆ getInfo()

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
TPhotonMapInfo< Photon > ph::TPhotonMap< Photon, PhotonStorage >::getInfo ( ) const
inline

Member Data Documentation

◆ map

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
MapType ph::TPhotonMap< Photon, PhotonStorage >::map = MapType(2, PhotonCenterCalculator{})

◆ maxPathLength

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
uint32 ph::TPhotonMap< Photon, PhotonStorage >::maxPathLength = PMCommonParams::DEFAULT_MAX_PATH_LENGTH

Maximum length of photon paths in this photon map. The default value is practically infinite number of bounces.

◆ minPathLength

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
uint32 ph::TPhotonMap< Photon, PhotonStorage >::minPathLength = 1

Minimum length of photon paths in this photon map. If a photon lands on a surface for the first time, then its path length is 1 (no need to bounce).

◆ numPaths

template<CPhoton Photon, math::CIndexedPointKdtreeItemStorage< Photon > PhotonStorage = std::vector<Photon>>
std::size_t ph::TPhotonMap< Photon, PhotonStorage >::numPaths = 0

Number of photon paths in this photon map.


The documentation for this class was generated from the following file: