Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::PrimitivePosSampleInput Class Referencefinal

Input for PrimitivePosSampleQuery. More...

#include <PrimitivePosSampleQuery.h>

Public Member Functions

void set (const DirectEnergySampleInput &directInput, const math::Vector3R &uvw={0, 0, 0}, const lta::PDF &uvwPdf={}, bool suggestDir=false)
 
void set (const Time &time, const std::optional< math::Vector3R > &observationPos=std::nullopt, const math::Vector3R &uvw={0, 0, 0}, const lta::PDF &uvwPdf={}, bool suggestDir=false)
 
const TimegetTime () const
 
const std::optional< math::Vector3R > & getObservationPos () const
 
const math::Vector3RgetUvw () const
 
const lta::PDFgetUvwPdf () const
 
bool suggestDir () const
 

Detailed Description

Member Function Documentation

◆ getObservationPos()

const std::optional< math::Vector3R > & ph::PrimitivePosSampleInput::getObservationPos ( ) const
inline

If an observation position is given, the sample operation can be treated as if viewing from that position (and treating the primitive as opaque). Useful for generating better sample position and/or selecting different set of output.

Returns
A hint: an optional observation position.
Note
Given the same observation position, the sample provider should always return the same set of output (one observation position maps to one set of output).

◆ getTime()

const Time & ph::PrimitivePosSampleInput::getTime ( ) const
inline

◆ getUvw()

const math::Vector3R & ph::PrimitivePosSampleInput::getUvw ( ) const
inline
Returns
A hint: a specifically picked surface parameterization of the sample position. This kind of inverse mapping may not be always possible, and can invalidate the output if the mapping failed.
Note
This will only be considered only if its corresponding PDF (getUvwPdf()) is non-empty.

◆ getUvwPdf()

const lta::PDF & ph::PrimitivePosSampleInput::getUvwPdf ( ) const
inline
Returns
A hint: the PDF of the specifically picked surface parameterization (getUvw()).

◆ set() [1/2]

void ph::PrimitivePosSampleInput::set ( const DirectEnergySampleInput & directInput,
const math::Vector3R & uvw = {0, 0, 0},
const lta::PDF & uvwPdf = {},
bool suggestDir = false )

◆ set() [2/2]

void ph::PrimitivePosSampleInput::set ( const Time & time,
const std::optional< math::Vector3R > & observationPos = std::nullopt,
const math::Vector3R & uvw = {0, 0, 0},
const lta::PDF & uvwPdf = {},
bool suggestDir = false )
inline

◆ suggestDir()

bool ph::PrimitivePosSampleInput::suggestDir ( ) const
inline

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