Blender  V3.3
Functions
sample/mapping.h File Reference

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN ccl_device void to_unit_disk (ccl_private float *x, ccl_private float *y)
 
ccl_device void make_orthonormals_tangent (const float3 N, const float3 T, ccl_private float3 *a, ccl_private float3 *b)
 
ccl_device_inline void sample_cos_hemisphere (const float3 N, float randu, float randv, ccl_private float3 *omega_in, ccl_private float *pdf)
 
ccl_device_inline void sample_uniform_hemisphere (const float3 N, float randu, float randv, ccl_private float3 *omega_in, ccl_private float *pdf)
 
ccl_device_inline void sample_uniform_cone (const float3 N, float angle, float randu, float randv, ccl_private float3 *omega_in, ccl_private 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 float2 concentric_sample_disk (float u1, float u2)
 
ccl_device float2 regular_polygon_sample (float corners, float rotation, float u, float v)
 

Function Documentation

◆ concentric_sample_disk()

ccl_device float2 concentric_sample_disk ( float  u1,
float  u2 
)

Definition at line 107 of file sample/mapping.h.

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

Referenced by camera_sample_aperture().

◆ make_orthonormals_tangent()

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

◆ pdf_uniform_cone()

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

Definition at line 83 of file sample/mapping.h.

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

◆ regular_polygon_sample()

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

Definition at line 129 of file sample/mapping.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,
ccl_private float3 omega_in,
ccl_private float pdf 
)

◆ sample_uniform_cone()

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

Definition at line 63 of file sample/mapping.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,
ccl_private float3 omega_in,
ccl_private float pdf 
)

Definition at line 47 of file sample/mapping.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 94 of file sample/mapping.h.

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

◆ to_unit_disk()

Definition at line 14 of file sample/mapping.h.

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

Referenced by ellipse_sample(), and sample_cos_hemisphere().