|
Blender V5.3
|
#include "kernel/closure/bsdf_transparent.h"#include "kernel/closure/bsdf_util.h"#include "kernel/constants.h"#include "kernel/sample/mapping.h"#include "kernel/util/lookup_table.h"#include "util/math_fast.h"Go to the source code of this file.
Classes | |
| struct | FresnelCoeff |
| struct | FresnelDielectricTint |
| struct | FresnelConductor |
| struct | FresnelGeneralizedSchlick |
| struct | FresnelF82Tint |
| struct | MicrofacetBsdf |
| struct | Coat |
Enumerations | |
| enum | MicrofacetType { BECKMANN , GGX } |
| enum | MicrofacetFresnel { NONE = 0 , DIELECTRIC , DIELECTRIC_TINT , CONDUCTOR , GENERALIZED_SCHLICK , F82_TINT } |
| enum MicrofacetFresnel |
| Enumerator | |
|---|---|
| NONE | |
| DIELECTRIC | |
| DIELECTRIC_TINT | |
| CONDUCTOR | |
| GENERALIZED_SCHLICK | |
| F82_TINT | |
Definition at line 25 of file bsdf_microfacet.h.
| enum MicrofacetType |
| Enumerator | |
|---|---|
| BECKMANN | |
| GGX | |
Definition at line 20 of file bsdf_microfacet.h.
| ccl_device_inline void adjust_thin_film_ior_at_backface | ( | ccl_private float & | film_ior, |
| const float | inv_bulk_ior ) |
Definition at line 159 of file bsdf_microfacet.h.
References adjust_thin_film_ior_at_backface(), ccl_device_inline, and ccl_private.
Referenced by adjust_thin_film_ior_at_backface(), bsdf_thin_glass_fresnel(), osl_closure_dielectric_bsdf_setup(), osl_closure_generalized_schlick_bsdf_setup(), and svm_node_closure_bsdf().
| ccl_device_forceinline bool alpha_is_almost_specular | ( | const float | alpha_x, |
| const float | alpha_y ) |
Definition at line 824 of file bsdf_microfacet.h.
References alpha_is_almost_specular(), and ccl_device_forceinline.
Referenced by alpha_is_almost_specular(), bsdf_microfacet_eval_flag(), bsdf_microfacet_sample(), bsdf_thin_glass_transmission_sample(), bsdf_thin_glass_transmission_setup(), PrincipledBsdfNode::has_surface_transparent(), osl_closure_thin_glass_setup(), and surface_shader_prepare_closures().
| ccl_device_forceinline float alpha_to_roughness_index | ( | const float | alpha_x, |
| const float | alpha_y ) |
Definition at line 142 of file bsdf_microfacet.h.
References alpha_to_roughness_index(), ccl_device_forceinline, and sqrtf.
Referenced by alpha_to_roughness_index(), bsdf_microfacet_estimate_albedo(), and microfacet_ggx_preserve_energy().
| ccl_device_inline float bsdf_aniso_D | ( | const float | alpha_x, |
| const float | alpha_y, | ||
| float3 | H ) |
Definition at line 809 of file bsdf_microfacet.h.
References BECKMANN, bsdf_aniso_D(), ccl_device_inline, expf, GGX, H, kernel_assert, len_squared(), M_1_PI_F, M_PI_F, m_type, make_float3(), and sqr.
Referenced by bsdf_aniso_D(), bsdf_microfacet_eval(), and bsdf_microfacet_sample().
| ccl_device_inline float bsdf_aniso_lambda | ( | const float | alpha_x, |
| const float | alpha_y, | ||
| const float3 | V ) |
Definition at line 774 of file bsdf_microfacet.h.
References bsdf_aniso_lambda(), bsdf_lambda_from_sqr_alpha_tan_n(), ccl_device_inline, sqr, and V.
Referenced by bsdf_aniso_lambda(), bsdf_microfacet_eval(), and bsdf_microfacet_sample().
| ccl_device Spectrum bsdf_coat_setup | ( | KernelGlobals | kg, |
| ccl_private ShaderData * | sd, | ||
| const PathRayVisibility | ray_visibility, | ||
| ccl_private Coat & | coat ) |
Definition at line 1567 of file bsdf_microfacet.h.
References bsdf_alloc_maybe_emission(), bsdf_coat_setup(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_ggx_setup(), bsdf_microfacet_setup_fresnel_dielectric(), ccl_device, ccl_private, coat_bsdf(), dot(), isequal(), kernel_data, maybe_ensure_valid_specular_reflection(), one_spectrum, PATH_RAY_VISIBILITY_DIFFUSE, slab_color_at_angle(), sqr, zero_float3(), and zero_spectrum.
Referenced by bsdf_coat_setup(), osl_closure_coat_bsdf_setup(), and principled_bsdf_emission().
| ccl_device_inline float bsdf_D | ( | const float | alpha2, |
| const float | cos_NH ) |
Definition at line 796 of file bsdf_microfacet.h.
References BECKMANN, bsdf_D(), ccl_device_inline, expf, GGX, kernel_assert, M_PI_F, m_type, min, and sqr.
Referenced by bsdf_D(), bsdf_hair_huang_eval_r(), bsdf_hair_huang_eval_residual(), bsdf_microfacet_eval(), and bsdf_microfacet_sample().
| ccl_device void bsdf_dielectric_tint_setup | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| ccl_private ShaderData * | sd, | ||
| ccl_private FresnelDielectricTint * | fresnel, | ||
| const bool | is_beckmann = false, | ||
| const bool | preserve_energy = true ) |
Definition at line 1314 of file bsdf_microfacet.h.
References average(), bsdf_dielectric_tint_setup(), bsdf_microfacet_beckmann_glass_setup(), bsdf_microfacet_beckmann_refraction_setup(), bsdf_microfacet_beckmann_setup(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_ggx_glass_setup(), bsdf_microfacet_ggx_refraction_setup(), bsdf_microfacet_ggx_setup(), ccl_device, ccl_private, DIELECTRIC_TINT, fresnel_dielectric_Fss(), is_zero(), and microfacet_ggx_preserve_energy().
Referenced by bsdf_dielectric_tint_setup(), and osl_closure_dielectric_bsdf_setup().
| ccl_device_inline float bsdf_G | ( | const float | alpha2, |
| const float | cos_N ) |
Definition at line 782 of file bsdf_microfacet.h.
References bsdf_G(), bsdf_lambda(), and ccl_device_inline.
Referenced by bsdf_G(), bsdf_G(), bsdf_hair_huang_eval_r(), bsdf_hair_huang_eval_residual(), bump_shadowing_term(), and mnee_eval_bsdf_contribution().
| ccl_device_inline float bsdf_G | ( | const float | alpha2, |
| const float | cos_NI, | ||
| const float | cos_NO ) |
Definition at line 789 of file bsdf_microfacet.h.
References bsdf_G(), bsdf_lambda(), and ccl_device_inline.
| ccl_device_inline float bsdf_glass_ior | ( | ccl_private ShaderData * | sd, |
| float | ior, | ||
| const float | inv_abbe ) |
Definition at line 339 of file bsdf_microfacet.h.
References A, B, bsdf_glass_ior(), ccl_device_inline, ccl_private, SD_REQUIRES_WAVELENGTH, sqr, SR_BACKFACING, and SR_BSDF_HAS_DISPERSION.
Referenced by bsdf_glass_ior(), osl_closure_generalized_schlick_bsdf_setup(), and svm_node_closure_bsdf().
| ccl_device_inline float bsdf_lambda | ( | const float | alpha2, |
| const float | cos_N ) |
Definition at line 768 of file bsdf_microfacet.h.
References bsdf_lambda(), bsdf_lambda_from_sqr_alpha_tan_n(), ccl_device_inline, fmaxf, and sqr.
Referenced by bsdf_G(), bsdf_G(), bsdf_Go(), bsdf_lambda(), bsdf_microfacet_eval(), and bsdf_microfacet_sample().
| ccl_device_inline float bsdf_lambda_from_sqr_alpha_tan_n | ( | const float | sqr_alpha_tan_n | ) |
Definition at line 750 of file bsdf_microfacet.h.
References BECKMANN, bsdf_lambda_from_sqr_alpha_tan_n(), ccl_device_inline, GGX, inversesqrtf(), kernel_assert, m_type, and sqrtf.
Referenced by bsdf_aniso_lambda(), bsdf_lambda(), and bsdf_lambda_from_sqr_alpha_tan_n().
| 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 1290 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_eval(), bsdf_microfacet_eval(), ccl_device, and ccl_private.
Referenced by bsdf_eval(), and bsdf_microfacet_beckmann_eval().
| ccl_device int bsdf_microfacet_beckmann_glass_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1279 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_glass_setup(), bsdf_microfacet_eval_flag(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_GLASS_ID, DIELECTRIC, saturatef, SR_BSDF, and SR_BSDF_HAS_TRANSMISSION.
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_beckmann_glass_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_setup(), and svm_node_closure_bsdf().
| ccl_device int bsdf_microfacet_beckmann_refraction_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1268 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_refraction_setup(), bsdf_microfacet_eval_flag(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, NONE, saturatef, SR_BSDF, and SR_BSDF_HAS_TRANSMISSION.
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_beckmann_refraction_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_setup(), and svm_node_closure_bsdf().
| 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 1299 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_sample(), bsdf_microfacet_sample(), ccl_device, and ccl_private.
Referenced by bsdf_microfacet_beckmann_sample(), and bsdf_sample().
| ccl_device int bsdf_microfacet_beckmann_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1257 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_setup(), bsdf_microfacet_eval_flag(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_ID, NONE, saturatef, and SR_BSDF.
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_beckmann_setup(), osl_closure_conductor_bsdf_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_f82_tint_setup(), osl_closure_microfacet_setup(), and svm_node_closure_bsdf().
| ccl_device void bsdf_microfacet_blur | ( | ccl_private ShaderClosure * | sc, |
| const float | roughness ) |
Definition at line 1217 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, bsdf_microfacet_blur(), ccl_device, ccl_private, and fmaxf.
Referenced by bsdf_blur(), and bsdf_microfacet_blur().
| ccl_device Spectrum bsdf_microfacet_estimate_albedo | ( | KernelGlobals | kg, |
| const float3 | wi, | ||
| const ccl_private MicrofacetBsdf * | bsdf, | ||
| const bool | eval_reflection, | ||
| const bool | eval_transmission ) |
Definition at line 613 of file bsdf_microfacet.h.
References alpha_to_roughness_index(), bsdf_microfacet_estimate_albedo(), ccl_device, ccl_private, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, CLOSURE_IS_GLASS, DIELECTRIC, DIELECTRIC_TINT, dot(), F, F0_from_ior(), F82_TINT, float, GENERALIZED_SCHLICK, GGX_GEN_SCHLICK_IOR_S_RES_IOR, GGX_GEN_SCHLICK_IOR_S_RES_MU, GGX_GEN_SCHLICK_IOR_S_RES_ROUGH, GGX_GEN_SCHLICK_S_RES_IOR, GGX_GEN_SCHLICK_S_RES_MU, GGX_GEN_SCHLICK_S_RES_ROUGH, ior_to_z_index(), kernel_data, lookup_table_read_3D(), make_spectrum, microfacet_fresnel(), mix, mu_to_y_index(), one_spectrum, FresnelCoeff::reflectance, FresnelCoeff::sum(), THINFILM_THICKNESS_CUTOFF, FresnelCoeff::transmittance, y, z(), and zero_spectrum.
Referenced by bsdf_albedo(), bsdf_coat_setup(), bsdf_dielectric_tint_setup(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_setup_fresnel_conductor(), bsdf_microfacet_setup_fresnel_dielectric(), bsdf_microfacet_setup_fresnel_f82_tint(), and bsdf_microfacet_setup_fresnel_generalized_schlick().
| ccl_device Spectrum bsdf_microfacet_eval | ( | KernelGlobals | kg, |
| const ccl_private ShaderClosure * | sc, | ||
| const float3 | wi, | ||
| const float3 | wo, | ||
| ccl_private float * | pdf ) |
Definition at line 836 of file bsdf_microfacet.h.
References average(), bsdf_aniso_D(), bsdf_aniso_lambda(), bsdf_D(), bsdf_lambda(), bsdf_microfacet_eval(), bsdf_microfacet_eval_flag(), ccl_device, ccl_private, CLOSURE_IS_GLASS, CLOSURE_IS_REFRACTION, D, dot(), fabsf, H, iszero(), len(), make_float3(), make_orthonormals_tangent(), microfacet_fresnel(), N, FresnelCoeff::reflectance, safe_divide(), sqr, FresnelCoeff::sum(), FresnelCoeff::transmittance, X, Y, and zero_spectrum.
Referenced by bsdf_microfacet_beckmann_eval(), bsdf_microfacet_eval(), and bsdf_microfacet_ggx_eval().
| ccl_device_forceinline int bsdf_microfacet_eval_flag | ( | const ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 830 of file bsdf_microfacet.h.
References alpha_is_almost_specular(), bsdf_microfacet_eval_flag(), ccl_device_forceinline, ccl_private, and SR_BSDF_HAS_EVAL.
Referenced by bsdf_label(), bsdf_microfacet_beckmann_glass_setup(), bsdf_microfacet_beckmann_refraction_setup(), bsdf_microfacet_beckmann_setup(), bsdf_microfacet_eval(), bsdf_microfacet_eval_flag(), bsdf_microfacet_ggx_glass_setup(), bsdf_microfacet_ggx_refraction_setup(), bsdf_microfacet_ggx_setup(), and bsdf_thin_glass_transmission_setup().
| 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 1225 of file bsdf_microfacet.h.
References bsdf_microfacet_eval(), bsdf_microfacet_ggx_eval(), ccl_device, ccl_private, and MicrofacetBsdf::energy_scale.
Referenced by bsdf_eval(), bsdf_microfacet_ggx_eval(), and bsdf_thin_glass_transmission_eval().
| ccl_device int bsdf_microfacet_ggx_glass_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1205 of file bsdf_microfacet.h.
References bsdf_microfacet_eval_flag(), bsdf_microfacet_ggx_glass_setup(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID, DIELECTRIC, saturatef, SR_BSDF, and SR_BSDF_HAS_TRANSMISSION.
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_ggx_glass_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_multi_ggx_glass_setup(), osl_closure_microfacet_setup(), precompute_ggx_glass_E(), and svm_node_closure_bsdf().
| ccl_device int bsdf_microfacet_ggx_refraction_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1193 of file bsdf_microfacet.h.
References bsdf_microfacet_eval_flag(), bsdf_microfacet_ggx_refraction_setup(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, NONE, saturatef, SR_BSDF, and SR_BSDF_HAS_TRANSMISSION.
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_ggx_refraction_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_setup(), osl_closure_refraction_setup(), and svm_node_closure_bsdf().
| 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 ) |
Definition at line 1235 of file bsdf_microfacet.h.
References bsdf_microfacet_ggx_sample(), bsdf_microfacet_sample(), ccl_device, and ccl_private.
Referenced by bsdf_microfacet_ggx_sample(), bsdf_sample(), bsdf_thin_glass_transmission_sample(), precompute_ggx_E(), precompute_ggx_gen_schlick_s(), and precompute_ggx_glass_E().
| ccl_device int bsdf_microfacet_ggx_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 1181 of file bsdf_microfacet.h.
References bsdf_microfacet_eval_flag(), bsdf_microfacet_ggx_setup(), ccl_device, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_ID, NONE, saturatef, and SR_BSDF.
Referenced by bsdf_coat_setup(), bsdf_dielectric_tint_setup(), bsdf_microfacet_ggx_setup(), bsdf_thin_glass_reflection_setup(), osl_closure_conductor_bsdf_setup(), osl_closure_generalized_schlick_bsdf_setup(), osl_closure_microfacet_f82_tint_setup(), osl_closure_microfacet_multi_ggx_aniso_setup(), osl_closure_microfacet_setup(), osl_closure_reflection_setup(), precompute_ggx_E(), precompute_ggx_gen_schlick_s(), and svm_node_closure_bsdf().
| 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 ) |
Definition at line 926 of file bsdf_microfacet.h.
References alpha_is_almost_specular(), average(), bsdf_aniso_D(), bsdf_aniso_lambda(), bsdf_D(), bsdf_lambda(), bsdf_microfacet_sample(), ccl_device, ccl_private, D, dot(), fabsf, GGX, H, iszero(), LABEL_GLOSSY, LABEL_NONE, LABEL_REFLECT, LABEL_SINGULAR, LABEL_TRANSMIT, m_type, make_float2, make_float3(), make_orthonormals(), make_orthonormals_tangent(), microfacet_beckmann_sample_vndf(), microfacet_fresnel(), microfacet_ggx_sample_vndf(), N, FresnelCoeff::reflectance, refract_angle(), safe_divide(), sqr, FresnelCoeff::sum(), to_global(), FresnelCoeff::transmittance, X, Y, and float3::z.
Referenced by bsdf_microfacet_beckmann_sample(), bsdf_microfacet_ggx_sample(), and bsdf_microfacet_sample().
| ccl_device void bsdf_microfacet_setup_fresnel_conductor | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi, | ||
| ccl_private FresnelConductor * | fresnel, | ||
| const bool | preserve_energy ) |
Definition at line 1069 of file bsdf_microfacet.h.
References average(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_setup_fresnel_conductor(), ccl_device, ccl_private, CONDUCTOR, fresnel_conductor_Fss(), and microfacet_ggx_preserve_energy().
Referenced by bsdf_microfacet_setup_fresnel_conductor(), osl_closure_conductor_bsdf_setup(), and svm_node_closure_bsdf().
| ccl_device void bsdf_microfacet_setup_fresnel_constant | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi, | ||
| const Spectrum | color ) |
Definition at line 1146 of file bsdf_microfacet.h.
References bsdf_microfacet_setup_fresnel_constant(), ccl_device, ccl_private, DIELECTRIC, kernel_assert, microfacet_ggx_preserve_energy(), and NONE.
Referenced by bsdf_microfacet_setup_fresnel_constant(), bsdf_thin_glass_reflection_setup(), bsdf_thin_glass_transmission_setup(), osl_closure_microfacet_multi_ggx_aniso_setup(), osl_closure_microfacet_multi_ggx_glass_setup(), osl_closure_microfacet_setup(), and svm_node_closure_bsdf().
| ccl_device void bsdf_microfacet_setup_fresnel_dielectric | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi ) |
Definition at line 1159 of file bsdf_microfacet.h.
References average(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_setup_fresnel_dielectric(), ccl_device, ccl_private, DIELECTRIC, fresnel_dielectric_Fss(), make_spectrum, and microfacet_ggx_preserve_energy().
Referenced by bsdf_coat_setup(), and bsdf_microfacet_setup_fresnel_dielectric().
| ccl_device void bsdf_microfacet_setup_fresnel_f82_tint | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi, | ||
| ccl_private FresnelF82Tint * | fresnel, | ||
| const Spectrum | f82_tint, | ||
| const bool | preserve_energy ) |
Definition at line 1123 of file bsdf_microfacet.h.
References average(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_setup_fresnel_f82_tint(), ccl_device, ccl_private, F82_TINT, fresnel_f82_Fss(), fresnel_f82tint_B(), isequal(), microfacet_ggx_preserve_energy(), one_spectrum, and zero_spectrum.
Referenced by bsdf_microfacet_setup_fresnel_f82_tint(), osl_closure_microfacet_f82_tint_setup(), and svm_node_closure_bsdf().
| ccl_device void bsdf_microfacet_setup_fresnel_generalized_schlick | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi, | ||
| ccl_private FresnelGeneralizedSchlick * | fresnel, | ||
| const bool | preserve_energy ) |
Definition at line 1084 of file bsdf_microfacet.h.
References average(), bsdf_microfacet_estimate_albedo(), bsdf_microfacet_setup_fresnel_generalized_schlick(), ccl_device, ccl_private, F0_from_ior(), fresnel_dielectric_Fss(), GENERALIZED_SCHLICK, inverse_lerp(), is_zero(), microfacet_ggx_preserve_energy(), mix, one_spectrum, saturate, and saturatef.
Referenced by bsdf_microfacet_setup_fresnel_generalized_schlick(), osl_closure_generalized_schlick_bsdf_setup(), and svm_node_closure_bsdf().
| ccl_device_inline FresnelCoeff bsdf_thin_glass_fresnel | ( | KernelGlobals | kg, |
| const bool | reflective, | ||
| const bool | refractive, | ||
| const FresnelCoeff | tint, | ||
| FresnelThinFilm | thinfilm, | ||
| const float | ior, | ||
| const float | cos_theta_i ) |
Definition at line 1373 of file bsdf_microfacet.h.
References adjust_thin_film_ior_at_backface(), bsdf_thin_glass_fresnel(), ccl_device_inline, generalized_schlick_fresnel(), generalized_schlick_setup(), FresnelThinFilm::ior, is_zero(), iszero(), one_spectrum, power(), FresnelCoeff::reflectance, safe_divide(), sqr, FresnelThinFilm::thickness, THINFILM_THICKNESS_CUTOFF, FresnelCoeff::transmittance, and zero_spectrum.
Referenced by bsdf_thin_glass_fresnel(), and bsdf_thin_glass_setup().
| ccl_device_inline void bsdf_thin_glass_reflection_setup | ( | KernelGlobals | kg, |
| ccl_private ShaderData * | sd, | ||
| const Spectrum | color, | ||
| const Spectrum | weight, | ||
| const float3 | N, | ||
| const float | alpha ) |
Definition at line 1418 of file bsdf_microfacet.h.
References bsdf_alloc(), bsdf_microfacet_ggx_setup(), bsdf_microfacet_setup_fresnel_constant(), bsdf_thin_glass_reflection_setup(), ccl_device_inline, ccl_private, N, and zero_float3().
Referenced by bsdf_thin_glass_reflection_setup(), and bsdf_thin_glass_setup().
| ccl_device FresnelCoeff bsdf_thin_glass_setup | ( | KernelGlobals | kg, |
| ccl_private ShaderData * | sd, | ||
| const bool | reflective, | ||
| const bool | refractive, | ||
| const FresnelCoeff | tint, | ||
| const Spectrum | weight, | ||
| const float3 | N, | ||
| const float | alpha, | ||
| const float | ior, | ||
| const FresnelThinFilm | thinfilm, | ||
| const PathRayVisibility | ray_visibility, | ||
| const uint32_t | path_flag ) |
Definition at line 1529 of file bsdf_microfacet.h.
References bsdf_thin_glass_fresnel(), bsdf_thin_glass_reflection_setup(), bsdf_thin_glass_setup(), bsdf_thin_glass_transmission_setup(), ccl_device, ccl_private, dot(), N, FresnelCoeff::reflectance, and FresnelCoeff::transmittance.
Referenced by bsdf_thin_glass_setup(), osl_closure_thin_glass_setup(), and svm_node_closure_bsdf().
| ccl_device_inline float bsdf_thin_glass_transmission_alpha | ( | const float | alpha, |
| const float | eta ) |
Definition at line 1444 of file bsdf_microfacet.h.
References bsdf_thin_glass_transmission_alpha(), ccl_device_inline, saturatef, and sqr.
Referenced by bsdf_thin_glass_transmission_alpha(), bsdf_thin_glass_transmission_setup(), and PrincipledBsdfNode::has_surface_transparent().
| ccl_device Spectrum bsdf_thin_glass_transmission_eval | ( | KernelGlobals | kg, |
| const ccl_private ShaderClosure * | sc, | ||
| const float3 | wi, | ||
| const float3 | wo, | ||
| ccl_private float * | pdf ) |
Definition at line 1485 of file bsdf_microfacet.h.
References bsdf_microfacet_ggx_eval(), bsdf_thin_glass_transmission_eval(), ccl_device, ccl_private, and reflect.
Referenced by bsdf_eval(), and bsdf_thin_glass_transmission_eval().
| ccl_device int bsdf_thin_glass_transmission_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 1494 of file bsdf_microfacet.h.
References alpha_is_almost_specular(), bsdf_microfacet_ggx_sample(), bsdf_thin_glass_transmission_sample(), ccl_device, ccl_private, LABEL_GLOSSY, LABEL_NONE, LABEL_SINGULAR, LABEL_TRANSMIT, one_spectrum, reflect, and zero_float2().
Referenced by bsdf_sample(), and bsdf_thin_glass_transmission_sample().
| ccl_device_inline void bsdf_thin_glass_transmission_setup | ( | KernelGlobals | kg, |
| ccl_private ShaderData * | sd, | ||
| const Spectrum | weight, | ||
| const float3 | N, | ||
| const float | alpha, | ||
| const float | ior, | ||
| const PathRayVisibility | ray_visibility, | ||
| const uint32_t | path_flag ) |
Definition at line 1449 of file bsdf_microfacet.h.
References alpha_is_almost_specular(), bsdf_alloc(), bsdf_microfacet_eval_flag(), bsdf_microfacet_setup_fresnel_constant(), bsdf_thin_glass_transmission_alpha(), bsdf_thin_glass_transmission_setup(), bsdf_transparent_setup(), ccl_device_inline, ccl_private, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, N, NONE, one_spectrum, PATH_RAY_VISIBILITY_CAMERA, reflect, SR_BSDF, SR_BSDF_HAS_TRANSMISSION, and zero_float3().
Referenced by bsdf_thin_glass_setup(), and bsdf_thin_glass_transmission_setup().
| ccl_device_forceinline FresnelCoeff generalized_schlick_fresnel | ( | KernelGlobals | kg, |
| const ccl_private FresnelGeneralizedSchlick * | fresnel, | ||
| const float | ior, | ||
| const float | cos_theta_i, | ||
| ccl_private float * | r_cos_theta_t ) |
Definition at line 377 of file bsdf_microfacet.h.
References ccl_private, F, F0_from_ior(), FOREACH_SPECTRUM_CHANNEL, fresnel_dielectric(), fresnel_iridescence_channel(), generalized_schlick_fresnel(), GET_SPECTRUM_CHANNEL, inverse_lerp(), isequal(), kernel_assert, mix, one_spectrum, powf, saturatef, sqr, sqrtf, THINFILM_THICKNESS_CUTOFF, and zero_spectrum.
Referenced by bsdf_thin_glass_fresnel(), generalized_schlick_fresnel(), and microfacet_fresnel().
| ccl_device_forceinline FresnelGeneralizedSchlick generalized_schlick_setup | ( | const float | ior, |
| const bool | reflective_caustics, | ||
| const bool | refractive_caustics, | ||
| const Spectrum | reflection_tint, | ||
| const Spectrum | transmission_tint, | ||
| FresnelThinFilm | thinfilm ) |
Definition at line 184 of file bsdf_microfacet.h.
References F0_from_ior(), generalized_schlick_setup(), one_spectrum, transmission_tint, and FresnelCoeff::transmittance.
Referenced by bsdf_thin_glass_fresnel(), generalized_schlick_setup(), and svm_node_closure_bsdf().
| ccl_device_forceinline float ior_to_z_index | ( | const float | ior | ) |
Definition at line 147 of file bsdf_microfacet.h.
References ccl_device_forceinline, fabsf, ior_to_z_index(), and sqrtf.
Referenced by bsdf_microfacet_estimate_albedo(), ior_to_z_index(), and microfacet_ggx_preserve_energy().
| ccl_device_inline bool iszero | ( | ccl_private const FresnelCoeff & | coeff | ) |
Definition at line 72 of file bsdf_microfacet.h.
References ccl_device_inline, ccl_private, is_zero(), and iszero().
Referenced by bsdf_microfacet_eval(), bsdf_microfacet_sample(), bsdf_thin_glass_fresnel(), and iszero().
| ccl_device_forceinline float3 microfacet_beckmann_sample_vndf | ( | const float3 | wi, |
| const float | alpha_x, | ||
| const float | alpha_y, | ||
| const float2 | rand ) |
Definition at line 205 of file bsdf_microfacet.h.
References b, ccl_device_forceinline, expf, fabsf, fast_erff(), fast_ierff(), logf, M_2PI_F, make_float2, make_float3(), microfacet_beckmann_sample_vndf(), normalize, polar_to_cartesian(), signf(), sin_from_cos(), sqr, sqrtf, float2::x, float3::x, float2::y, float3::y, and float3::z.
Referenced by bsdf_microfacet_sample(), and microfacet_beckmann_sample_vndf().
| ccl_device_forceinline FresnelCoeff microfacet_fresnel | ( | KernelGlobals | kg, |
| const ccl_private MicrofacetBsdf * | bsdf, | ||
| const float | cos_theta_i, | ||
| ccl_private float * | r_cos_theta_t ) |
Definition at line 442 of file bsdf_microfacet.h.
References ccl_device_forceinline, ccl_private, CLOSURE_IS_GLASS, CLOSURE_IS_REFRACTION, CONDUCTOR, DIELECTRIC, DIELECTRIC_TINT, F, F82_TINT, FOREACH_SPECTRUM_CHANNEL, fresnel_conductor(), fresnel_dielectric(), fresnel_f82(), fresnel_iridescence_channel(), GENERALIZED_SCHLICK, generalized_schlick_fresnel(), GET_SPECTRUM_CHANNEL, kernel_assert, make_spectrum, microfacet_fresnel(), min, mix, NONE, FresnelCoeff::reflectance, safe_sqrtf(), sqr, sqrtf, THINFILM_THICKNESS_CUTOFF, FresnelCoeff::transmittance, and zero_spectrum.
Referenced by bsdf_microfacet_estimate_albedo(), bsdf_microfacet_eval(), bsdf_microfacet_sample(), microfacet_fresnel(), and mnee_eval_bsdf_contribution().
| ccl_device_inline void microfacet_ggx_preserve_energy | ( | KernelGlobals | kg, |
| ccl_private MicrofacetBsdf * | bsdf, | ||
| const float3 | wi, | ||
| const Spectrum | Fss ) |
Definition at line 544 of file bsdf_microfacet.h.
References alpha_to_roughness_index(), average(), ccl_device_inline, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID, CLOSURE_BSDF_MICROFACET_GGX_ID, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, dot(), GGX_E_RES_MU, GGX_E_RES_ROUGH, GGX_GLASS_E_RES_IOR, GGX_GLASS_E_RES_MU, GGX_GLASS_E_RES_ROUGH, ior_to_z_index(), isequal(), kernel_assert, kernel_data, lookup_table_read(), lookup_table_read_2D(), lookup_table_read_3D(), microfacet_ggx_preserve_energy(), mu_to_y_index(), one_spectrum, y, and z().
Referenced by bsdf_dielectric_tint_setup(), bsdf_microfacet_setup_fresnel_conductor(), bsdf_microfacet_setup_fresnel_constant(), bsdf_microfacet_setup_fresnel_dielectric(), bsdf_microfacet_setup_fresnel_f82_tint(), bsdf_microfacet_setup_fresnel_generalized_schlick(), and microfacet_ggx_preserve_energy().
| ccl_device_forceinline float3 microfacet_ggx_sample_vndf | ( | const float3 | wi, |
| const float | alpha_x, | ||
| const float | alpha_y, | ||
| const float2 | rand ) |
Definition at line 304 of file bsdf_microfacet.h.
References ccl_device_forceinline, cross, disk_to_hemisphere(), inversesqrtf(), make_float3(), max, microfacet_ggx_sample_vndf(), mix, normalize, safe_sqrtf(), sample_uniform_disk(), sqr, T1, T2, to_global(), float2::x, float3::x, float2::y, float3::y, and float3::z.
Referenced by bsdf_microfacet_sample(), microfacet_ggx_sample_vndf(), and sample_wh().
| ccl_device_forceinline float mu_to_y_index | ( | const float | mu | ) |
Definition at line 152 of file bsdf_microfacet.h.
References ccl_device_forceinline, mu_to_y_index(), and safe_sqrtf().
Referenced by bsdf_hair_huang_energy_scale(), bsdf_microfacet_estimate_albedo(), microfacet_ggx_preserve_energy(), and mu_to_y_index().
| ccl_device_inline Spectrum slab_color_at_angle | ( | const float3 | color, |
| const float | cos_theta_i, | ||
| const float | ior ) |
Definition at line 1558 of file bsdf_microfacet.h.
References ccl_device_inline, inversesqrtf(), power(), slab_color_at_angle(), and sqr.
Referenced by bsdf_coat_setup(), and slab_color_at_angle().