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

Common operations for surface tracing. This class also handles many subtle cases for surface tracing. You may take the implementations here as reference if a more fine-grained control is needed for a custom operation. More...

#include <SurfaceTracer.h>

Public Member Functions

 SurfaceTracer (const Scene *scene)
 
bool traceNextSurface (const Ray &ray, const SidednessAgreement &sidedness, SurfaceHit *out_X) const
 Find the next surface. This variant does not refine the surface hit point. If refining is desired, see traceNextSurfaceFrom().
 
bool traceNextSurfaceFrom (const SurfaceHit &X, const Ray &ray, const SidednessAgreement &sidedness, SurfaceHit *out_X) const
 Find the next surface from a location. This variant also refines the surface hit point before starting the trace.
 
bool bsdfSampleNextSurface (BsdfSampleQuery &bsdfSample, SampleFlow &sampleFlow, SurfaceHit *out_X) const
 Uses BSDF sample to trace the next surface.
 
bool doBsdfSample (BsdfSampleQuery &bsdfSample, SampleFlow &sampleFlow) const
 
bool doBsdfSample (BsdfSampleQuery &bsdfSample, SampleFlow &sampleFlow, Ray *out_sampledRay) const
 
bool doBsdfEvaluation (BsdfEvalQuery &bsdfEval) const
 
bool doBsdfPdfQuery (BsdfPdfQuery &bsdfPdfQuery) const
 
bool sampleZeroBounceEmission (const SurfaceHit &Xe, const SidednessAgreement &sidedness, math::Spectrum *out_Le) const
 

Detailed Description

Common operations for surface tracing. This class also handles many subtle cases for surface tracing. You may take the implementations here as reference if a more fine-grained control is needed for a custom operation.

Constructor & Destructor Documentation

◆ SurfaceTracer()

ph::lta::SurfaceTracer::SurfaceTracer ( const Scene * scene)
inlineexplicit

Member Function Documentation

◆ bsdfSampleNextSurface()

bool ph::lta::SurfaceTracer::bsdfSampleNextSurface ( BsdfSampleQuery & bsdfSample,
SampleFlow & sampleFlow,
SurfaceHit * out_X ) const
inline

Uses BSDF sample to trace the next surface.

Returns
Is the next surface found. Output parameters are not usable if false is returned.

◆ doBsdfEvaluation()

bool ph::lta::SurfaceTracer::doBsdfEvaluation ( BsdfEvalQuery & bsdfEval) const
inline
Returns
Whether the BSDF has potential to contribute.

◆ doBsdfPdfQuery()

bool ph::lta::SurfaceTracer::doBsdfPdfQuery ( BsdfPdfQuery & bsdfPdfQuery) const
inline
Returns
Whether the PDF is non-zero and has a sane value.

◆ doBsdfSample() [1/2]

bool ph::lta::SurfaceTracer::doBsdfSample ( BsdfSampleQuery & bsdfSample,
SampleFlow & sampleFlow ) const
inline
Returns
Whether the BSDF sample has potential to contribute.

◆ doBsdfSample() [2/2]

bool ph::lta::SurfaceTracer::doBsdfSample ( BsdfSampleQuery & bsdfSample,
SampleFlow & sampleFlow,
Ray * out_sampledRay ) const
inline
Returns
Whether the BSDF sample has potential to contribute. Output parameters are not usable if false is returned.

◆ sampleZeroBounceEmission()

bool ph::lta::SurfaceTracer::sampleZeroBounceEmission ( const SurfaceHit & Xe,
const SidednessAgreement & sidedness,
math::Spectrum * out_Le ) const
inline
Parameters
out_LeThe sampled emitted energy of Xe in the opposite direction of incident ray. Does not contain any weighting.
Returns
Whether the sample has potential to contribute. Output parameters are not usable if false is returned.

◆ traceNextSurface()

bool ph::lta::SurfaceTracer::traceNextSurface ( const Ray & ray,
const SidednessAgreement & sidedness,
SurfaceHit * out_X ) const
inline

Find the next surface. This variant does not refine the surface hit point. If refining is desired, see traceNextSurfaceFrom().

Parameters
rayThe ray that is used for finding the next surface.
sidednessSidedness policy.
Returns
out_X The next surface.
Is the next surface found. Output parameters are not usable if false is returned.
Note
If you are tracing from a surface (not a point from the mid-air), traceNextSurfaceFrom(const SurfaceHit&, const Ray&, const SidednessAgreement&, SurfaceHit*) may be more robust.

◆ traceNextSurfaceFrom()

bool ph::lta::SurfaceTracer::traceNextSurfaceFrom ( const SurfaceHit & X,
const Ray & ray,
const SidednessAgreement & sidedness,
SurfaceHit * out_X ) const
inline

Find the next surface from a location. This variant also refines the surface hit point before starting the trace.

Parameters
XThe location to start the find from. Can also use the object as out_X.
rayThe ray that is used for finding the next surface.
sidednessSidedness policy.
Returns
out_X The next surface.
Is the next surface found. Output parameters are not usable if false is returned.

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