Fix light linked emissive meshes rendering black for camera rays

This commit is contained in:
Brecht Van Lommel
2023-05-25 13:17:17 +02:00
parent 1d7832a6a4
commit e3c5306d4e
3 changed files with 9 additions and 5 deletions

View File

@@ -140,7 +140,9 @@ ccl_device_inline void integrate_distant_lights(KernelGlobals kg,
#endif
#ifdef __LIGHT_LINKING__
if (!light_link_light_match(kg, light_link_receiver_forward(kg, state), lamp)) {
if (!light_link_light_match(kg, light_link_receiver_forward(kg, state), lamp) &&
!(path_flag & PATH_RAY_CAMERA))
{
continue;
}
#endif

View File

@@ -113,14 +113,16 @@ ccl_device_forceinline void integrate_surface_emission(KernelGlobals kg,
ccl_global float *ccl_restrict
render_buffer)
{
const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
#ifdef __LIGHT_LINKING__
if (!light_link_object_match(kg, light_link_receiver_forward(kg, state), sd->object)) {
if (!light_link_object_match(kg, light_link_receiver_forward(kg, state), sd->object) &&
!(path_flag & PATH_RAY_CAMERA))
{
return;
}
#endif
const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
#ifdef __SHADOW_LINKING__
/* Indirect emission of shadow-linked emissive surfaces is done via shadow rays to dedicated
* light sources. */

View File

@@ -311,7 +311,7 @@ ccl_device_forceinline int lights_intersect_impl(KernelGlobals kg,
#ifdef __LIGHT_LINKING__
/* Light linking. */
if (!light_link_light_match(kg, receiver_forward, lamp)) {
if (!light_link_light_match(kg, receiver_forward, lamp) && !(path_flag & PATH_RAY_CAMERA)) {
continue;
}
#endif