diff options
author | Thomas Dinges <blender@dingto.org> | 2015-05-15 14:49:17 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-05-15 14:54:59 +0300 |
commit | 7c06190882a1fa985d6e6998daa2db1f7577aed4 (patch) | |
tree | 81b85ce4fda5ebc9bcba9bcb93fffa5f34111029 /intern/cycles | |
parent | e4c93dc7db9b50acf898b667c95b208856b80ea8 (diff) |
Cycles: Make animated seed a builtin feature.
For animations, you often want an animated render seed (noise pattern).
This could be done by e.g. setting a driver on the seed value.
Now it's a little checkbox, that can be enabled.
The animated seed is based on the current Blender frame and
the seed value itself. Simply enabling it, will already result in an animated
seed (different on each Blender frame), but it can be randomized further
by setting a different seed value.
Disabled per default, so no backward compatibility break.
Differential Revision: https://developer.blender.org/D1285
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 6 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 6 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 538876a71e2..16a807b3af5 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -394,6 +394,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default=0, ) + cls.use_animated_seed = BoolProperty( + name="Use Animated Seed", + description="Use different seed values (and hence noise patterns) at different frames", + default=False, + ) + cls.sample_clamp_direct = FloatProperty( name="Clamp Direct", description="If non-zero, the maximum value for a direct sample, " diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index d24099b92a5..545d0b6c26c 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -135,7 +135,11 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): col = split.column() sub = col.column(align=True) sub.label("Settings:") - sub.prop(cscene, "seed") + + seed_sub = sub.row(align=True) + seed_sub.prop(cscene, "seed") + seed_sub.prop(cscene, "use_animated_seed", text="", icon="TIME") + sub.prop(cscene, "sample_clamp_direct") sub.prop(cscene, "sample_clamp_indirect") diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 266e170fa8f..c5fb7925306 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -36,6 +36,7 @@ #include "util_debug.h" #include "util_foreach.h" #include "util_opengl.h" +#include "util_hash.h" CCL_NAMESPACE_BEGIN @@ -195,6 +196,9 @@ void BlenderSync::sync_integrator() integrator->filter_glossy = get_float(cscene, "blur_glossy"); integrator->seed = get_int(cscene, "seed"); + if(get_boolean(cscene, "use_animated_seed")) + integrator->seed = hash_int_2d(b_scene.frame_current(), get_int(cscene, "seed")); + integrator->sampling_pattern = (SamplingPattern)RNA_enum_get(&cscene, "sampling_pattern"); integrator->layer_flag = render_layer.layer; |