Blender V5.0
bsdf_microfacet.h File Reference

Go to the source code of this file.

Classes

struct  FresnelDielectricTint
struct  FresnelConductor
struct  FresnelGeneralizedSchlick
struct  FresnelF82Tint
struct  MicrofacetBsdf

Enumerations

enum  MicrofacetType { BECKMANN , GGX }
enum  MicrofacetFresnel {
  NONE = 0 , DIELECTRIC , DIELECTRIC_TINT , CONDUCTOR ,
  GENERALIZED_SCHLICK , F82_TINT
}

Functions

ccl_device_forceinline float3 microfacet_beckmann_sample_vndf (const float3 wi, const float alpha_x, const float alpha_y, const float2 rand)
ccl_device_forceinline float3 microfacet_ggx_sample_vndf (const float3 wi, const float alpha_x, const float alpha_y, const float2 rand)
ccl_device_forceinline void microfacet_fresnel (KernelGlobals kg, const ccl_private MicrofacetBsdf *bsdf, const float cos_theta_i, ccl_private float *r_cos_theta_t, ccl_private Spectrum *r_reflectance, ccl_private Spectrum *r_transmittance)
ccl_device_inline void microfacet_ggx_preserve_energy (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, const Spectrum Fss)
ccl_device Spectrum bsdf_microfacet_estimate_albedo (KernelGlobals kg, const ccl_private ShaderData *sd, const ccl_private MicrofacetBsdf *bsdf, const bool eval_reflection, const bool eval_transmission)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_lambda_from_sqr_alpha_tan_n (const float sqr_alpha_tan_n)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_lambda (const float alpha2, const float cos_N)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_aniso_lambda (const float alpha_x, const float alpha_y, const float3 V)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_G (const float alpha2, const float cos_N)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_G (const float alpha2, const float cos_NI, const float cos_NO)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_D (const float alpha2, const float cos_NH)
template<MicrofacetType m_type>
ccl_device_inline float bsdf_aniso_D (const float alpha_x, const float alpha_y, float3 H)
ccl_device_forceinline int bsdf_microfacet_eval_flag (const ccl_private MicrofacetBsdf *bsdf)
template<MicrofacetType m_type>
ccl_device Spectrum bsdf_microfacet_eval (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 wi, const float3 wo, ccl_private float *pdf)
template<MicrofacetType m_type>
ccl_device int bsdf_microfacet_sample (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 Ng, const float3 wi, const float3 rand, ccl_private Spectrum *eval, ccl_private float3 *wo, ccl_private float *pdf, ccl_private float2 *sampled_roughness, ccl_private float *eta)
ccl_device void bsdf_microfacet_setup_fresnel_conductor (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, ccl_private FresnelConductor *fresnel, const bool preserve_energy)
ccl_device void bsdf_microfacet_setup_fresnel_dielectric_tint (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, ccl_private FresnelDielectricTint *fresnel, const bool preserve_energy)
ccl_device void bsdf_microfacet_setup_fresnel_generalized_schlick (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, ccl_private FresnelGeneralizedSchlick *fresnel, const bool preserve_energy)
ccl_device void bsdf_microfacet_setup_fresnel_f82_tint (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, ccl_private FresnelF82Tint *fresnel, const Spectrum f82_tint, const bool preserve_energy)
ccl_device void bsdf_microfacet_setup_fresnel_constant (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd, const Spectrum color)
ccl_device void bsdf_microfacet_setup_fresnel_dielectric (KernelGlobals kg, ccl_private MicrofacetBsdf *bsdf, const ccl_private ShaderData *sd)
ccl_device int bsdf_microfacet_ggx_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device int bsdf_microfacet_ggx_refraction_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device int bsdf_microfacet_ggx_glass_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device void bsdf_microfacet_blur (ccl_private ShaderClosure *sc, const float roughness)
ccl_device Spectrum bsdf_microfacet_ggx_eval (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 wi, const float3 wo, ccl_private float *pdf)
ccl_device int bsdf_microfacet_ggx_sample (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 Ng, const float3 wi, const float3 rand, ccl_private Spectrum *eval, ccl_private float3 *wo, ccl_private float *pdf, ccl_private float2 *sampled_roughness, ccl_private float *eta)
ccl_device int bsdf_microfacet_beckmann_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device int bsdf_microfacet_beckmann_refraction_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device int bsdf_microfacet_beckmann_glass_setup (ccl_private MicrofacetBsdf *bsdf)
ccl_device Spectrum bsdf_microfacet_beckmann_eval (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 wi, const float3 wo, ccl_private float *pdf)
ccl_device int bsdf_microfacet_beckmann_sample (KernelGlobals kg, const ccl_private ShaderClosure *sc, const float3 Ng, const float3 wi, const float3 rand, ccl_private Spectrum *eval, ccl_private float3 *wo, ccl_private float *pdf, ccl_private float2 *sampled_roughness, ccl_private float *eta)

