|
Blender
V2.93
|
#include "kernel/closure/bsdf_microfacet_multi_impl.h"Go to the source code of this file.
Macros | |
| #define | MF_NAME_JOIN(x, y) x##_##y |
| #define | MF_NAME_EVAL(x, y) MF_NAME_JOIN(x, y) |
| #define | MF_FUNCTION_FULL_NAME(prefix) MF_NAME_EVAL(prefix, MF_PHASE_FUNCTION) |
| #define | MF_PHASE_FUNCTION glass |
| #define | MF_MULTI_GLASS |
| #define | MF_PHASE_FUNCTION glossy |
| #define | MF_MULTI_GLOSSY |
| #define MF_FUNCTION_FULL_NAME | ( | prefix | ) | MF_NAME_EVAL(prefix, MF_PHASE_FUNCTION) |
Definition at line 355 of file bsdf_microfacet_multi.h.
| #define MF_MULTI_GLASS |
Definition at line 358 of file bsdf_microfacet_multi.h.
| #define MF_MULTI_GLOSSY |
Definition at line 362 of file bsdf_microfacet_multi.h.
| #define MF_NAME_EVAL | ( | x, | |
| y | |||
| ) | MF_NAME_JOIN(x, y) |
Definition at line 354 of file bsdf_microfacet_multi.h.
| #define MF_PHASE_FUNCTION glass |
Definition at line 361 of file bsdf_microfacet_multi.h.
| #define MF_PHASE_FUNCTION glossy |
Definition at line 361 of file bsdf_microfacet_multi.h.
| ccl_device void bsdf_microfacet_multi_ggx_blur | ( | ShaderClosure * | sc, |
| float | roughness | ||
| ) |
Definition at line 365 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, fmaxf, and usdtokens::roughness().
Referenced by bsdf_blur().
| ccl_device int bsdf_microfacet_multi_ggx_common_setup | ( | MicrofacetBsdf * | bsdf | ) |
Definition at line 377 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, clamp(), MicrofacetExtra::color, MicrofacetExtra::cspec0, MicrofacetBsdf::extra, saturate3(), SD_BSDF, SD_BSDF_HAS_EVAL, and SD_BSDF_NEEDS_LCG.
Referenced by bsdf_microfacet_multi_ggx_fresnel_setup(), bsdf_microfacet_multi_ggx_refraction_setup(), and bsdf_microfacet_multi_ggx_setup().
| ccl_device float3 bsdf_microfacet_multi_ggx_eval_reflect | ( | const ShaderClosure * | sc, |
| const float3 | I, | ||
| const float3 | omega_in, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 428 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, MicrofacetExtra::color, MicrofacetExtra::cspec0, dot(), MicrofacetBsdf::extra, I, MicrofacetBsdf::ior, make_float2, make_float3, make_orthonormals(), make_orthonormals_tangent(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), MicrofacetBsdf::T, X, Y, and Z.
Referenced by bsdf_eval().
| ccl_device float3 bsdf_microfacet_multi_ggx_eval_transmit | ( | const ShaderClosure * | sc, |
| const float3 | I, | ||
| const float3 | omega_in, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 418 of file bsdf_microfacet_multi.h.
References make_float3.
Referenced by bsdf_eval().
| ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup | ( | MicrofacetBsdf * | bsdf, |
| const ShaderData * | sd | ||
| ) |
Definition at line 397 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_fresnel_color(), bsdf_microfacet_multi_ggx_common_setup(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, is_zero(), make_float3, and MicrofacetBsdf::T.
Referenced by MicrofacetMultiGGXFresnelClosure::setup(), MicrofacetMultiGGXAnisoFresnelClosure::setup(), and svm_node_closure_bsdf().
| ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_reflect | ( | const ShaderClosure * | sc, |
| const float3 | I, | ||
| const float3 | omega_in, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 597 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, MicrofacetExtra::color, MicrofacetExtra::cspec0, dot(), MicrofacetBsdf::extra, I, MicrofacetBsdf::ior, make_float3, make_orthonormals(), mf_glass_pdf(), X, Y, and Z.
Referenced by bsdf_eval().
| ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_transmit | ( | const ShaderClosure * | sc, |
| const float3 | I, | ||
| const float3 | omega_in, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 565 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, MicrofacetExtra::color, dot(), MicrofacetBsdf::extra, I, MicrofacetBsdf::ior, make_float3, make_orthonormals(), mf_glass_pdf(), X, Y, and Z.
Referenced by bsdf_eval().
| ccl_device int bsdf_microfacet_multi_ggx_glass_fresnel_setup | ( | MicrofacetBsdf * | bsdf, |
| const ShaderData * | sd | ||
| ) |
Definition at line 549 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, bsdf_microfacet_fresnel_color(), clamp(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, MicrofacetExtra::color, MicrofacetExtra::cspec0, MicrofacetBsdf::extra, MicrofacetBsdf::ior, max, saturate3(), SD_BSDF, SD_BSDF_HAS_EVAL, and SD_BSDF_NEEDS_LCG.
Referenced by MicrofacetMultiGGXGlassFresnelClosure::setup(), and svm_node_closure_bsdf().
| ccl_device int bsdf_microfacet_multi_ggx_glass_sample | ( | KernelGlobals * | kg, |
| const ShaderClosure * | sc, | ||
| float3 | Ng, | ||
| float3 | I, | ||
| float3 | dIdx, | ||
| float3 | dIdy, | ||
| float | randu, | ||
| float | randv, | ||
| float3 * | eval, | ||
| float3 * | omega_in, | ||
| float3 * | domega_in_dx, | ||
| float3 * | domega_in_dy, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 631 of file bsdf_microfacet_multi.h.
References __RAY_DIFFERENTIALS__, MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, MicrofacetExtra::color, MicrofacetExtra::cspec0, dot(), MicrofacetBsdf::extra, fresnel_dielectric(), I, MicrofacetBsdf::ior, LABEL_GLOSSY, LABEL_REFLECT, LABEL_SINGULAR, LABEL_TRANSMIT, make_float3, make_orthonormals(), max, mf_glass_pdf(), R, sqrtf, T, float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_sample().
| ccl_device int bsdf_microfacet_multi_ggx_glass_setup | ( | MicrofacetBsdf * | bsdf | ) |
Definition at line 537 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, clamp(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID, MicrofacetExtra::color, MicrofacetBsdf::extra, MicrofacetBsdf::ior, max, saturate3(), SD_BSDF, SD_BSDF_HAS_EVAL, and SD_BSDF_NEEDS_LCG.
Referenced by MicrofacetMultiGGXGlassClosure::setup(), and svm_node_closure_bsdf().
| ccl_device int bsdf_microfacet_multi_ggx_refraction_setup | ( | MicrofacetBsdf * | bsdf | ) |
Definition at line 409 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, bsdf_microfacet_multi_ggx_common_setup(), and CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID.
| ccl_device int bsdf_microfacet_multi_ggx_sample | ( | KernelGlobals * | kg, |
| const ShaderClosure * | sc, | ||
| float3 | Ng, | ||
| float3 | I, | ||
| float3 | dIdx, | ||
| float3 | dIdy, | ||
| float | randu, | ||
| float | randv, | ||
| float3 * | eval, | ||
| float3 * | omega_in, | ||
| float3 * | domega_in_dx, | ||
| float3 * | domega_in_dy, | ||
| float * | pdf, | ||
| ccl_addr_space uint * | lcg_state | ||
| ) |
Definition at line 469 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, MicrofacetBsdf::alpha_y, CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, MicrofacetExtra::color, MicrofacetExtra::cspec0, dot(), MicrofacetBsdf::extra, I, MicrofacetBsdf::ior, LABEL_GLOSSY, LABEL_REFLECT, LABEL_SINGULAR, make_float2, make_float3, make_orthonormals(), make_orthonormals_tangent(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), MicrofacetBsdf::T, float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_sample().
| ccl_device int bsdf_microfacet_multi_ggx_setup | ( | MicrofacetBsdf * | bsdf | ) |
Definition at line 387 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_multi_ggx_common_setup(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID, is_zero(), make_float3, and MicrofacetBsdf::T.
Referenced by MicrofacetMultiGGXClosure::setup(), MicrofacetMultiGGXAnisoClosure::setup(), and svm_node_closure_bsdf().
| CCL_NAMESPACE_BEGIN ccl_device_forceinline float D_ggx | ( | float3 | wm, |
| float | alpha | ||
| ) |
Definition at line 25 of file bsdf_microfacet_multi.h.
References alpha, M_PI_F, max, and float3::z.
Referenced by mf_eval(), mf_eval_phase_glass(), mf_eval_phase_glossy(), mf_ggx_pdf(), and mf_glass_pdf().
| ccl_device_forceinline float D_ggx_aniso | ( | const float3 | wm, |
| const float2 | alpha | ||
| ) |
Definition at line 34 of file bsdf_microfacet_multi.h.
References alpha, M_PI_F, max, float3::x, float3::y, and float3::z.
Referenced by mf_eval(), mf_eval_phase_glossy(), and mf_ggx_aniso_pdf().
| ccl_device_forceinline float mf_C1 | ( | const float | h | ) |
Definition at line 218 of file bsdf_microfacet_multi.h.
References saturate().
Referenced by mf_eval().
| ccl_device_forceinline float3 mf_eval_phase_glass | ( | const float3 | w, |
| const float | lambda, | ||
| const float3 | wo, | ||
| const bool | wo_outside, | ||
| const float2 | alpha, | ||
| const float | eta | ||
| ) |
Definition at line 156 of file bsdf_microfacet_multi.h.
References alpha, D_ggx(), dot(), fresnel_dielectric_cos(), if(), make_float3, max, normalize(), v, w(), and float3::z.
Referenced by mf_eval().
| ccl_device_forceinline float3 mf_eval_phase_glossy | ( | const float3 | w, |
| const float | lambda, | ||
| const float3 | wo, | ||
| const float2 | alpha | ||
| ) |
Definition at line 112 of file bsdf_microfacet_multi.h.
References alpha, D_ggx(), D_ggx_aniso(), make_float3, max, normalize(), w(), and float3::z.
Referenced by mf_eval().
| ccl_device_forceinline float mf_G1 | ( | const float3 | w, |
| const float | C1, | ||
| const float | lambda | ||
| ) |
Definition at line 224 of file bsdf_microfacet_multi.h.
Referenced by mf_eval(), mf_sample(), and mf_sample_height().
| ccl_device_forceinline float mf_ggx_albedo | ( | float | r | ) |
Definition at line 266 of file bsdf_microfacet_multi.h.
References expf, r, and saturate().
Referenced by mf_ggx_aniso_pdf(), mf_ggx_pdf(), and mf_glass_pdf().
| ccl_device_forceinline float mf_ggx_aniso_pdf | ( | const float3 | wi, |
| const float3 | wo, | ||
| const float2 | alpha | ||
| ) |
Definition at line 308 of file bsdf_microfacet_multi.h.
References alpha, D(), D_ggx_aniso(), M_1_PI_F, max, mf_ggx_albedo(), mf_lambda(), normalize(), sqrtf, and float3::z.
Referenced by bsdf_microfacet_multi_ggx_eval_reflect(), and bsdf_microfacet_multi_ggx_sample().
| ccl_device_forceinline float mf_ggx_pdf | ( | const float3 | wi, |
| const float3 | wo, | ||
| const float | alpha | ||
| ) |
Definition at line 296 of file bsdf_microfacet_multi.h.
References alpha, D(), D_ggx(), M_1_PI_F, make_float2, max, mf_ggx_albedo(), mf_lambda(), normalize(), and float3::z.
Referenced by bsdf_microfacet_multi_ggx_eval_reflect(), and bsdf_microfacet_multi_ggx_sample().
| ccl_device_inline float mf_ggx_transmission_albedo | ( | float | a, |
| float | ior | ||
| ) |
Definition at line 278 of file bsdf_microfacet_multi.h.
References Freestyle::a, clamp(), expf, and saturate().
Referenced by mf_glass_pdf().
| ccl_device_forceinline float mf_glass_pdf | ( | const float3 | wi, |
| const float3 | wo, | ||
| const float | alpha, | ||
| const float | eta | ||
| ) |
Definition at line 320 of file bsdf_microfacet_multi.h.
References alpha, D(), D_ggx(), dot(), fabsf, fresnel_dielectric_cos(), M_1_PI_F, make_float2, max, mf_ggx_albedo(), mf_ggx_transmission_albedo(), mf_lambda(), normalize_len(), and float3::z.
Referenced by bsdf_microfacet_multi_ggx_glass_eval_reflect(), bsdf_microfacet_multi_ggx_glass_eval_transmit(), and bsdf_microfacet_multi_ggx_glass_sample().
| ccl_device_forceinline float mf_invC1 | ( | const float | h | ) |
Definition at line 213 of file bsdf_microfacet_multi.h.
References saturate().
Referenced by mf_sample_height().
| ccl_device_forceinline float mf_lambda | ( | const float3 | w, |
| const float2 | alpha | ||
| ) |
Definition at line 196 of file bsdf_microfacet_multi.h.
References alpha, dot(), make_float2, max, sqrtf, v, and w().
Referenced by mf_eval(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), mf_glass_pdf(), and mf_sample().
| ccl_device_forceinline bool mf_sample_height | ( | const float3 | w, |
| float * | h, | ||
| float * | C1, | ||
| float * | G1, | ||
| float * | lambda, | ||
| const float | U | ||
| ) |
Definition at line 235 of file bsdf_microfacet_multi.h.
References fabsf, mf_G1(), mf_invC1(), powf, U, and w().
Referenced by mf_eval(), and mf_sample().
| ccl_device_forceinline float3 mf_sample_phase_glass | ( | const float3 | wi, |
| const float | eta, | ||
| const float3 | wm, | ||
| const float | randV, | ||
| bool * | outside | ||
| ) |
Definition at line 141 of file bsdf_microfacet_multi.h.
References dot(), fresnel_dielectric_cos(), normalize(), and safe_sqrtf().
Referenced by mf_eval(), and mf_sample().
| ccl_device_forceinline float3 mf_sample_phase_glossy | ( | const float3 | wi, |
| float3 * | weight, | ||
| const float3 | wm | ||
| ) |
Definition at line 105 of file bsdf_microfacet_multi.h.
References dot().
Referenced by mf_eval(), and mf_sample().
| ccl_device_forceinline float3 mf_sample_vndf | ( | const float3 | wi, |
| const float2 | alpha, | ||
| const float | randx, | ||
| const float | randy | ||
| ) |
Definition at line 86 of file bsdf_microfacet_multi.h.
References alpha, CCL_NAMESPACE_BEGIN::isfinite(), kernel_assert, make_float3, mf_sampleP22_11(), normalize(), safe_normalize(), float2::x, float3::x, float2::y, float3::y, and float3::z.
Referenced by mf_eval(), and mf_sample().
| ccl_device_forceinline float2 mf_sampleP22_11 | ( | const float | cosI, |
| const float | randx, | ||
| const float | randy | ||
| ) |
Definition at line 44 of file bsdf_microfacet_multi.h.
References A, cosf, D(), fabsf, M_2PI_F, make_float2, max, r, safe_sqrtf(), sinf, sqrtf, and z.
Referenced by mf_sample_vndf().