23 const float fac = klight->sun.half_inv_sin_half_angle /
len(
D - klight->co);
40 klight->co, klight->sun.one_minus_cosangle, rand, &unused, &ls->pdf);
46 ls->eval_fac = klight->sun.eval_fac;
63 if (klight->sun.angle == 0.0f) {
67 if (
vector_angle(-klight->co, ray->D) > klight->sun.angle) {
79 if (klight->sun.angle == 0.0f) {
83 if (
vector_angle(-klight->co, ray_D) > klight->sun.angle) {
87 return LightEval{klight->sun.eval_fac, klight->sun.pdf};
90template<
bool in_volume_segment>
99 if (in_volume_segment) {
117 point_to_centroid = -centroid;
#define kernel_assert(cond)
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
float3 sample_uniform_cone(float2 rand, float cos_angle)
float dot(VecOp< float, D >, VecOp< float, D >) RET
float distance(float, float) RET
ccl_device_inline Transform lamp_get_inverse_transform(KernelGlobals kg, const ccl_global KernelLight *klight)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
ccl_device_inline float vector_angle(const float3 a, const float3 b)
ccl_device float fast_cosf(float x)
ccl_device bool sun_light_intersect(const ccl_global KernelLight *klight, const ccl_private Ray *ccl_restrict ray, ccl_private float *t)
ccl_device_forceinline bool sun_light_tree_parameters(const float3 centroid, const float theta_e, const float t, ccl_private float &cos_theta_u, ccl_private float2 &distance, ccl_private float3 &point_to_centroid, ccl_private float &theta_d)
CCL_NAMESPACE_BEGIN ccl_device_inline float2 sun_light_uv(KernelGlobals kg, const ccl_global KernelLight *klight, const float3 D)
ccl_device LightEval sun_light_eval_from_intersection(const ccl_global KernelLight *klight, const float3 ray_D)
ccl_device_inline bool sun_light_sample(const ccl_global KernelLight *klight, const float2 rand, ccl_private LightSample *ls)