Enumeration Type Documentation

◆ MicrofacetFresnel

Enumerator
NONE 
DIELECTRIC 
DIELECTRIC_TINT 
CONDUCTOR 
GENERALIZED_SCHLICK 
F82_TINT 

Definition at line 23 of file bsdf_microfacet.h.

◆ MicrofacetType

Enumerator
BECKMANN 
GGX 

Definition at line 18 of file bsdf_microfacet.h.

Function Documentation

◆ bsdf_aniso_D()

template<MicrofacetType m_type>
ccl_device_inline float bsdf_aniso_D ( const float alpha_x,
const float alpha_y,
float3 H )

◆ bsdf_aniso_lambda()

template<MicrofacetType m_type>
ccl_device_inline float bsdf_aniso_lambda ( const float alpha_x,
const float alpha_y,
const float3 V )

◆ bsdf_D()

◆ bsdf_G() [1/2]

template<MicrofacetType m_type>
ccl_device_inline float bsdf_G ( const float alpha2,
const float cos_N )

◆ bsdf_G() [2/2]

template<MicrofacetType m_type>
ccl_device_inline float bsdf_G ( const float alpha2,
const float cos_NI,
const float cos_NO )

Definition at line 546 of file bsdf_microfacet.h.

References bsdf_lambda(), and ccl_device_inline.

◆ bsdf_lambda()

template<MicrofacetType m_type>
ccl_device_inline float bsdf_lambda ( const float alpha2,
const float cos_N )

◆ bsdf_lambda_from_sqr_alpha_tan_n()

template<MicrofacetType m_type>
ccl_device_inline float bsdf_lambda_from_sqr_alpha_tan_n ( const float sqr_alpha_tan_n)

Definition at line 507 of file bsdf_microfacet.h.

References BECKMANN, ccl_device_inline, GGX, inversesqrtf(), kernel_assert, m_type, and sqrtf.

Referenced by bsdf_aniso_lambda(), and bsdf_lambda().

◆ bsdf_microfacet_beckmann_eval()

ccl_device Spectrum bsdf_microfacet_beckmann_eval ( KernelGlobals kg,
const ccl_private ShaderClosure * sc,
const float3 wi,
const float3 wo,
ccl_private float * pdf )

Definition at line 1071 of file bsdf_microfacet.h.

References bsdf_microfacet_eval(), ccl_device, and ccl_private.

Referenced by bsdf_eval().

◆ bsdf_microfacet_beckmann_glass_setup()

◆ bsdf_microfacet_beckmann_refraction_setup()

◆ bsdf_microfacet_beckmann_sample()

ccl_device int bsdf_microfacet_beckmann_sample ( KernelGlobals kg,
const ccl_private ShaderClosure * sc,
const float3 Ng,
const float3 wi,
const float3 rand,
ccl_private Spectrum * eval,
ccl_private float3 * wo,
ccl_private float * pdf,
ccl_private float2 * sampled_roughness,
ccl_private float * eta )

