diff options
-rw-r--r-- | intern/cycles/blender/addon/presets.py | 2 | ||||
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 4 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 45 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 10 | ||||
-rw-r--r-- | release/scripts/presets/cycles/sampling/final.py | 8 | ||||
-rw-r--r-- | release/scripts/presets/cycles/sampling/preview.py | 8 |
7 files changed, 60 insertions, 21 deletions
diff --git a/intern/cycles/blender/addon/presets.py b/intern/cycles/blender/addon/presets.py index 9be01c209a9..66ec3a3a47a 100644 --- a/intern/cycles/blender/addon/presets.py +++ b/intern/cycles/blender/addon/presets.py @@ -67,7 +67,7 @@ class AddPresetSampling(AddPresetBase, Operator): "cycles.subsurface_samples", "cycles.no_caustics", "cycles.blur_glossy", - "cycles.squared_samples", + "cycles.use_square_samples", "cycles.progressive" ] diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 5476f1b39e5..41fb9afbc4e 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -128,8 +128,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): description="Use progressive sampling of lighting", default=True, ) - cls.squared_samples = BoolProperty( - name="Squared Samples", + cls.use_square_samples = BoolProperty( + name="Square Samples", description="Square sampling values for easier artist control", default=False, ) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 533d79d520d..267bb680823 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -48,6 +48,43 @@ class CyclesButtonsPanel(): return rd.engine == 'CYCLES' +def draw_samples_info(layout, cscene): + # Calculate sample values + if cscene.progressive: + aa = cscene.samples + if cscene.use_square_samples: + aa = aa*aa + else: + aa = cscene.aa_samples + d = cscene.diffuse_samples + g = cscene.glossy_samples + t = cscene.transmission_samples + ao = cscene.ao_samples + ml = cscene.mesh_light_samples + sss = cscene.subsurface_samples + + if cscene.use_square_samples: + aa = aa*aa + d = d*d + g = g*g + t = t*t + ao = ao*ao + ml = ml*ml + sss = sss*sss + + # Draw interface + col = layout.column(align=True) + col.scale_y = 0.6 + col.label("Total Samples:") + col.separator() + if cscene.progressive: + col.label("%s AA" % aa) + else: + col.label("%s AA, %s Diffuse, %s Glossy, %s Transmission" % (aa, d*aa, g*aa, t*aa)) + col.separator() + col.label("%s AO, %s Mesh Light, %s Subsurface" % (ao*aa, ml*aa, sss*aa)) + + class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): bl_label = "Sampling" bl_options = {'DEFAULT_CLOSED'} @@ -63,12 +100,10 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label) row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN") row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True - + row = layout.row() row.prop(cscene, "progressive") - - if not cscene.progressive: - row.prop(cscene, "squared_samples") + row.prop(cscene, "use_square_samples") split = layout.split() @@ -107,6 +142,8 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): layout.separator() layout.row().prop(cscene, "use_layer_samples") break + + draw_samples_info(layout, cscene) class CyclesRender_PT_light_paths(CyclesButtonsPanel, Panel): diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index b80ab7f8d94..461e897efe1 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -158,7 +158,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling"); int samples = get_int(clamp, "samples"); - if(get_boolean(cscene, "squared_samples")) + if(get_boolean(cscene, "use_square_samples")) light->samples = samples * samples; else light->samples = samples; @@ -196,7 +196,7 @@ void BlenderSync::sync_background_light() light->shader = scene->default_background; int samples = get_int(cworld, "samples"); - if(get_boolean(cscene, "squared_samples")) + if(get_boolean(cscene, "use_square_samples")) light->samples = samples * samples; else light->samples = samples; diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 8ba2e3fa11a..15bce22f1a0 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -198,7 +198,7 @@ void BlenderSync::sync_integrator() int mesh_light_samples = get_int(cscene, "mesh_light_samples"); int subsurface_samples = get_int(cscene, "subsurface_samples"); - if(get_boolean(cscene, "squared_samples")) { + if(get_boolean(cscene, "use_square_samples")) { integrator->diffuse_samples = diffuse_samples * diffuse_samples; integrator->glossy_samples = glossy_samples * glossy_samples; integrator->transmission_samples = transmission_samples * transmission_samples; @@ -319,7 +319,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer) render_layer.bound_samples = (use_layer_samples == 1); if(use_layer_samples != 2) { int samples = b_rlay->samples(); - if(get_boolean(cscene, "squared_samples") && !(get_boolean(cscene, "progressive"))) + if(get_boolean(cscene, "use_square_samples")) render_layer.samples = samples * samples; else render_layer.samples = samples; @@ -412,10 +412,12 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use int preview_samples = get_int(cscene, "preview_samples"); int preview_aa_samples = get_int(cscene, "preview_aa_samples"); - /* Squared samples for Non-Progressive only */ - if(get_boolean(cscene, "squared_samples")) { + if(get_boolean(cscene, "use_square_samples")) { aa_samples = aa_samples * aa_samples; preview_aa_samples = preview_aa_samples * preview_aa_samples; + + samples = samples * samples; + preview_samples = preview_samples * preview_samples; } if(get_boolean(cscene, "progressive") == 0) { diff --git a/release/scripts/presets/cycles/sampling/final.py b/release/scripts/presets/cycles/sampling/final.py index a76fa352178..2ee429188be 100644 --- a/release/scripts/presets/cycles/sampling/final.py +++ b/release/scripts/presets/cycles/sampling/final.py @@ -1,13 +1,13 @@ import bpy cycles = bpy.context.scene.cycles -cycles.squared_samples = True +cycles.use_square_samples = True # Progressive -cycles.samples = 500 -cycles.preview_samples = 100 +cycles.samples = 24 +cycles.preview_samples = 12 -# Non-Progressive (squared) +# Non-Progressive cycles.aa_samples = 8 cycles.preview_aa_samples = 4 diff --git a/release/scripts/presets/cycles/sampling/preview.py b/release/scripts/presets/cycles/sampling/preview.py index 3f565ccff8c..c7af6c83777 100644 --- a/release/scripts/presets/cycles/sampling/preview.py +++ b/release/scripts/presets/cycles/sampling/preview.py @@ -1,13 +1,13 @@ import bpy cycles = bpy.context.scene.cycles -cycles.squared_samples = True +cycles.use_square_samples = True # Progressive -cycles.samples = 100 -cycles.preview_samples = 10 +cycles.samples = 12 +cycles.preview_samples = 6 -# Non-Progressive (squared) +# Non-Progressive cycles.aa_samples = 4 cycles.preview_aa_samples = 2 |