diff options
author | Thomas Dinges <blender@dingto.org> | 2013-07-20 02:51:48 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-07-20 02:51:48 +0400 |
commit | d336ae8992435a000e5dfe8d6d24a0cf13a5c40a (patch) | |
tree | 03cdf0837908fd39d459b7b3377fe22b27e6e995 /intern/cycles/blender/blender_object.cpp | |
parent | 3cd53aff090b14cd050c931badf8856e903aad01 (diff) |
Cycles / Sampling UI:
* Add a "Squared Samples" option to the UI, to use squared values for ease of use. This can make it easier from an artist point of view, to weak settings.
With this enabled, all Sample values will be squared. So 10 Samples become 100 Samples.
For the Non-Progressive integrator: 4 AA Samples * 5 Diffuse Samples would become 16 AA Samples * 25 Diffuse = 400 in total.
Patch by Matt Heimlich, with some minor edits by myself. Thanks!
Diffstat (limited to 'intern/cycles/blender/blender_object.cpp')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index d1e3d64d572..b2235c36af0 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -154,10 +154,16 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI 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"); - light->samples = get_int(clamp, "samples"); + + int samples = get_int(clamp, "samples"); + if(get_boolean(cscene, "squared_samples")) + light->samples = samples * samples; + else + light->samples = samples; /* visibility */ uint visibility = object_ray_visibility(b_ob); @@ -174,6 +180,7 @@ void BlenderSync::sync_background_light() 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"); @@ -188,8 +195,13 @@ void BlenderSync::sync_background_light() { light->type = LIGHT_BACKGROUND; light->map_resolution = get_int(cworld, "sample_map_resolution"); - light->samples = get_int(cworld, "samples"); light->shader = scene->default_background; + + int samples = get_int(cworld, "samples"); + if(get_boolean(cscene, "squared_samples")) + light->samples = samples * samples; + else + light->samples = samples; light->tag_update(scene); light_map.set_recalc(b_world); |