Output for BsdfSampleQuery
.
More...
#include <BsdfSampleQuery.h>
Output for BsdfSampleQuery
.
- Note
- It is an error to get output data if
isMeasurable()
returns false
.
◆ getCos()
real ph::BsdfSampleOutput::getCos |
( |
| ) |
const |
|
inline |
- Returns
- Lambert's cosine term. Guaranteed to be > 0. This is the absolute value of \( N \cdot L \), where \( N \) is the normal vector and \( L \) is the sampled direction.
- Note
- This cosine term is an absolute value. You may need to consult the corresponding
SurfaceHit
if its sign is needed.
◆ getL()
- Returns
- Sampled direction (normalized) of the incident ray.
◆ getPdfAppliedBsdf()
- Returns
- Sampled BSDF with PDF (on the same domain) applied. Guaranteed to be finite. Specifically, it is equivalent to \( BSDF / PDF_{\omega} \).
◆ getPdfAppliedBsdfCos()
const math::Spectrum & ph::BsdfSampleOutput::getPdfAppliedBsdfCos |
( |
| ) |
const |
|
inline |
Prefer using this method when applicable instead of applying the cosine term manually. The coupled form often results in less computation and potentially offers better numerical stability as some terms can often be canceled out.
- Returns
- Sampled BSDF with Lambert's cosine law and PDF (on the same domain) applied. Guaranteed to be finite. Specifically, it is equivalent to \( BSDF * \lvert\cos\theta\rvert / PDF_{\omega} \).
- Note
- This cosine term is an absolute value. You may need to consult the corresponding
SurfaceHit
if its sign is needed.
◆ getRelativeIor()
real ph::BsdfSampleOutput::getRelativeIor |
( |
| ) |
const |
|
inline |
- Returns
- Relative index of refraction of the sampled interface. The value is calculated as \( \eta_V / \eta_L \), with \( V \) on the exiting side and \( L \) on the incident side. If the ray does not cross an interface, 1 is returned.
◆ getRelativeIor2()
real ph::BsdfSampleOutput::getRelativeIor2 |
( |
| ) |
const |
|
inline |
◆ isMeasurable()
bool ph::BsdfSampleOutput::isMeasurable |
( |
| ) |
const |
|
inline |
Tells whether this sample has potential to contribute. All sampled data should be usable if true is returned; otherwise, zero contribution is implied, and sampled data is undefined. This method is also an efficient way to decide whether the BSDF sample has sane value (compared to manually testing its value).
- Note
- Measurability has nothing to do with whether the sampled value is 0 or not.
◆ operator bool()
ph::BsdfSampleOutput::operator bool |
( |
| ) |
const |
|
inline |
◆ setL()
◆ setMeasurability() [1/2]
void ph::BsdfSampleOutput::setMeasurability |
( |
bool | measurability | ) |
|
|
inline |
Set measurability directly.
◆ setMeasurability() [2/2]
void ph::BsdfSampleOutput::setMeasurability |
( |
const math::Spectrum & | reference | ) |
|
|
inline |
Set measurability based on a reference spectrum.
◆ setPdfAppliedBsdfCos()
void ph::BsdfSampleOutput::setPdfAppliedBsdfCos |
( |
const math::Spectrum & | pdfAppliedBsdfCos, |
|
|
real | cos, |
|
|
bool | inferMeasurability = true ) |
|
inline |
- Parameters
-
pdfAppliedBsdfCos | The sampled BSDF in a coupled form. See getPdfAppliedBsdfCos() for more information. |
cos | The contained Lambert's cosine term (absolute value). See getCos() for more information. |
inferMeasurability | Whether to determine measurability from the supplied data. All supplied data must be sane for the sample to be measurable. |
◆ setRelativeIor()
void ph::BsdfSampleOutput::setRelativeIor |
( |
real | relativeIor | ) |
|
|
inline |
The documentation for this class was generated from the following file: