diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/presets.py | 1 | ||||
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 6 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 16 | ||||
-rw-r--r-- | intern/cycles/blender/addon/version_update.py | 20 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 14 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 47 |
6 files changed, 32 insertions, 72 deletions
diff --git a/intern/cycles/blender/addon/presets.py b/intern/cycles/blender/addon/presets.py index 17efb00abdb..dd4e8e60a42 100644 --- a/intern/cycles/blender/addon/presets.py +++ b/intern/cycles/blender/addon/presets.py @@ -67,7 +67,6 @@ class AddPresetSampling(AddPresetBase, Operator): "cycles.mesh_light_samples", "cycles.subsurface_samples", "cycles.volume_samples", - "cycles.use_square_samples", "cycles.progressive", "cycles.seed", "cycles.sample_clamp_direct", diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 7b16ef1d543..cb95bfb5b2a 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -172,12 +172,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default='PATH', ) - cls.use_square_samples = BoolProperty( - name="Square Samples", - description="Square sampling values for easier artist control", - default=False, - ) - cls.samples = IntProperty( name="Samples", description="Number of samples to render for each pixel", diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index b9565aa4c7f..debc8e76e54 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -100,8 +100,6 @@ def draw_samples_info(layout, context): # Calculate sample values if integrator == 'PATH': aa = cscene.samples - if cscene.use_square_samples: - aa = aa * aa else: aa = cscene.aa_samples d = cscene.diffuse_samples @@ -112,19 +110,9 @@ def draw_samples_info(layout, context): sss = cscene.subsurface_samples vol = cscene.volume_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 - vol = vol * vol - # Draw interface # Do not draw for progressive, when Square Samples are disabled - if use_branched_path(context) or (cscene.use_square_samples and integrator == 'PATH'): + if use_branched_path(context): col = layout.column(align=True) col.scale_y = 0.6 col.label("Total Samples:") @@ -157,7 +145,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): row = layout.row() sub = row.row() sub.prop(cscene, "progressive", text="") - row.prop(cscene, "use_square_samples") + sub.label() split = layout.split() diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index efd794461d6..a37ac38c101 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -315,3 +315,23 @@ def do_versions(self): cscene.blur_glossy = 0.0 if not cscene.is_property_set("sample_clamp_indirect"): cscene.sample_clamp_indirect = 0.0 + + # Remove and apply square samples + use_square_samples = cscene.get("use_square_samples", False) + if use_square_samples: + del cscene["use_square_samples"] + + cscene.samples *= cscene.samples + cscene.preview_samples *= cscene.preview_samples + cscene.aa_samples *= cscene.aa_samples + cscene.preview_aa_samples *= cscene.preview_aa_samples + cscene.diffuse_samples *= cscene.diffuse_samples + cscene.glossy_samples *= cscene.glossy_samples + cscene.transmission_samples *= cscene.transmission_samples + cscene.ao_samples *= cscene.ao_samples + cscene.mesh_light_samples *= cscene.mesh_light_samples + cscene.subsurface_samples *= cscene.subsurface_samples + cscene.volume_samples *= cscene.volume_samples + + for layer in scene.render.layers: + layer.samples *= layer.samples diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index a930c439370..82623d538b2 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -162,16 +162,11 @@ void BlenderSync::sync_light(BL::Object& b_parent, light->shader = used_shaders[0]; /* shadow */ - PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles"); light->cast_shadow = get_boolean(clamp, "cast_shadow"); light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling"); - int samples = get_int(clamp, "samples"); - if(get_boolean(cscene, "use_square_samples")) - light->samples = samples * samples; - else - light->samples = samples; + light->samples = get_int(clamp, "samples"); light->max_bounces = get_int(clamp, "max_bounces"); @@ -199,7 +194,6 @@ void BlenderSync::sync_background_light(bool use_portal) BL::World b_world = b_scene.world(); if(b_world) { - PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles"); bool sample_as_light = get_boolean(cworld, "sample_as_light"); @@ -218,11 +212,7 @@ void BlenderSync::sync_background_light(bool use_portal) light->use_mis = sample_as_light; light->max_bounces = get_int(cworld, "max_bounces"); - int samples = get_int(cworld, "samples"); - if(get_boolean(cscene, "use_square_samples")) - light->samples = samples * samples; - else - light->samples = samples; + light->samples = get_int(cworld, "samples"); light->tag_update(scene); light_map.set_recalc(b_world); diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index e953c685b56..f5e8d0633bc 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -291,32 +291,13 @@ void BlenderSync::sync_integrator() integrator->sample_all_lights_indirect = get_boolean(cscene, "sample_all_lights_indirect"); integrator->light_sampling_threshold = get_float(cscene, "light_sampling_threshold"); - int diffuse_samples = get_int(cscene, "diffuse_samples"); - int glossy_samples = get_int(cscene, "glossy_samples"); - int transmission_samples = get_int(cscene, "transmission_samples"); - int ao_samples = get_int(cscene, "ao_samples"); - int mesh_light_samples = get_int(cscene, "mesh_light_samples"); - int subsurface_samples = get_int(cscene, "subsurface_samples"); - int volume_samples = get_int(cscene, "volume_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; - integrator->ao_samples = ao_samples * ao_samples; - integrator->mesh_light_samples = mesh_light_samples * mesh_light_samples; - integrator->subsurface_samples = subsurface_samples * subsurface_samples; - integrator->volume_samples = volume_samples * volume_samples; - } - else { - integrator->diffuse_samples = diffuse_samples; - integrator->glossy_samples = glossy_samples; - integrator->transmission_samples = transmission_samples; - integrator->ao_samples = ao_samples; - integrator->mesh_light_samples = mesh_light_samples; - integrator->subsurface_samples = subsurface_samples; - integrator->volume_samples = volume_samples; - } + integrator->diffuse_samples = get_int(cscene, "diffuse_samples"); + integrator->glossy_samples = get_int(cscene, "glossy_samples"); + integrator->transmission_samples = get_int(cscene, "transmission_samples"); + integrator->ao_samples = get_int(cscene, "ao_samples"); + integrator->mesh_light_samples = get_int(cscene, "mesh_light_samples"); + integrator->subsurface_samples = get_int(cscene, "subsurface_samples"); + integrator->volume_samples = get_int(cscene, "volume_samples"); if(b_scene.render().use_simplify()) { if(preview) { @@ -434,11 +415,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, "use_square_samples")) - render_layer.samples = samples * samples; - else - render_layer.samples = samples; + render_layer.samples = b_rlay->samples(); } } @@ -753,14 +730,6 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine, int preview_samples = get_int(cscene, "preview_samples"); int preview_aa_samples = get_int(cscene, "preview_aa_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_enum(cscene, "progressive") == 0) { if(background) { params.samples = aa_samples; |