Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-04 18:45:49 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-06-14 15:49:56 +0400
commita29807cd63b0cba62e664c54ce34e5717ca51a3e (patch)
treeac3a32e4393638711686e93879c6c218a17713eb /intern/cycles/render/integrator.cpp
parentd644753319b65a25ae043900cca235070bcdd181 (diff)
Cycles: volume light sampling
* Volume multiple importace sampling support to combine equiangular and distance sampling, for both homogeneous and heterogeneous volumes. * Branched path "Sample All Direct Lights" and "Sample All Indirect Lights" now apply to volumes as well as surfaces. Implementation note: For simplicity this is all done with decoupled ray marching, the only case we do not use decoupled is for distance only sampling with one light sample. The homogeneous case should still compile on the GPU because it only requires fixed size storage, but the heterogeneous case will be trickier to get working.
Diffstat (limited to 'intern/cycles/render/integrator.cpp')
-rw-r--r--intern/cycles/render/integrator.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index 051ba1baf3a..ee3419b055c 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -101,7 +101,11 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
if(!transparent_shadows)
kintegrator->transparent_shadows = false;
- kintegrator->volume_homogeneous_sampling = volume_homogeneous_sampling;
+ if(kintegrator->num_all_lights > 0)
+ kintegrator->volume_homogeneous_sampling = volume_homogeneous_sampling;
+ else
+ kintegrator->volume_homogeneous_sampling = 0;
+
kintegrator->volume_max_steps = volume_max_steps;
kintegrator->volume_step_size = volume_step_size;
@@ -125,8 +129,15 @@ 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_direct = sample_all_lights_direct;
- kintegrator->sample_all_lights_indirect = sample_all_lights_indirect;
+
+ if(method == BRANCHED_PATH) {
+ kintegrator->sample_all_lights_direct = sample_all_lights_direct;
+ kintegrator->sample_all_lights_indirect = sample_all_lights_indirect;
+ }
+ else {
+ kintegrator->sample_all_lights_direct = false;
+ kintegrator->sample_all_lights_indirect = false;
+ }
kintegrator->sampling_pattern = sampling_pattern;
kintegrator->aa_samples = aa_samples;