Light Linking: Select one of dedicated lights #107739

Merged
Sergey Sharybin merged 3 commits from Sergey/blender:cycles-light-linking-multiple-light into cycles-light-linking 2023-05-16 16:24:34 +02:00

3 Commits

Author SHA1 Message Date
Sergey Sharybin 7233cf42ac Remove constexpr from the if statement
Is not supported with CUDA 10.
2023-05-16 16:13:17 +02:00
Sergey Sharybin 4491e74f8e Merge branch 'cycles-light-linking' into cycles-light-linking-multiple-light 2023-05-16 16:12:59 +02:00
Sergey Sharybin b5ca99a10c Shadow linking: Select one of dedicated lights
Before this change the shadow ray for shadow linking was picking the
closest light. Now a random light on the ray is chosen.

This is more noisy than integrating all lights in the direction of the
main path, but this is the only way to properly support complex
scenarios where there are multiple blockers between the shading point
and the light sources, with different linked settings.

Another unfortunate aspect of this change is increased state size.
This is because the light sample needs to be scaled, so some extra
information is needed. From the intersection kernel it is not yet
possible to write to the shadow path state as this intersection kernel
is marked as not generating shadow rays for the performance reasons.

Perhaps proper solution would be to run profiler to see if the current
dedicated light intersection + shading kernel split actually gives
speedup (by allowing the shadow and main path to run in parallel as
much as possible) or if the speedup is neglectable and it is better to
save memory of the state.

Ref #104972
2023-05-08 14:43:37 +02:00