Cycles: Option to Sample all Lights in the Branched Path integrator for indirect samples

This adds a new option "Sample All Lights" to the Sampling panel in Cycles (Branched Path). When enabled, Cycles will sample all the lights in the scene for the indirect samples, instead of randomly picking one. This is already happening for direct samples, now you can optionally enable it for indirect.

Example file and renders:
Blend file: http://www.pasteall.org/blend/27411
Random: http://www.pasteall.org/pic/show.php?id=68033
All: http://www.pasteall.org/pic/show.php?id=68034

Sampling all lights is a bit slower, but there is less variance, so it should help in situations with many lights.

Patch by myself with some tweaks by Brecht.
Differential Revision: https://developer.blender.org/D391
This commit is contained in:
2014-03-09 22:19:27 +01:00
parent 6fdbab4366
commit 99e20d7b89
7 changed files with 105 additions and 96 deletions

View File

@@ -130,6 +130,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
kintegrator->mesh_light_samples = mesh_light_samples;
kintegrator->subsurface_samples = subsurface_samples;
kintegrator->volume_samples = volume_samples;
kintegrator->sample_all_lights_indirect = sample_all_lights_indirect;
kintegrator->sampling_pattern = sampling_pattern;
@@ -197,7 +198,8 @@ bool Integrator::modified(const Integrator& integrator)
subsurface_samples == integrator.subsurface_samples &&
volume_samples == integrator.volume_samples &&
motion_blur == integrator.motion_blur &&
sampling_pattern == integrator.sampling_pattern);
sampling_pattern == integrator.sampling_pattern &&
sample_all_lights_indirect == integrator.sample_all_lights_indirect);
}
void Integrator::tag_update(Scene *scene)