Blender
V3.3
|
#include "kernel/closure/bsdf_util.h"
#include "kernel/sample/pattern.h"
#include "kernel/util/lookup_table.h"
Go to the source code of this file.
Classes | |
struct | MicrofacetExtra |
struct | MicrofacetBsdf |
Typedefs | |
typedef CCL_NAMESPACE_BEGIN struct MicrofacetExtra | MicrofacetExtra |
typedef struct MicrofacetBsdf | MicrofacetBsdf |
Definition at line 118 of file closures.cpp.
typedef CCL_NAMESPACE_BEGIN struct MicrofacetExtra MicrofacetExtra |
ccl_device_inline float bsdf_beckmann_aniso_G1 | ( | float | alpha_x, |
float | alpha_y, | ||
float | cos_n, | ||
float | cos_phi, | ||
float | sin_phi | ||
) |
Definition at line 819 of file bsdf_microfacet.h.
References Freestyle::a, and safe_sqrtf().
Referenced by bsdf_microfacet_beckmann_eval_reflect(), and bsdf_microfacet_beckmann_sample().
ccl_device_inline float bsdf_beckmann_G1 | ( | float | alpha, |
float | cos_n | ||
) |
Definition at line 807 of file bsdf_microfacet.h.
References Freestyle::a, and safe_sqrtf().
Referenced by bsdf_microfacet_beckmann_eval_reflect(), bsdf_microfacet_beckmann_eval_transmit(), and bsdf_microfacet_beckmann_sample().
ccl_device void bsdf_microfacet_beckmann_blur | ( | ccl_private ShaderClosure * | sc, |
float | roughness | ||
) |
Definition at line 799 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, ccl_private, fmaxf, and usdtokens::roughness().
Referenced by bsdf_blur().
ccl_device float3 bsdf_microfacet_beckmann_eval_reflect | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | |||
) |
Definition at line 838 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, bsdf_beckmann_aniso_G1(), bsdf_beckmann_G1(), ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, D(), blender::math::dot(), expf, G, I, M_PI_F, make_float3, make_orthonormals_tangent(), N, blender::math::normalize(), usdtokens::out(), float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_eval().
ccl_device float3 bsdf_microfacet_beckmann_eval_transmit | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | |||
) |
Definition at line 919 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, bsdf_beckmann_G1(), ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, D(), blender::math::dot(), expf, fabsf, G, I, M_PI_F, make_float3, min, N, blender::math::normalize(), and usdtokens::out().
Referenced by bsdf_eval().
ccl_device int bsdf_microfacet_beckmann_isotropic_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 783 of file bsdf_microfacet.h.
References bsdf_microfacet_beckmann_setup().
Referenced by MicrofacetClosure::setup().
ccl_device int bsdf_microfacet_beckmann_refraction_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 790 of file bsdf_microfacet.h.
References CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by MicrofacetClosure::setup(), svm_node_closure_bsdf(), and svm_node_glass_setup().
ccl_device int bsdf_microfacet_beckmann_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 * | |||
) |
Definition at line 977 of file bsdf_microfacet.h.
References __RAY_DIFFERENTIALS__, MicrofacetBsdf::alpha_x, bsdf_beckmann_aniso_G1(), bsdf_beckmann_G1(), ccl_private, CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID, D(), blender::math::dot(), expf, fabsf, fresnel_dielectric(), G, I, label, LABEL_GLOSSY, LABEL_REFLECT, LABEL_SINGULAR, LABEL_TRANSMIT, M_PI_F, make_float3, make_orthonormals(), make_orthonormals_tangent(), microfacet_sample_stretched(), N, usdtokens::out(), R, T, float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_sample().
ccl_device int bsdf_microfacet_beckmann_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 773 of file bsdf_microfacet.h.
References CLOSURE_BSDF_MICROFACET_BECKMANN_ID, saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by bsdf_microfacet_beckmann_isotropic_setup(), MicrofacetClosure::setup(), svm_node_closure_bsdf(), and svm_node_glass_setup().
ccl_device_forceinline void bsdf_microfacet_fresnel_color | ( | ccl_private const ShaderData * | sd, |
ccl_private MicrofacetBsdf * | bsdf | ||
) |
Definition at line 261 of file bsdf_microfacet.h.
References average(), CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, CLOSURE_IS_BSDF_MICROFACET_FRESNEL, fresnel_dielectric_cos(), interpolate_fresnel_color(), and kernel_assert.
Referenced by bsdf_microfacet_ggx_clearcoat_setup(), bsdf_microfacet_ggx_fresnel_setup(), bsdf_microfacet_multi_ggx_fresnel_setup(), and bsdf_microfacet_multi_ggx_glass_fresnel_setup().
ccl_device void bsdf_microfacet_ggx_blur | ( | ccl_private ShaderClosure * | sc, |
float | roughness | ||
) |
Definition at line 352 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, ccl_private, fmaxf, and usdtokens::roughness().
Referenced by bsdf_blur().
ccl_device int bsdf_microfacet_ggx_clearcoat_setup | ( | ccl_private MicrofacetBsdf * | bsdf, |
ccl_private const ShaderData * | sd | ||
) |
Definition at line 325 of file bsdf_microfacet.h.
References bsdf_microfacet_fresnel_color(), CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, saturate(), saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by PrincipledClearcoatClosure::setup(), and svm_node_closure_bsdf().
ccl_device float3 bsdf_microfacet_ggx_eval_reflect | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | |||
) |
Definition at line 360 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, D(), D_GTR1(), blender::math::dot(), F, G, I, M_PI_F, make_float3, make_orthonormals_tangent(), N, blender::math::normalize(), usdtokens::out(), reflection_color(), safe_sqrtf(), float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_eval().
ccl_device float3 bsdf_microfacet_ggx_eval_transmit | ( | ccl_private const ShaderClosure * | sc, |
const float3 | I, | ||
const float3 | omega_in, | ||
ccl_private float * | |||
) |
Definition at line 475 of file bsdf_microfacet.h.
References MicrofacetBsdf::alpha_x, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, D(), blender::math::dot(), fabsf, G, I, M_PI_F, make_float3, N, blender::math::normalize(), usdtokens::out(), and safe_sqrtf().
Referenced by bsdf_eval().
ccl_device int bsdf_microfacet_ggx_fresnel_setup | ( | ccl_private MicrofacetBsdf * | bsdf, |
ccl_private const ShaderData * | sd | ||
) |
Definition at line 310 of file bsdf_microfacet.h.
References bsdf_microfacet_fresnel_color(), CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID, saturate(), saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by MicrofacetGGXFresnelClosure::setup(), MicrofacetGGXAnisoFresnelClosure::setup(), and svm_node_closure_bsdf().
ccl_device int bsdf_microfacet_ggx_isotropic_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 303 of file bsdf_microfacet.h.
References bsdf_microfacet_ggx_setup().
Referenced by MicrofacetClosure::setup().
ccl_device int bsdf_microfacet_ggx_refraction_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 340 of file bsdf_microfacet.h.
References CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, NULL, saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by MicrofacetClosure::setup(), svm_node_closure_bsdf(), and svm_node_glass_setup().
ccl_device int bsdf_microfacet_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 * | |||
) |
Definition at line 536 of file bsdf_microfacet.h.
References __RAY_DIFFERENTIALS__, MicrofacetBsdf::alpha_x, ccl_private, CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, D(), D_GTR1(), blender::math::dot(), F, fabsf, fresnel_dielectric(), I, label, LABEL_GLOSSY, LABEL_REFLECT, LABEL_SINGULAR, LABEL_TRANSMIT, M_PI_F, make_float3, make_orthonormals(), make_orthonormals_tangent(), microfacet_sample_stretched(), N, usdtokens::out(), R, reflection_color(), safe_sqrtf(), T, float3::x, X, float3::y, Y, float3::z, and Z.
Referenced by bsdf_sample().
ccl_device int bsdf_microfacet_ggx_setup | ( | ccl_private MicrofacetBsdf * | bsdf | ) |
Definition at line 290 of file bsdf_microfacet.h.
References CLOSURE_BSDF_MICROFACET_GGX_ID, NULL, saturatef(), SD_BSDF, and SD_BSDF_HAS_EVAL.
Referenced by bsdf_microfacet_ggx_isotropic_setup(), MicrofacetClosure::setup(), svm_node_closure_bsdf(), and svm_node_glass_setup().
ccl_device_forceinline float D_GTR1 | ( | float | NdotH, |
float | alpha | ||
) |
Definition at line 252 of file bsdf_microfacet.h.
References logf, M_1_PI_F, M_PI_F, and t.
Referenced by bsdf_microfacet_ggx_eval_reflect(), and bsdf_microfacet_ggx_sample().
ccl_device_inline void microfacet_beckmann_sample_slopes | ( | KernelGlobals | kg, |
const float | cos_theta_i, | ||
const float | sin_theta_i, | ||
float | randu, | ||
float | randv, | ||
ccl_private float * | slope_x, | ||
ccl_private float * | slope_y, | ||
ccl_private float * | G1i | ||
) |
Definition at line 37 of file bsdf_microfacet.h.
References usdtokens::b(), BECKMANN_TABLE_SIZE, cosf, expf, fabsf, fast_erff(), fast_ierff(), K, kernel_data, logf, lookup_table_read_2D(), M_2PI_F, r, sinf, and sqrtf.
Referenced by microfacet_sample_stretched().
ccl_device_inline void microfacet_ggx_sample_slopes | ( | const float | cos_theta_i, |
const float | sin_theta_i, | ||
float | randu, | ||
float | randv, | ||
ccl_private float * | slope_x, | ||
ccl_private float * | slope_y, | ||
ccl_private float * | G1i | ||
) |
Definition at line 124 of file bsdf_microfacet.h.
References A, B, cosf, D(), M_2PI_F, r, safe_sqrtf(), sinf, sqrtf, and z.
Referenced by microfacet_sample_stretched().
ccl_device_forceinline float3 microfacet_sample_stretched | ( | KernelGlobals | kg, |
const float3 | omega_i, | ||
const float | alpha_x, | ||
const float | alpha_y, | ||
const float | randu, | ||
const float | randv, | ||
bool | beckmann, | ||
ccl_private float * | G1i | ||
) |
Definition at line 177 of file bsdf_microfacet.h.
References make_float3, microfacet_beckmann_sample_slopes(), microfacet_ggx_sample_slopes(), blender::math::normalize(), safe_sqrtf(), float3::x, float3::y, and float3::z.
Referenced by bsdf_microfacet_beckmann_sample(), and bsdf_microfacet_ggx_sample().
ccl_device_forceinline float3 reflection_color | ( | ccl_private const MicrofacetBsdf * | bsdf, |
float3 | L, | ||
float3 | H | ||
) |
Definition at line 236 of file bsdf_microfacet.h.
References CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID, CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID, F, fresnel_dielectric_cos(), H, interpolate_fresnel_color(), L, and make_float3.
Referenced by bsdf_microfacet_ggx_eval_reflect(), and bsdf_microfacet_ggx_sample().