Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_light_common.h
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | ccl_device bool light_spread_clamp_area_light(const float3 P, | ||||
| *lightP = *lightP + new_center_u * u + new_center_v * v; | *lightP = *lightP + new_center_u * u + new_center_v * v; | ||||
| *axisu = u * new_len_u; | *axisu = u * new_len_u; | ||||
| *axisv = v * new_len_v; | *axisv = v * new_len_v; | ||||
| return true; | return true; | ||||
| } | } | ||||
| ccl_device float lamp_light_pdf(ccl_global const KernelGlobals *kg, | ccl_device float lamp_light_pdf(KernelGlobals kg, const float3 Ng, const float3 I, float t) | ||||
| const float3 Ng, | |||||
| const float3 I, | |||||
| float t) | |||||
| { | { | ||||
| float cos_pi = dot(Ng, I); | float cos_pi = dot(Ng, I); | ||||
| if (cos_pi <= 0.0f) | if (cos_pi <= 0.0f) | ||||
| return 0.0f; | return 0.0f; | ||||
| return t * t / cos_pi; | return t * t / cos_pi; | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||