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
This commit is contained in:
@@ -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, "
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user