Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
he_base< CONF, Fresnel, EQ25, EQ78, NewtonRaphsonSteps, TaylorTerms, AdaptiveTaylor, RoughApproxThreshold, NAME > Class Template Reference

The directional specular component of the He et al. BSDF model. More...

#include <he.h>

Public Member Functions

 BBM_IMPORT_CONFIG (CONF)
 
Spectrum eval (const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t=unit_t::Radiance, Mask mask=true) const
 Evaluate the BSDF for a given in and 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 diffuse 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_t::Radiance, Mask mask=true) const
 Return the (approximate) hemispherical reflectance of the BSDF.
 
 BBM_DEFAULT_CONSTRUCTOR (he_base)
 Default Constructor.
 

Public Attributes

 BBM_BSDF_FORWARD
 

Static Public Attributes

static constexpr string_literal name = NAME
 

Private Member Functions

constexpr Value S (const Vec3d &in, const Vec3d &out, Mask mask=true) const
 Shadowing term.
 
constexpr Value S1 (const Vec3d &v, Mask mask=true) const
 Mono-directional shadowing term.
 
constexpr Value G (const Vec3d &in, const Vec3d &out, Mask mask=true) const
 Compute the Geometrical factor.
 
constexpr Value sigma (const Vec3d &in, const Vec3d &out, Mask mask=true) const
 Compute the effective surface roughness.
 
constexpr Spectrum D (const Vec3d &in, const Vec3d &out, Mask mask=true) const
 Distribution Function.
 

Class Attributes

bsdf_parameter< Value, bsdf_attr::SpecularParameter, 0.18 > roughness
 
bsdf_parameter< Value, bsdf_attr::SpecularParameter, 3.0 > autocorrelation
 
fresnel_parameter< typename std::decay_t< Fresnel >::parameter_type > eta
 
 BBM_ATTRIBUTES (roughness, autocorrelation, eta)
 

Detailed Description

template<typename CONF, typename Fresnel = fresnel::complex<CONF, Spectrum_t<CONF>>, he_eq25 EQ25 = he_eq25::WithoutExp, he_eq78 EQ78 = he_eq78::Regular, size_t NewtonRaphsonSteps = 4, size_t TaylorTerms = 40, bool AdaptiveTaylor = true, literal RoughApproxThreshold = std::numeric_limits<Scalar_t<CONF>>::max(), string_literal NAME = "He">
requires concepts::config<CONF> && concepts::fresnel<Fresnel> && concepts::matching_config<CONF, Fresnel>
class bbm::he_base< CONF, Fresnel, EQ25, EQ78, NewtonRaphsonSteps, TaylorTerms, AdaptiveTaylor, RoughApproxThreshold, NAME >

The directional specular component of the He et al. BSDF model.

Template Parameters
CONF= bbm configuration
Fresnel= fresnel implementation (requires concepts::fresnel); default = fresnel::complex
EQ25= determines whether or not to include an extra scaling factor in Eq 25. (Default = he_eq25::WithoutExp)
EQ78= determines which implementation variant to follow for Eq
  1. ( Default=he_eq78::Regular)
NewtonRaphsonSteps= number of Newton Raphson steps to take to compute the apparent roughness (Default=4)
TaylorTerms= number of terms in the Taylor expansion for Eq. 78. (Default=40)
AdaptiveTaylor= true if the Talylor approximation should be cut of if the change with additional terms is minimal. If false, all 'TaylorTerms' terms will be computed. (Default = true).
RoughApproxThreshold= 'g' threshold at which the use an approximation instead of the Taylor series. Both solutions are linearly blended within g and g+1. (Default=disabled).
NAME= model name (default = "He")

Note: the default settings best approximate the original formulation in He et al. 1991

Note: this only implements the directional specular component

Implements: concepts::bsdfmodel

Member Function Documentation

◆ BBM_ATTRIBUTES()

BBM_ATTRIBUTES ( roughness  ,
autocorrelation  ,
eta   
)

◆ BBM_DEFAULT_CONSTRUCTOR()

BBM_DEFAULT_CONSTRUCTOR ( he_base< CONF, Fresnel, EQ25, EQ78, NewtonRaphsonSteps, TaylorTerms, AdaptiveTaylor, RoughApproxThreshold, NAME >  )
inline

Default Constructor.

◆ BBM_IMPORT_CONFIG()

BBM_IMPORT_CONFIG ( CONF  )

◆ D()

constexpr Spectrum D ( const Vec3d &  in,
const Vec3d &  out,
Mask  mask = true 
) const
inlineconstexprprivate

