Fix light linked emissive meshes rendering black for camera rays
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user