Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-03-15 20:36:44 +0400
committerThomas Dinges <blender@dingto.org>2014-03-15 20:37:43 +0400
commit211f08d89bb48312a426fe969e0d967cf637b66c (patch)
tree92a33cfdb418e23c39f1d90eff61b24640ff4616 /intern/cycles
parentcb4c49ad973f7e31204f282e3da18af74dab5a7c (diff)
Cycles: Direct multi light sampling in the Branched Path Integrator is optional now.
Disabling this can improve performance, when we need a lot of AA Samples anyway, to clear up the render. Simple example .blend: http://www.pasteall.org/blend/27582 Differential Revision: https://developer.blender.org/D392
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/blender/addon/properties.py11
-rw-r--r--intern/cycles/blender/addon/ui.py1
-rw-r--r--intern/cycles/blender/blender_sync.cpp3
-rw-r--r--intern/cycles/kernel/kernel_path.h3
-rw-r--r--intern/cycles/kernel/kernel_types.h4
-rw-r--r--intern/cycles/render/integrator.cpp2
-rw-r--r--intern/cycles/render/integrator.h1
7 files changed, 19 insertions, 6 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 875f9d36d63..1d568247327 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -252,10 +252,17 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
items=enum_use_layer_samples,
default='USE',
)
+
+ cls.sample_all_lights_direct = BoolProperty(
+ name="Sample All Direct Lights",
+ description="Sample all lights (for direct samples), rather than randomly picking one",
+ default=True,
+ )
+
cls.sample_all_lights_indirect = BoolProperty(
- name="Sample All Lights",
+ name="Sample All Indirect Lights",
description="Sample all lights (for indirect samples), rather than randomly picking one",
- default=False,
+ default=True,
)
cls.no_caustics = BoolProperty(
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 7f0a22d2af5..70368c25435 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -134,6 +134,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
sub.prop(cscene, "aa_samples", text="Render")
sub.prop(cscene, "preview_aa_samples", text="Preview")
sub.separator()
+ sub.prop(cscene, "sample_all_lights_direct")
sub.prop(cscene, "sample_all_lights_indirect")
col = split.column()
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 202eff48d53..1f5e32a1123 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -197,7 +197,8 @@ void BlenderSync::sync_integrator()
#endif
integrator->method = (Integrator::Method)get_enum(cscene, "progressive");
-
+
+ integrator->sample_all_lights_direct = get_boolean(cscene, "sample_all_lights_direct");
integrator->sample_all_lights_indirect = get_boolean(cscene, "sample_all_lights_indirect");
int diffuse_samples = get_int(cscene, "diffuse_samples");
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 000b241f544..81b61a54a6a 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -957,7 +957,8 @@ ccl_device_noinline void kernel_branched_path_integrate_lighting(KernelGlobals *
PathState *state, PathRadiance *L, ccl_global float *buffer)
{
#ifdef __EMISSION__
- kernel_branched_path_integrate_direct_lighting(kg, rng, sd, state, throughput, num_samples_adjust, L, true);
+ bool all = kernel_data.integrator.sample_all_lights_direct;
+ kernel_branched_path_integrate_direct_lighting(kg, rng, sd, state, throughput, num_samples_adjust, L, all);
#endif
for(int i = 0; i< sd->num_closure; i++) {
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 551c2dd596e..512e7ab15b3 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -836,8 +836,9 @@ typedef struct KernelIntegrator {
int ao_samples;
int mesh_light_samples;
int subsurface_samples;
+ int sample_all_lights_direct;
int sample_all_lights_indirect;
-
+
/* mis */
int use_lamp_mis;
@@ -850,7 +851,6 @@ typedef struct KernelIntegrator {
int volume_max_steps;
float volume_step_size;
int volume_samples;
- int pad1;
} KernelIntegrator;
typedef struct KernelBVH {
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index 849157d9e91..c81e7e3bbd7 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -130,6 +130,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
kintegrator->mesh_light_samples = mesh_light_samples;
kintegrator->subsurface_samples = subsurface_samples;
kintegrator->volume_samples = volume_samples;
+ kintegrator->sample_all_lights_direct = sample_all_lights_direct;
kintegrator->sample_all_lights_indirect = sample_all_lights_indirect;
kintegrator->sampling_pattern = sampling_pattern;
@@ -199,6 +200,7 @@ bool Integrator::modified(const Integrator& integrator)
volume_samples == integrator.volume_samples &&
motion_blur == integrator.motion_blur &&
sampling_pattern == integrator.sampling_pattern &&
+ sample_all_lights_direct == integrator.sample_all_lights_direct &&
sample_all_lights_indirect == integrator.sample_all_lights_indirect);
}
diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h
index 587968dc1e4..2570b13808c 100644
--- a/intern/cycles/render/integrator.h
+++ b/intern/cycles/render/integrator.h
@@ -63,6 +63,7 @@ public:
int mesh_light_samples;
int subsurface_samples;
int volume_samples;
+ bool sample_all_lights_direct;
bool sample_all_lights_indirect;
enum Method {