Blender V2.61 - r43446
Functions

kernel_montecarlo.h File Reference

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN __device void to_unit_disk (float *x, float *y)
__device void make_orthonormals_tangent (const float3 N, const float3 T, float3 *a, float3 *b)
__device_inline void sample_cos_hemisphere (const float3 N, float randu, float randv, float3 *omega_in, float *pdf)
__device_inline void sample_uniform_hemisphere (const float3 N, float randu, float randv, float3 *omega_in, float *pdf)
__device float3 sample_uniform_sphere (float u1, float u2)
__device float power_heuristic (float a, float b)
__device float2 concentric_sample_disk (float u1, float u2)
__device float2 regular_polygon_sample (float corners, float rotation, float u, float v)
__device float2 direction_to_spherical (float3 dir)
__device float3 spherical_to_direction (float theta, float phi)

Function Documentation

__device float2 concentric_sample_disk ( float  u1,
float  u2 
)

Definition at line 121 of file kernel_montecarlo.h.

References cosf, M_PI_4_F, make_float2(), and sinf.

Referenced by camera_sample_aperture().

__device float2 direction_to_spherical ( float3  dir)

Definition at line 190 of file kernel_montecarlo.h.

References acosf, atan2f, make_float2(), float3::x, float3::y, and float3::z.

Referenced by sky_radiance().

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

Definition at line 70 of file kernel_montecarlo.h.

References cross().

Referenced by bsdf_ward_eval_reflect(), and bsdf_ward_sample().

__device float power_heuristic ( float  a,
float  b 
)

Definition at line 116 of file kernel_montecarlo.h.

Referenced by direct_emission(), and indirect_emission().

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

Definition at line 164 of file kernel_montecarlo.h.

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

Referenced by camera_sample_aperture().

__device_inline void sample_cos_hemisphere ( const float3  N,
float  randu,
float  randv,
float3 omega_in,
float *  pdf 
)
__device_inline void sample_uniform_hemisphere ( const float3  N,
float  randu,
float  randv,
float3 omega_in,
float *  pdf 
)
__device float3 sample_uniform_sphere ( float  u1,
float  u2 
)

Definition at line 105 of file kernel_montecarlo.h.

References cosf, fmaxf, M_PI_F, make_float3(), sinf, and sqrtf.

__device float3 spherical_to_direction ( float  theta,
float  phi 
)

Definition at line 198 of file kernel_montecarlo.h.

References cosf, make_float3(), and sinf.

CCL_NAMESPACE_BEGIN __device void to_unit_disk ( float *  x,
float *  y 
)

Given values x and y on [0,1], convert them in place to values on [-1,1] uniformly distributed over a unit sphere. This code is derived from Peter Shirley, "Realistic Ray Tracing", p. 103.

Definition at line 41 of file kernel_montecarlo.h.

References cosf, M_PI_4_F, and sinf.

Referenced by disk_light_sample(), and sample_cos_hemisphere().