Definition at line 1080 of file bsdf_microfacet.h.

References bsdf_microfacet_sample(), ccl_device, and ccl_private.

Referenced by bsdf_sample().

◆ bsdf_microfacet_beckmann_setup()

◆ bsdf_microfacet_blur()

ccl_device void bsdf_microfacet_blur ( ccl_private ShaderClosure * sc,
const float roughness )

Definition at line 997 of file bsdf_microfacet.h.

References MicrofacetBsdf::alpha_x, ccl_device, ccl_private, and fmaxf.

Referenced by bsdf_blur().

◆ bsdf_microfacet_estimate_albedo()

◆ bsdf_microfacet_eval()

◆ bsdf_microfacet_eval_flag()

◆ bsdf_microfacet_ggx_eval()

ccl_device Spectrum bsdf_microfacet_ggx_eval ( KernelGlobals kg,
const ccl_private ShaderClosure * sc,
const float3 wi,
const float3 wo,
ccl_private float * pdf )

Definition at line 1005 of file bsdf_microfacet.h.

References bsdf_microfacet_eval(), ccl_device, ccl_private, and MicrofacetBsdf::energy_scale.

Referenced by bsdf_eval().

◆ bsdf_microfacet_ggx_glass_setup()

◆ bsdf_microfacet_ggx_refraction_setup()

◆ bsdf_microfacet_ggx_sample()

ccl_device int bsdf_microfacet_ggx_sample ( KernelGlobals kg,
const ccl_private ShaderClosure * sc,
const float3 Ng,
const float3 wi,
const float3 rand,
ccl_private Spectrum * eval,
ccl_private float3 * wo,
ccl_private float * pdf,
ccl_private float2 * sampled_roughness,
ccl_private float * eta )

◆ bsdf_microfacet_ggx_setup()

◆ bsdf_microfacet_sample()

◆ bsdf_microfacet_setup_fresnel_conductor()

ccl_device void bsdf_microfacet_setup_fresnel_conductor ( KernelGlobals kg,
ccl_private MicrofacetBsdf * bsdf,
const ccl_private ShaderData * sd,
ccl_private FresnelConductor * fresnel,
const bool preserve_energy )

◆ bsdf_microfacet_setup_fresnel_constant()

◆ bsdf_microfacet_setup_fresnel_dielectric()

ccl_device void bsdf_microfacet_setup_fresnel_dielectric ( KernelGlobals kg,
ccl_private MicrofacetBsdf * bsdf,
const ccl_private ShaderData * sd )

◆ bsdf_microfacet_setup_fresnel_dielectric_tint()

ccl_device void bsdf_microfacet_setup_fresnel_dielectric_tint ( KernelGlobals kg,
ccl_private MicrofacetBsdf * bsdf,
const ccl_private ShaderData * sd,
ccl_private FresnelDielectricTint * fresnel,
const bool preserve_energy )

◆ bsdf_microfacet_setup_fresnel_f82_tint()

ccl_device void bsdf_microfacet_setup_fresnel_f82_tint ( KernelGlobals kg,
ccl_private MicrofacetBsdf * bsdf,
const ccl_private ShaderData * sd,
ccl_private FresnelF82Tint * fresnel,
const Spectrum f82_tint,
const bool preserve_energy )

◆ bsdf_microfacet_setup_fresnel_generalized_schlick()

◆ microfacet_beckmann_sample_vndf()

ccl_device_forceinline float3 microfacet_beckmann_sample_vndf ( const float3 wi,
const float alpha_x,
const float alpha_y,
const float2 rand )

◆ microfacet_fresnel()

◆ microfacet_ggx_preserve_energy()

◆ microfacet_ggx_sample_vndf()

ccl_device_forceinline float3 microfacet_ggx_sample_vndf ( const float3 wi,
const float alpha_x,
const float alpha_y,
const float2 rand )