The sum of different BSDF models. More...
#include <aggregatemodel.h>
Inherits MODELS.
Public Member Functions | |
| BBM_BASETYPES (MODELS...) | |
| BBM_IMPORT_CONFIG (std::tuple_element_t< 0, std::tuple< MODELS... > >) | |
| aggregatemodel_base (void) | |
| Default constructor. | |
| aggregatemodel_base (const MODELS &... models) | |
| Construction from each model. | |
| aggregatemodel_base (const aggregatemodel_base &src) | |
| Copy constructor. | |
| aggregatemodel_base & | operator= (const aggregatemodel_base &src) |
| Assignment operator. | |
| Spectrum | eval (const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const |
| Evaluate the BSDF for a given in out direction. | |
| BsdfSample | sample (const Vec3d &out, const Vec2d &xi, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const |
| Sample the aggregate BSDF given a direction and two random variables. | |
| Value | pdf (const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const |
| Compute the pdf given an in and out direction. | |
| Spectrum | reflectance (const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const |
| Return the (approximate) hemispherical reflectance of the BSDF. | |
| std::string | toString (void) const |
| toString to overwrite default printing behavior | |
Static Public Member Functions | |
| static aggregatemodel_base | fromString (const std::string &str) |
| construct an aggregate model from a string | |
Public Attributes | |
| BBM_BSDF_FORWARD | |
Static Public Attributes | |
| static constexpr string_literal | name = NAME |
The sum of different BSDF models.
| NAME | = model name |
| MODELS | = list of BSDF models over which this model aggregates |
|
inline |
Default constructor.
|
inline |
Construction from each model.
|
inline |
Copy constructor.
| BBM_BASETYPES | ( | MODELS... | ) |
| BBM_IMPORT_CONFIG | ( | std::tuple_element_t< 0, std::tuple< MODELS... > > | ) |
|
inline |
Evaluate the BSDF for a given in out direction.
| in | = incident direction |
| out | = outgoing direction |
| component | = which reflectance component to eval |
| unit | = unit of computation |
| mask | = masking of lanes (e.g., for Packet eval) |
Evaluation is performed by evaluating each child model, and adding the results.
|
inlinestatic |
construct an aggregate model from a string
|
inline |
Assignment operator.
|
inline |
Compute the pdf given an in and out direction.
| in | = the incoming (sampled) direction |
| out | = the outgoing (given) direction |
| component | = which reflectance component was sampled |
| unit | = unit of computation |
| mask | = masking of lanes |
The PDF is computed as the reflectance weighted sum of all PDFs.
|
inline |
Return the (approximate) hemispherical reflectance of the BSDF.
| out | = the outgoing direction |
| component | = which reflectance component to eval |
| unit | = unit of computation |
| mask | = masking of lanes |
The hemispherical reflectance is computed as the sum of the underlying BSDF models.
|
inline |
Sample the aggregate BSDF given a direction and two random variables.
| out | = outgoing direction |
| xi | = two random variables stored in a Vec2d |
| component | = which reflectance component to sample |
| unit | = unit of computation |
| mask | = masking of lanes. |
Selects one BSDF model to sample based with a probability propertional to the hemispherical reflectances of each BSDF. The selected BSDF model is then sampled, and its sampled direction is returned. The PDF is computed as the weighted sum of each BSDF model's PDF and the reflectance weights.
|
inline |
toString to overwrite default printing behavior
| BBM_BSDF_FORWARD |
|
staticconstexpr |