Distribution Function.

Eq. 78 & 79

Note Westin et al. uses exp(-g - v_xy2 * (tau/lambda)^2 * Pi^2 / m) instead of exp(-g - v_xy2 * tau^2 / (4m)). This behavior can be set with the EQ78 template parameter (he_eq78::Westin).

◆ eval()

Spectrum eval ( const Vec3d &  in,
const Vec3d &  out,
BsdfFlag  component = bsdf_flag::All,
unit_t  = unit_t::Radiance,
Mask  mask = true 
) const
inline

Evaluate the BSDF for a given in and out direction.

Parameters
in= incident direction
out= outgoing direction
component= which reflectance component to eval
unit= unit of computation (ignored)
mask= masking of lanes (e.g., for Packet eval)
Returns
Evaluation of the BSDF per spectrum.

◆ G()

constexpr Value G ( const Vec3d &  in,
const Vec3d &  out,
Mask  mask = true 
) const
inlineconstexprprivate

Compute the Geometrical factor.

Eq. 76 in [He et al. 1991]

Note: k_i = -in k_r = out

Parameters
in= incident direction of light transport
out= outgoing direction of light transport
mask= enable/disbale lanes
Returns
the geometrical factor

◆ pdf()

Value pdf ( const Vec3d &  in,
const Vec3d &  out,
BsdfFlag  component = bsdf_flag::All,
unit_t  unit = unit_t::Radiance,
Mask  mask = true 
) const
inline

Compute the pdf given an in and out direction.

Parameters
in= the incoming direction
out= the outgoing direction
component= which reflectance component was sampled
unit= unit of computation
mask= enable/disable lanes.
Returns
the PDF that the outgoing direction would be sampled given the incoming direction.

◆ reflectance()

Spectrum reflectance ( const Vec3d &  out,
BsdfFlag  component = bsdf_flag::All,
unit_t  = unit_t::Radiance,
Mask  mask = true 
) const
inline

Return the (approximate) hemispherical reflectance of the BSDF.

Parameters
out= the outgoing direction (ignored)
component= which reflectance component to eval
unit= unit of computation
mask= enable/disable lanes
Returns
the approximate hemispherical reflectance of the BSDF for a given incident direction

◆ S()

constexpr Value S ( const Vec3d &  in,
const Vec3d &  out,
Mask  mask = true 
) const
inlineconstexprprivate

Shadowing term.

Parameters
in= incident direction of light transport
out= exitant direction of light transport
mask= enable/disable lanes
Returns
fraction of surface visible and illuminated.

◆ S1()

constexpr Value S1 ( const Vec3d &  v,
Mask  mask = true 
) const
inlineconstexprprivate

Mono-directional shadowing term.

Eqs. 24 and 25 from [He et al. 1991]

Parameters
v= indident/outgoing vector
Returns
fraction of surface viewed/illuminated

He et al.'s paper [1991] misses an exponential exp(-(tau*cot/2sigma0)^2) term in Eq. 25 (noted in the errata, and by both Westin et al. and Holzschuch and Pacanowski). Set template EQ25 to he_eq25::Errata to include this factor.

◆ sample()

BsdfSample sample ( const Vec3d &  out,
const Vec2d &  xi,
BsdfFlag  component = bsdf_flag::All,
unit_t  unit = unit_t::Radiance,
Mask  mask = true 
) const
inline

Sample the diffuse BSDF given a direction and two random variables.

Parameters
out= outgoing direction
xi= two random variables stored in a Vec2d
component= which reflectance component to sample
unit= unit of computation (ignored)
mask= masking of lanes.
Returns
A bsdfSample containing the sampled direction and the corresponding pdf.

◆ sigma()

constexpr Value sigma ( const Vec3d &  in,
const Vec3d &  out,
Mask  mask = true 
) const
inlineconstexprprivate

Compute the effective surface roughness.

Eq. 80 from [He et al. 1991]. This equation is solved with a Newton-Raphson root finding.

Parameters
in= incident direction of light transport
out= outgoing direction of light transport
mask= enable/disbale lanes
Returns
the apparent roughness

Member Data Documentation

◆ autocorrelation

bsdf_parameter<Value, bsdf_attr::SpecularParameter, 3.0> autocorrelation

◆ BBM_BSDF_FORWARD

BBM_BSDF_FORWARD

◆ eta

fresnel_parameter<typename std::decay_t<Fresnel>::parameter_type> eta

◆ name

constexpr string_literal name = NAME
staticconstexpr

◆ roughness


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