Blender  V3.3
Classes | Typedefs | Functions
bsdf_hair_principled.h File Reference
#include <fenv.h>
#include "kernel/util/color.h"

Go to the source code of this file.

Classes

struct  PrincipledHairExtra
 
struct  PrincipledHairBSDF
 

Typedefs

typedef CCL_NAMESPACE_BEGIN struct PrincipledHairExtra PrincipledHairExtra
 
typedef struct PrincipledHairBSDF PrincipledHairBSDF
 

Functions

ccl_device_inline float cos_from_sin (const float s)
 
ccl_device_inline float delta_phi (int p, float gamma_o, float gamma_t)
 
ccl_device_inline float wrap_angle (float a)
 
ccl_device_inline float logistic (float x, float s)
 
ccl_device_inline float logistic_cdf (float x, float s)
 
ccl_device_inline float bessel_I0 (float x)
 
ccl_device_inline float log_bessel_I0 (float x)
 
ccl_device_inline float trimmed_logistic (float x, float s)
 
ccl_device_inline float sample_trimmed_logistic (float u, float s)
 
ccl_device_inline float azimuthal_scattering (float phi, int p, float s, float gamma_o, float gamma_t)
 
ccl_device_inline float longitudinal_scattering (float sin_theta_i, float cos_theta_i, float sin_theta_o, float cos_theta_o, float v)
 
ccl_device_inline float4 combine_with_energy (KernelGlobals kg, float3 c)
 
ccl_device_inline void hair_attenuation (KernelGlobals kg, float f, float3 T, ccl_private float4 *Ap)
 
ccl_device_inline void hair_alpha_angles (float sin_theta_i, float cos_theta_i, float alpha, ccl_private float *angles)
 
ccl_device float3 bsdf_principled_hair_eval (KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private const ShaderClosure *sc, const float3 omega_in, ccl_private float *pdf)
 
