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-06-07 20:47:14 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-06-14 15:49:56 +0400
commit5fa68133c986be521e06b1f2558a33e56d27b98b (patch)
tree9310d597d7b3f07dd0c4842e971564ef738d75c0 /intern/cycles/render
parenta29807cd63b0cba62e664c54ce34e5717ca51a3e (diff)
Cycles: volume sampling method can now be set per material/world.
This gives you "Multiple Importance", "Distance" and "Equiangular" choices. What multiple importance sampling does is make things more robust to certain types of noise at the cost of a bit more noise in cases where the individual strategies are always better. So if you've got a pretty dense volume that's lit from far away then distance sampling is usually more efficient. If you've got a light inside or near the volume then equiangular sampling is better. If you have a combination of both, then the multiple importance sampling will be better.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/integrator.cpp5
-rw-r--r--intern/cycles/render/shader.cpp5
-rw-r--r--intern/cycles/render/shader.h1
3 files changed, 6 insertions, 5 deletions
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index ee3419b055c..4a8b490b1ad 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -101,11 +101,6 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
if(!transparent_shadows)
kintegrator->transparent_shadows = false;
- 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;
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 0f9a5a5d39d..662caed72f1 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -44,6 +44,7 @@ Shader::Shader()
use_mis = true;
use_transparent_shadow = true;
heterogeneous_volume = true;
+ volume_sampling_method = 0;
has_surface = false;
has_surface_transparent = false;
@@ -257,6 +258,10 @@ void ShaderManager::device_update_common(Device *device, DeviceScene *dscene, Sc
flag |= SD_HAS_BSSRDF_BUMP;
if(shader->has_converter_blackbody)
has_converter_blackbody = true;
+ if(shader->volume_sampling_method == 1)
+ flag |= SD_VOLUME_EQUIANGULAR;
+ if(shader->volume_sampling_method == 2)
+ flag |= SD_VOLUME_MIS;
/* regular shader */
shader_flag[i++] = flag;
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index dc18b385cc3..84be4b469d8 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -68,6 +68,7 @@ public:
bool use_mis;
bool use_transparent_shadow;
bool heterogeneous_volume;
+ int volume_sampling_method;
/* synchronization */
bool need_update;