[Bf-blender-cvs] [d55e3733e8a] soc-2022-many-lights-sampling: Cleanup: remove unused shadow pass code
Brecht Van Lommel
noreply at git.blender.org
Fri Dec 2 19:47:10 CET 2022
Commit: d55e3733e8a64529edf9c9e2648d71e00571d1dd
Author: Brecht Van Lommel
Date: Fri Dec 2 15:29:21 2022 +0100
Branches: soc-2022-many-lights-sampling
https://developer.blender.org/rBd55e3733e8a64529edf9c9e2648d71e00571d1dd
Cleanup: remove unused shadow pass code
===================================================================
M intern/cycles/kernel/data_template.h
M intern/cycles/scene/light.cpp
===================================================================
diff --git a/intern/cycles/kernel/data_template.h b/intern/cycles/kernel/data_template.h
index 5f420b3579d..06df7fe1e62 100644
--- a/intern/cycles/kernel/data_template.h
+++ b/intern/cycles/kernel/data_template.h
@@ -97,7 +97,6 @@ KERNEL_STRUCT_MEMBER(film, int, pass_emission)
KERNEL_STRUCT_MEMBER(film, int, pass_background)
KERNEL_STRUCT_MEMBER(film, int, pass_ao)
KERNEL_STRUCT_MEMBER(film, float, pass_alpha_threshold)
-KERNEL_STRUCT_MEMBER(film, float, pass_shadow_scale)
KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher)
KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_sample_count)
KERNEL_STRUCT_MEMBER(film, int, pass_shadow_catcher_matte)
@@ -131,10 +130,6 @@ KERNEL_STRUCT_MEMBER(film, int, use_approximate_shadow_catcher)
KERNEL_STRUCT_MEMBER(film, int, pass_guiding_color)
KERNEL_STRUCT_MEMBER(film, int, pass_guiding_probability)
KERNEL_STRUCT_MEMBER(film, int, pass_guiding_avg_roughness)
-/* Padding. */
-KERNEL_STRUCT_MEMBER(film, int, pad1)
-KERNEL_STRUCT_MEMBER(film, int, pad2)
-KERNEL_STRUCT_MEMBER(film, int, pad3)
KERNEL_STRUCT_END(KernelFilm)
/* Integrator. */
diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp
index b78863e3f6e..b18cd63a0ee 100644
--- a/intern/cycles/scene/light.cpp
+++ b/intern/cycles/scene/light.cpp
@@ -266,13 +266,12 @@ bool LightManager::object_usable_as_light(Object *object)
return false;
}
-void LightManager::device_update_distribution(Device *device,
+void LightManager::device_update_distribution(Device *,
DeviceScene *dscene,
Scene *scene,
Progress &progress)
{
KernelIntegrator *kintegrator = &dscene->data.integrator;
- KernelFilm *kfilm = &dscene->data.film;
/* Update CDF over lights. */
progress.set_status("Updating Lights", "Computing distribution");
@@ -305,7 +304,6 @@ void LightManager::device_update_distribution(Device *device,
}
const size_t num_lights = kintegrator->num_lights;
- const size_t num_background_lights = kintegrator->num_background_lights;
const size_t num_distribution = num_triangles + num_lights;
/* Distribution size. */
@@ -454,18 +452,6 @@ void LightManager::device_update_distribution(Device *device,
}
}
- /* bit of an ugly hack to compensate for emitting triangles influencing
- * amount of samples we get for this pass */
- kfilm->pass_shadow_scale = 1.0f;
-
- if (kintegrator->distribution_pdf_triangles != 0.0f) {
- kfilm->pass_shadow_scale /= 0.5f;
- }
-
- if (num_background_lights < num_lights) {
- kfilm->pass_shadow_scale /= (float)(num_lights - num_background_lights) / (float)num_lights;
- }
-
/* Copy distribution to device. */
dscene->light_distribution.copy_to_device();
}
@@ -476,7 +462,6 @@ void LightManager::device_update_tree(Device *device,
Progress &progress)
{
KernelIntegrator *kintegrator = &dscene->data.integrator;
- KernelFilm *kfilm = &dscene->data.film;
if (!kintegrator->use_light_tree) {
dscene->light_tree_nodes.free();
@@ -556,9 +541,6 @@ void LightManager::device_update_tree(Device *device,
/* Update integrator state. */
kintegrator->use_direct_light = !light_prims.empty();
- /* TODO: this shadow scale mechanism does not work for light tree. */
- kfilm->pass_shadow_scale = 1.0f;
-
/* TODO: For now, we'll start with a smaller number of max lights in a node.
* More benchmarking is needed to determine what number works best. */
LightTree light_tree(light_prims, kintegrator->num_distant_lights, 8);
More information about the Bf-blender-cvs
mailing list