1#ifndef _BBM_FRESNEL_COMPLEX_H_
2#define _BBM_FRESNEL_COMPLEX_H_
31 auto cosTheta2 = cosTheta*cosTheta;
32 auto sinTheta2 = 1 - cosTheta2;
34 auto n = real(param), n2 = n*n;
35 auto k = imag(param), k2 = k*k;
38 auto temp = n2 - k2 - sinTheta2;
39 auto a2b2 = bbm::safe_sqrt( temp*temp + 4*n2*k2 );
40 auto a = bbm::safe_sqrt(0.5 * (a2b2 + temp));
43 auto a2c = 2*a*cosTheta;
44 auto Rs = (a2b2 - a2c + cosTheta2) / (a2b2 + a2c + cosTheta2);
47 auto Rp = Rs * (cosTheta2*a2b2 - (a2c - sinTheta2)*sinTheta2) / (cosTheta2*a2b2 + (a2c + sinTheta2)*sinTheta2);
All BBM methods are defined to operate on a variety of value types and spectrum types....
config concept
Definition: config.h:31
fresnel concept
Definition: fresnel.h:27
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
Definition: aggregatebsdf.h:29
constexpr auto select(MASK &&mask, const A &a, const A &b)
Definition: backbone.h:255
typename get_config< T >::Value Value_t
Definition: config.h:67
typename get_config< T >::Spectrum Spectrum_t
Definition: config.h:68
Base declaration of attribute; further specialized below.
Definition: attribute.h:26
Definition: fresnel_complex.h:12
static constexpr VALUE eval(const parameter_type ¶m, const Value &cosTheta, Mask mask=true)
"Physically based Lighting Calculations for Computer Graphics"
Definition: fresnel_complex.h:29