Blender  V2.93
Functions
kernel_montecarlo.h File Reference

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN ccl_device void to_unit_disk (float *x, float *y)
 
ccl_device void make_orthonormals_tangent (const float3 N, const float3 T, float3 *a, float3 *b)
 
ccl_device_inline void sample_cos_hemisphere (const float3 N, float randu, float randv, float3 *omega_in, float *pdf)
 
ccl_device_inline void sample_uniform_hemisphere (const float3 N, float randu, float randv, float3 *omega_in, float *pdf)
 
ccl_device_inline void sample_uniform_cone (const float3 N, float angle, float randu, float randv, float3 *omega_in, float *pdf)
 
ccl_device_inline float pdf_uniform_cone (const float3 N, float3 D, float angle)
 
ccl_device float3 sample_uniform_sphere (float u1, float u2)
 
ccl_device float balance_heuristic (float a, float b)
 
ccl_device float balance_heuristic_3 (float a, float b, float c)
 
ccl_device float power_heuristic (float a, float b)
 
ccl_device float power_heuristic_3 (float a, float b, float c)
 
ccl_device float max_heuristic (float a, float b)
 
ccl_device float2 concentric_sample_disk (float u1, float u2)
 
ccl_device float2 regular_polygon_sample (float corners, float rotation, float u, float v)
 
ccl_device float3 ensure_valid_reflection (float3 Ng, float3 I, float3 N)
 

Function Documentation

◆ balance_heuristic()

ccl_device float balance_heuristic ( float  a,
float  b 
)

Definition at line 123 of file kernel_montecarlo.h.

References Freestyle::a.

◆ balance_heuristic_3()

ccl_device float balance_heuristic_3 ( float  a,
float  b,
float  c 
)

Definition at line 128 of file kernel_montecarlo.h.

References Freestyle::a, and Freestyle::c.

◆ concentric_sample_disk()

ccl_device float2 concentric_sample_disk ( float  u1,
float  u2 
)

Definition at line 150 of file kernel_montecarlo.h.

References Freestyle::a, cosf, M_PI_2_F, M_PI_4_F, make_float2, r, sinf, u1, u2, and zero_float2().

Referenced by camera_sample_aperture().

◆ ensure_valid_reflection()

ccl_device float3 ensure_valid_reflection ( float3  Ng,
float3  I,
float3  N 
)

◆ make_orthonormals_tangent()

ccl_device void make_orthonormals_tangent ( const float3  N,
const float3  T,
float3 a,
float3 b 
)

◆ max_heuristic()

ccl_device float max_heuristic ( float  a,
float  b 
)

Definition at line 143 of file kernel_montecarlo.h.

References Freestyle::a.

◆ pdf_uniform_cone()

ccl_device_inline float pdf_uniform_cone ( const float3  N,
float3  D,
float  angle 
)

Definition at line 101 of file kernel_montecarlo.h.

References angle(), cosf, D(), dot(), M_1_2PI_F, N, and z.

◆ power_heuristic()

ccl_device float power_heuristic ( float  a,
float  b 
)

◆ power_heuristic_3()

ccl_device float power_heuristic_3 ( float  a,
float  b,
float  c 
)

Definition at line 138 of file kernel_montecarlo.h.

References Freestyle::a, and Freestyle::c.

◆ regular_polygon_sample()

ccl_device float2 regular_polygon_sample ( float  corners,
float  rotation,
float  u,
float  v 
)

Definition at line 172 of file kernel_montecarlo.h.

References angle(), cosf, floorf, M_PI_F, make_float2, sinf, sqrtf, v, float2::x, and float2::y.

Referenced by camera_sample_aperture().

◆ sample_cos_hemisphere()

ccl_device_inline void sample_cos_hemisphere ( const float3  N,
float  randu,
float  randv,
float3 omega_in,
float pdf 
)

◆ sample_uniform_cone()

ccl_device_inline void sample_uniform_cone ( const float3  N,
float  angle,
float  randu,
float  randv,
float3 omega_in,
float pdf 
)

Definition at line 85 of file kernel_montecarlo.h.

References angle(), B, cosf, M_1_2PI_F, M_2PI_F, make_orthonormals(), N, r, safe_sqrtf(), sinf, sqr(), T, x, y, and z.

Referenced by bsdf_diffuse_toon_sample(), and bsdf_glossy_toon_sample().

◆ sample_uniform_hemisphere()

ccl_device_inline void sample_uniform_hemisphere ( const float3  N,
float  randu,
float  randv,
float3 omega_in,
float pdf 
)

Definition at line 69 of file kernel_montecarlo.h.

References B, cosf, M_1_PI_F, M_2PI_F, make_orthonormals(), max, N, r, sinf, sqrtf, T, x, y, and z.

Referenced by bsdf_ashikhmin_velvet_sample(), and bsdf_oren_nayar_sample().

◆ sample_uniform_sphere()

ccl_device float3 sample_uniform_sphere ( float  u1,
float  u2 
)

Definition at line 112 of file kernel_montecarlo.h.

References cosf, fmaxf, M_2PI_F, make_float3, r, sinf, sqrtf, u1, u2, x, y, and z.

◆ to_unit_disk()

CCL_NAMESPACE_BEGIN ccl_device void to_unit_disk ( float x,
float y 
)

Definition at line 39 of file kernel_montecarlo.h.

References cosf, M_2PI_F, r, sinf, sqrtf, x, and y.

Referenced by ellipse_sample(), and sample_cos_hemisphere().