ccl_device int bsdf_principled_hair_sample (KernelGlobals kg, ccl_private const ShaderClosure *sc, ccl_private ShaderData *sd, 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_device void bsdf_principled_hair_blur (ccl_private ShaderClosure *sc, float roughness)
 
ccl_device_inline float bsdf_principled_hair_albedo_roughness_scale (const float azimuthal_roughness)
 
ccl_device float3 bsdf_principled_hair_albedo (ccl_private const ShaderClosure *sc)
 
ccl_device_inline float3 bsdf_principled_hair_sigma_from_reflectance (const float3 color, const float azimuthal_roughness)
 
ccl_device_inline float3 bsdf_principled_hair_sigma_from_concentration (const float eumelanin, const float pheomelanin)
 

Typedef Documentation

◆ PrincipledHairBSDF

◆ PrincipledHairExtra

Function Documentation

◆ azimuthal_scattering()

ccl_device_inline float azimuthal_scattering ( float  phi,
int  p,
float  s,
float  gamma_o,
float  gamma_t 
)

◆ bessel_I0()

ccl_device_inline float bessel_I0 ( float  x)

Definition at line 89 of file bsdf_hair_principled.h.

References sqr(), and x.

Referenced by log_bessel_I0(), and longitudinal_scattering().

◆ bsdf_principled_hair_albedo()

ccl_device float3 bsdf_principled_hair_albedo ( ccl_private const ShaderClosure sc)

◆ bsdf_principled_hair_albedo_roughness_scale()

ccl_device_inline float bsdf_principled_hair_albedo_roughness_scale ( const float  azimuthal_roughness)

◆ bsdf_principled_hair_blur()

ccl_device void bsdf_principled_hair_blur ( ccl_private ShaderClosure sc,
float  roughness 
)

Definition at line 474 of file bsdf_hair_principled.h.

References ccl_private, fmaxf, usdtokens::roughness(), and PrincipledHairBSDF::v.

Referenced by bsdf_blur().

◆ bsdf_principled_hair_eval()

ccl_device float3 bsdf_principled_hair_eval ( KernelGlobals  kg,
ccl_private const ShaderData sd,
ccl_private const ShaderClosure sc,
const float3  omega_in,
ccl_private float pdf 
)

◆ bsdf_principled_hair_sample()

ccl_device int bsdf_principled_hair_sample ( KernelGlobals  kg,
ccl_private const ShaderClosure sc,
ccl_private ShaderData sd,
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 
)

◆ bsdf_principled_hair_sigma_from_concentration()

ccl_device_inline float3 bsdf_principled_hair_sigma_from_concentration ( const float  eumelanin,
const float  pheomelanin 
)

Definition at line 506 of file bsdf_hair_principled.h.

References make_float3.

Referenced by svm_node_closure_bsdf().

◆ bsdf_principled_hair_sigma_from_reflectance()

ccl_device_inline float3 bsdf_principled_hair_sigma_from_reflectance ( const float3  color,
const float  azimuthal_roughness 
)

◆ combine_with_energy()

ccl_device_inline float4 combine_with_energy ( KernelGlobals  kg,
float3  c 
)

Definition at line 170 of file bsdf_hair_principled.h.

References Freestyle::c, linear_rgb_to_gray(), and make_float4.

Referenced by hair_attenuation().

◆ cos_from_sin()

ccl_device_inline float cos_from_sin ( const float  s)

◆ delta_phi()

ccl_device_inline float delta_phi ( int  p,
float  gamma_o,
float  gamma_t 
)

◆ hair_alpha_angles()

ccl_device_inline void hair_alpha_angles ( float  sin_theta_i,
float  cos_theta_i,
float  alpha,
ccl_private float angles 
)

Definition at line 248 of file bsdf_hair_principled.h.

References cos_from_sin(), fabsf, sinf, and sqr().

Referenced by bsdf_principled_hair_eval(), and bsdf_principled_hair_sample().

◆ hair_attenuation()

ccl_device_inline void hair_attenuation ( KernelGlobals  kg,
float  f,
float3  T,
ccl_private float4 Ap 
)

◆ log_bessel_I0()

ccl_device_inline float log_bessel_I0 ( float  x)

Definition at line 110 of file bsdf_hair_principled.h.

References bessel_I0(), logf, M_LN_2PI_F, and x.

Referenced by longitudinal_scattering().

◆ logistic()

ccl_device_inline float logistic ( float  x,
float  s 
)

Definition at line 69 of file bsdf_hair_principled.h.

References expf, fabsf, sqr(), v, and x.

Referenced by trimmed_logistic().

◆ logistic_cdf()

ccl_device_inline float logistic_cdf ( float  x,
float  s 
)

Definition at line 76 of file bsdf_hair_principled.h.

References expf, and x.

Referenced by sample_trimmed_logistic(), and trimmed_logistic().

◆ longitudinal_scattering()

ccl_device_inline float longitudinal_scattering ( float  sin_theta_i,
float  cos_theta_i,
float  sin_theta_o,
float  cos_theta_o,
float  v 
)

◆ sample_trimmed_logistic()

ccl_device_inline float sample_trimmed_logistic ( float  u,
float  s 
)

Definition at line 134 of file bsdf_hair_principled.h.

References blender::math::clamp(), logf, logistic_cdf(), M_PI_F, and x.

Referenced by bsdf_principled_hair_sample().

◆ trimmed_logistic()

ccl_device_inline float trimmed_logistic ( float  x,
float  s 
)

Definition at line 123 of file bsdf_hair_principled.h.

References logistic(), logistic_cdf(), M_PI_F, blender::math::safe_divide(), and x.

Referenced by azimuthal_scattering().

◆ wrap_angle()

ccl_device_inline float wrap_angle ( float  a)

Definition at line 57 of file bsdf_hair_principled.h.

References Freestyle::a, M_2PI_F, and M_PI_F.

Referenced by azimuthal_scattering(), and dial_ghostarc_get_angles().