Blender
V3.3
|
#include "kernel/sample/lcg.h"
#include "kernel/sample/mapping.h"
#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 354 of file bsdf_microfacet_multi.h.
#define MF_MULTI_GLASS |
Definition at line 357 of file bsdf_microfacet_multi.h.
#define MF_MULTI_GLOSSY |
Definition at line 361 of file bsdf_microfacet_multi.h.
Definition at line 353 of file bsdf_microfacet_multi.h.
#define MF_PHASE_FUNCTION glass |
Definition at line 360 of file bsdf_microfacet_multi.h.
#define MF_PHASE_FUNCTION glossy |
Definition at line 360 of file bsdf_microfacet_multi.h.
ccl_device void bsdf_microfacet_multi_ggx_blur | ( | ccl_private ShaderClosure * | sc, |
float | roughness | ||
) |
Definition at line 364 of file bsdf_microfacet_multi.h.
References MicrofacetBsdf::alpha_x, ccl_private, fmaxf, and usdtokens::roughness().
Referenced by bsdf_blur().
ccl_device int bsdf_microfacet_multi_ggx_common_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 376 of file bsdf_microfacet_multi.h.
References blender::math::clamp(), saturate(), 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 | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | pdf, | ||
ccl_private uint * | lcg_state | ||
) |
Definition at line 428 of file bsdf_microfacet_multi.h.
References ccl_private, CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, blender::math::dot(), I, make_float2, make_float3, make_orthonormals(), make_orthonormals_tangent(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), X, Y, and Z.
Referenced by bsdf_eval().
ccl_device float3 bsdf_microfacet_multi_ggx_eval_transmit | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | pdf, | ||
ccl_private 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 | ( | ccl_private MicrofacetBsdf * | bsdf, |
ccl_private const ShaderData * | sd | ||
) |
Definition at line 396 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_fresnel_color(), bsdf_microfacet_multi_ggx_common_setup(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, blender::math::is_zero(), and make_float3.
Referenced by MicrofacetMultiGGXFresnelClosure::setup(), MicrofacetMultiGGXAnisoFresnelClosure::setup(), and svm_node_closure_bsdf().
ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_reflect | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | pdf, | ||
ccl_private uint * | lcg_state | ||
) |
Definition at line 625 of file bsdf_microfacet_multi.h.
References ccl_private, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, blender::math::dot(), I, 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 | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | pdf, | ||
ccl_private uint * | lcg_state | ||
) |
Definition at line 592 of file bsdf_microfacet_multi.h.
References ccl_private, blender::math::dot(), I, 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 | ( | ccl_private MicrofacetBsdf * | bsdf, |
ccl_private const ShaderData * | sd | ||
) |
Definition at line 575 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_fresnel_color(), blender::math::clamp(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, max, saturate(), 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, |
ccl_private const ShaderClosure * | sc, | ||
float3 | Ng, | ||
float3 | I, | ||
float3 | dIdx, | ||
float3 | dIdy, | ||
float | randu, | ||
float | randv, | ||
ccl_private float3 * | eval, | ||
ccl_private float3 * | omega_in, | ||
ccl_private float3 * | domega_in_dx, | ||
ccl_private float3 * | domega_in_dy, | ||
ccl_private float * | pdf, | ||
ccl_private uint * | lcg_state | ||
) |
Definition at line 660 of file bsdf_microfacet_multi.h.
References __RAY_DIFFERENTIALS__, ccl_private, CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID, blender::math::dot(), fresnel_dielectric(), I, 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 | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 563 of file bsdf_microfacet_multi.h.
References blender::math::clamp(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID, max, saturate(), 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 | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 409 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_multi_ggx_common_setup(), and CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID.
ccl_device int bsdf_microfacet_multi_ggx_sample | ( | KernelGlobals | kg, |
ccl_private const ShaderClosure * | sc, | ||
float3 | Ng, | ||
float3 | I, | ||
float3 | dIdx, | ||
float3 | dIdy, | ||
float | randu, | ||
float | randv, | ||
ccl_private float3 * | eval, | ||
ccl_private float3 * | omega_in, | ||
ccl_private float3 * | domega_in_dx, | ||
ccl_private float3 * | domega_in_dy, | ||
ccl_private float * | pdf, | ||
ccl_private uint * | lcg_state | ||
) |
Definition at line 477 of file bsdf_microfacet_multi.h.
References ccl_private, CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID, blender::math::dot(), I, LABEL_GLOSSY, LABEL_NONE, LABEL_REFLECT, LABEL_SINGULAR, make_float2, make_float3, make_orthonormals(), make_orthonormals_tangent(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_sample().
ccl_device int bsdf_microfacet_multi_ggx_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 386 of file bsdf_microfacet_multi.h.
References bsdf_microfacet_multi_ggx_common_setup(), CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID, blender::math::is_zero(), and make_float3.
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 17 of file bsdf_microfacet_multi.h.
References 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 26 of file bsdf_microfacet_multi.h.
References M_PI_F, max, float3::x, float2::x, float3::y, float2::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 213 of file bsdf_microfacet_multi.h.
References saturatef().
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 151 of file bsdf_microfacet_multi.h.
References D_ggx(), blender::math::dot(), fresnel_dielectric_cos(), if(), make_float3, max, blender::math::normalize(), v, w(), float2::x, 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 104 of file bsdf_microfacet_multi.h.
References D_ggx(), D_ggx_aniso(), make_float3, max, blender::math::normalize(), w(), float2::x, float2::y, 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 219 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 265 of file bsdf_microfacet_multi.h.
References expf, r, and saturatef().
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 307 of file bsdf_microfacet_multi.h.
References D(), D_ggx_aniso(), M_1_PI_F, max, mf_ggx_albedo(), mf_lambda(), blender::math::normalize(), sqrtf, float2::x, float2::y, 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 295 of file bsdf_microfacet_multi.h.
References D(), D_ggx(), M_1_PI_F, make_float2, max, mf_ggx_albedo(), mf_lambda(), blender::math::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 277 of file bsdf_microfacet_multi.h.
References Freestyle::a, blender::math::clamp(), expf, usdtokens::ior(), and saturatef().
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 319 of file bsdf_microfacet_multi.h.
References D(), D_ggx(), blender::math::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 208 of file bsdf_microfacet_multi.h.
References saturatef().
Referenced by mf_sample_height().
ccl_device_forceinline float mf_lambda | ( | const float3 | w, |
const float2 | alpha | ||
) |
Definition at line 191 of file bsdf_microfacet_multi.h.
References blender::math::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, |
ccl_private float * | h, | ||
ccl_private float * | C1, | ||
ccl_private float * | G1, | ||
ccl_private float * | lambda, | ||
const float | U | ||
) |
Definition at line 230 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, | ||
ccl_private bool * | outside | ||
) |
Definition at line 133 of file bsdf_microfacet_multi.h.
References blender::math::dot(), fresnel_dielectric_cos(), blender::math::normalize(), and safe_sqrtf().
Referenced by mf_eval(), and mf_sample().
ccl_device_forceinline float3 mf_sample_phase_glossy | ( | const float3 | wi, |
ccl_private float3 * | weight, | ||
const float3 | wm | ||
) |
Definition at line 97 of file bsdf_microfacet_multi.h.
References blender::math::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 78 of file bsdf_microfacet_multi.h.
References CCL_NAMESPACE_BEGIN::isfinite(), kernel_assert, make_float3, mf_sampleP22_11(), blender::math::normalize(), safe_normalize(), float3::x, float2::x, float3::y, float2::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 36 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().