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

Input for PrimitivePosPdfOutput. More...

#include <PrimitivePosPdfQuery.h>

Public Member Functions

void set (const PrimitivePosSampleInput &posInput, const SurfaceHit &X)
 
void set (const DirectEnergyPdfInput &pdfInput, const lta::PDF &uvwPdf={})
 
void set (const SurfaceHit &X, const std::optional< math::Vector3R > &observationPos=std::nullopt, const lta::PDF &uvwPdf={})
 
const SurfaceHitgetX () const
 
math::Vector3R getPos () const
 Get the sampled position.
 
math::Vector3R getUvw () const
 
const lta::PDFgetUvwPdf () const
 
const std::optional< math::Vector3R > & getObservationPos () const
 

Detailed Description

Member Function Documentation

◆ getObservationPos()

const std::optional< math::Vector3R > & ph::PrimitivePosPdfInput::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).

◆ getPos()

math::Vector3R ph::PrimitivePosPdfInput::getPos ( ) const
inline

Get the sampled position.

Returns
The coordinates of the sampled position. This is generally more accurate (and more performant) than using getObservationRay().getHead().
Note
This is only available if getPdfPos() is non-empty.

◆ getUvw()

math::Vector3R ph::PrimitivePosPdfInput::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::PrimitivePosPdfInput::getUvwPdf ( ) const
inline

Returns
A hint: the PDF of the specifically picked surface parameterization (getUvw()).

◆ getX()

const SurfaceHit & ph::PrimitivePosPdfInput::getX ( ) const
inline
Returns
Information about the sample position we are querying PDF for.

◆ set() [1/3]

void ph::PrimitivePosPdfInput::set ( const DirectEnergyPdfInput & pdfInput,
const lta::PDF & uvwPdf = {} )

◆ set() [2/3]

void ph::PrimitivePosPdfInput::set ( const PrimitivePosSampleInput & posInput,
const SurfaceHit & X )

◆ set() [3/3]

void ph::PrimitivePosPdfInput::set ( const SurfaceHit & X,
const std::optional< math::Vector3R > & observationPos = std::nullopt,
const lta::PDF & uvwPdf = {} )
inline

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