Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/light/distribution.h
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | if (prim >= 0) { | ||||
| /* Exclude synthetic meshes from shadow catcher pass. */ | /* Exclude synthetic meshes from shadow catcher pass. */ | ||||
| if ((path_flag & PATH_RAY_SHADOW_CATCHER_PASS) && | if ((path_flag & PATH_RAY_SHADOW_CATCHER_PASS) && | ||||
| !(kernel_data_fetch(object_flag, object) & SD_OBJECT_SHADOW_CATCHER)) { | !(kernel_data_fetch(object_flag, object) & SD_OBJECT_SHADOW_CATCHER)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| const int shader_flag = kdistribution->mesh_light.shader_flag; | const int shader_flag = kdistribution->mesh_light.shader_flag; | ||||
| triangle_light_sample<in_volume_segment>(kg, prim, object, randu, randv, time, ls, P); | if (!triangle_light_sample<in_volume_segment>(kg, prim, object, randu, randv, time, ls, P)) { | ||||
| return false; | |||||
| } | |||||
| ls->shader |= shader_flag; | ls->shader |= shader_flag; | ||||
| return (ls->pdf > 0.0f); | |||||
| } | } | ||||
| else { | |||||
| const int lamp = -prim - 1; | const int lamp = -prim - 1; | ||||
| if (UNLIKELY(light_select_reached_max_bounces(kg, lamp, bounce))) { | if (UNLIKELY(light_select_reached_max_bounces(kg, lamp, bounce))) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (!light_sample<in_volume_segment>(kg, lamp, randu, randv, P, path_flag, ls)) { | if (!light_sample<in_volume_segment>(kg, lamp, randu, randv, P, path_flag, ls)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| ls->pdf_selection = kernel_data.integrator.distribution_pdf_lights; | ls->pdf_selection = kernel_data.integrator.distribution_pdf_lights; | ||||
| ls->pdf *= ls->pdf_selection; | } | ||||
| return true; | ls->pdf *= ls->pdf_selection; | ||||
| return (ls->pdf > 0.0f); | |||||
| } | } | ||||
| ccl_device_inline float light_distribution_pdf_lamp(KernelGlobals kg) | ccl_device_inline float light_distribution_pdf_lamp(KernelGlobals kg) | ||||
| { | { | ||||
| return kernel_data.integrator.distribution_pdf_lights; | return kernel_data.integrator.distribution_pdf_lights; | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||