[Bf-blender-cvs] [3b49ca465f7] soc-2020-production-ready-light-tree-2: Finished bringing light tree code up to date
Sam Kottler
noreply at git.blender.org
Mon Aug 17 14:12:21 CEST 2020
Commit: 3b49ca465f708270b69647dc7425958d9e5793c2
Author: Sam Kottler
Date: Thu Aug 13 15:17:04 2020 -0500
Branches: soc-2020-production-ready-light-tree-2
https://developer.blender.org/rB3b49ca465f708270b69647dc7425958d9e5793c2
Finished bringing light tree code up to date
===================================================================
M intern/cycles/blender/addon/properties.py
M intern/cycles/blender/addon/ui.py
M intern/cycles/blender/blender_sync.cpp
M intern/cycles/kernel/kernel_bake.h
M intern/cycles/kernel/kernel_emission.h
M intern/cycles/kernel/kernel_path.h
M intern/cycles/kernel/kernel_path_branched.h
M intern/cycles/kernel/kernel_path_surface.h
M intern/cycles/kernel/split/kernel_direct_lighting.h
M intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h
M intern/cycles/render/light.cpp
M intern/cycles/render/mesh_volume.cpp
M release/datafiles/locale
M release/scripts/addons
M release/scripts/addons_contrib
M source/blender/python/mathutils/mathutils_bvhtree.c
M source/tools
===================================================================
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 7e9338ab421..337329bfad2 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -297,7 +297,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
default=False,
)
- splitting_threshold = FloatProperty(
+ splitting_threshold: FloatProperty(
name="Splitting",
description="Amount of lights to sample at a time, from one light at 0.0, to adaptively more lights as needed, to all lights at 1.0",
min=0.0, max=1.0,
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 39cb1477c33..2dfa50a9aa3 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -326,13 +326,34 @@ class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
layout.row().prop(cscene, "use_layer_samples")
break
+class CYCLES_RENDER_PT_sampling_light_tree(CyclesButtonsPanel, Panel):
+ bl_label = "Light Tree"
+ bl_parent_id = "CYCLES_RENDER_PT_sampling"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ return (context.scene.cycles.feature_set == 'EXPERIMENTAL')
+
+ def draw_header(self, context):
+ layout = self.layout
+ scene = context.scene
+ cscene = scene.cycles
+
+ layout.prop(cscene, "use_light_tree", text="")
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ scene = context.scene
+ cscene = scene.cycles
+
+ layout.active = cscene.use_light_tree
row = layout.row(align=True)
- row.label(text="Experimental:")
- row.prop(cscene, "use_light_tree", text="Light Tree")
- if cscene.use_light_tree and use_branched_path(context):
- row = layout.row(align=True)
- row.label(text="") # create empty column
- row.prop(cscene, "splitting_threshold", text="Splitting")
+ row.label(text="") # create empty column
+ row.prop(cscene, "splitting_threshold", text="Splitting")
class CYCLES_RENDER_PT_sampling_total(CyclesButtonsPanel, Panel):
@@ -2280,6 +2301,7 @@ classes = (
CYCLES_RENDER_PT_sampling_adaptive,
CYCLES_RENDER_PT_sampling_denoising,
CYCLES_RENDER_PT_sampling_advanced,
+ CYCLES_RENDER_PT_sampling_light_tree,
CYCLES_RENDER_PT_light_paths,
CYCLES_RENDER_PT_light_paths_max_bounces,
CYCLES_RENDER_PT_light_paths_clamping,
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index f806569c389..7d0c188c5c3 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -305,12 +305,7 @@ void BlenderSync::sync_integrator()
cscene, "progressive", Integrator::NUM_METHODS, Integrator::PATH);
integrator->use_light_tree = get_boolean(cscene, "use_light_tree");
- if (get_enum(cscene, "progressive") == 0) {
- integrator->splitting_threshold = get_float(cscene, "splitting_threshold");
- }
- else { // Not using branched path tracing
- integrator->splitting_threshold = 0.0f;
- }
+ integrator->splitting_threshold = get_float(cscene, "splitting_threshold");
integrator->sample_all_lights_direct = get_boolean(cscene, "sample_all_lights_direct");
integrator->sample_all_lights_indirect = get_boolean(cscene, "sample_all_lights_indirect");
integrator->light_sampling_threshold = get_float(cscene, "light_sampling_threshold");
diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h
index 3e861be5b6c..4bd6fa84c3a 100644
--- a/intern/cycles/kernel/kernel_bake.h
+++ b/intern/cycles/kernel/kernel_bake.h
@@ -64,9 +64,8 @@ ccl_device_noinline void compute_light_pass(
/* sample emission */
if ((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) {
- bool is_volume_boundary = (state.volume_bounce > 0) || (state.volume_bounds_bounce > 0);
float3 emission = indirect_primitive_emission(
- kg, sd, 0.0f, sd->P_pick, sd->N_pick, state.flag, state.ray_pdf, is_volume_boundary);
+ kg, sd, 0.0f, sd->P_pick, sd->N_pick, state.flag, state.ray_pdf);
path_radiance_accum_emission(kg, L, &state, throughput, emission);
}
@@ -83,9 +82,9 @@ ccl_device_noinline void compute_light_pass(
kg, sd, emission_sd, L, &state, &ray, &throughput, &ss_indirect)) {
while (ss_indirect.num_rays) {
kernel_path_subsurface_setup_indirect(kg, &ss_indirect, &state, &ray, L, &throughput);
- kernel_path_indirect(kg, &indirect_sd, emission_sd, &ray, throughput, &state, L);
indirect_sd.P_pick = sd->P_pick;
indirect_sd.N_pick = sd->N_pick;
+ indirect_sd.t_pick = sd->t_pick;
kernel_path_indirect(kg, &indirect_sd, emission_sd, &ray, throughput, &state, L);
}
is_sss_sample = true;
@@ -104,6 +103,7 @@ ccl_device_noinline void compute_light_pass(
/* compute indirect light */
indirect_sd.P_pick = sd->P_pick;
indirect_sd.N_pick = sd->N_pick;
+ indirect_sd.t_pick = sd->t_pick;
kernel_path_indirect(kg, &indirect_sd, emission_sd, &ray, throughput, &state, L);
/* sum and reset indirect light pass variables for the next samples */
@@ -123,9 +123,8 @@ ccl_device_noinline void compute_light_pass(
/* sample emission */
if ((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) {
- bool is_volume_boundary = (state.volume_bounce > 0) || (state.volume_bounds_bounce > 0);
float3 emission = indirect_primitive_emission(
- kg, sd, 0.0f, sd->P_pick, sd->N_pick, state.flag, state.ray_pdf, is_volume_boundary);
+ kg, sd, 0.0f, sd->P_pick, sd->N_pick, state.flag, state.ray_pdf);
path_radiance_accum_emission(kg, L, &state, throughput, emission);
}
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h
index 47a6dfa1e1d..2a864ab24d0 100644
--- a/intern/cycles/kernel/kernel_emission.h
+++ b/intern/cycles/kernel/kernel_emission.h
@@ -206,14 +206,8 @@ ccl_device_noinline_cpu bool direct_emission(KernelGlobals *kg,
/* Indirect Primitive Emission */
-ccl_device_noinline_cpu float3 indirect_primitive_emission(KernelGlobals *kg,
- ShaderData *sd,
- float t,
- float3 P,
- float3 N,
- int path_flag,
- float bsdf_pdf,
- bool has_volume)
+ccl_device_noinline_cpu float3 indirect_primitive_emission(
+ KernelGlobals *kg, ShaderData *sd, float t, float3 P, float3 N, int path_flag, float bsdf_pdf)
{
/* evaluate emissive closure */
float3 L = shader_emissive_eval(sd);
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 2ba3b1c4fdc..b2f207bc41f 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -264,8 +264,7 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg,
float3 throughput,
ShaderData *emission_sd,
PathRadiance *L,
- ccl_global float *buffer,
- bool has_volume)
+ ccl_global float *buffer)
{
PROFILING_INIT(kg, PROFILING_SHADER_APPLY);
@@ -328,7 +327,7 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg,
float ray_length = state->ray_t + sd->ray_length;
float3 emission = indirect_primitive_emission(
- kg, sd, ray_length, P_pick, N_pick, state->flag, state->ray_pdf, has_volume);
+ kg, sd, ray_length, P_pick, N_pick, state->flag, state->ray_pdf);
path_radiance_accum_emission(kg, L, state, throughput, emission);
}
#endif /* __EMISSION__ */
@@ -442,7 +441,6 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
}
/* Setup shader data. */
- bool has_volume = (sd->flag & SD_HAS_VOLUME) != 0;
shader_setup_from_ray(kg, sd, &isect, ray);
/* Skip most work for volume bounding surface. */
@@ -455,8 +453,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
shader_prepare_closures(sd, state);
/* Apply shadow catcher, holdout, emission. */
- if (!kernel_path_shader_apply(
- kg, sd, state, ray, throughput, emission_sd, L, NULL, has_volume)) {
+ if (!kernel_path_shader_apply(kg, sd, state, ray, throughput, emission_sd, L, NULL)) {
break;
}
@@ -584,7 +581,6 @@ ccl_device_forceinline void kernel_path_integrate(KernelGlobals *kg,
}
/* Setup shader data. */
- bool has_volume = (sd.flag & SD_HAS_VOLUME) != 0;
shader_setup_from_ray(kg, &sd, &isect, ray);
/* Skip most work for volume bounding surface. */
@@ -597,8 +593,7 @@ ccl_device_forceinline void kernel_path_integrate(KernelGlobals *kg,
shader_prepare_closures(&sd, state);
/* Apply shadow catcher, holdout, emission. */
- if (!kernel_path_shader_apply(
- kg, &sd, state, ray, throughput, emission_sd, L, buffer, has_volume)) {
+ if (!kernel_path_shader_apply(kg, &sd, state, ray, throughput, emission_sd, L, buffer)) {
break;
}
diff --git a/intern/cycles/kernel/kernel_path_branched.h b/intern/cycles/kernel/kernel_path_branched.h
index 2f7c3d8ae82..0c1ba658c5e 100644
--- a/intern/cycles/kernel/kernel_path_branched.h
+++ b/intern/cycles/kernel/kernel_path_branched.h
@@ -423,7 +423,6 @@ ccl_
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list