diff options
author | Thomas Dinges <blender@dingto.org> | 2013-08-22 23:57:56 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-08-22 23:57:56 +0400 |
commit | fc9d4bdf733b101755a28672c22e5dbb021ae4b8 (patch) | |
tree | 9074b42ef3a17eccaca9ac66aa52eb811ccc7abd /intern/cycles/blender | |
parent | da7af1e2719e9813ff1131b84dd268c13b07c8c1 (diff) |
Cycles / Sampling UI:
* Add a "Total Samples" info at the bottom of the panel.
This makes understanding the Non-Progressive integrator easier, as it displays how many samples are used for the different ray types.
* Rename Squared Samples to Square samples, to indicate that the action is not already done. The new Total Samples info should make this easier to understand now as well. Also added back for Progressive integrator, for consistency.
Screenshot:
http://www.pasteall.org/pic/show.php?id=57980
Diffstat (limited to 'intern/cycles/blender')
-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 |
5 files changed, 52 insertions, 13 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) { |