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:
authorBrecht Van Lommel <brecht@blender.org>2021-11-12 22:04:05 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-12 22:04:05 +0300
commit1b55b911f24e57013167a29f4e01c091020421bc (patch)
tree0659b0983c2ac13a3b14c76ae6b5f9f277828809 /intern/cycles/scene
parentd845ba481c6d2ef50bf87bec834555d5e1faf64c (diff)
parent71131b4969813e037986b4fa91439e8b86059057 (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'intern/cycles/scene')
-rw-r--r--intern/cycles/scene/film.cpp11
-rw-r--r--intern/cycles/scene/integrator.cpp29
-rw-r--r--intern/cycles/scene/integrator.h7
-rw-r--r--intern/cycles/scene/osl.cpp33
4 files changed, 60 insertions, 20 deletions
diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp
index 591f309384e..cdaaea6be2f 100644
--- a/intern/cycles/scene/film.cpp
+++ b/intern/cycles/scene/film.cpp
@@ -187,8 +187,6 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kfilm->pass_transmission_indirect = PASS_UNUSED;
kfilm->pass_volume_direct = PASS_UNUSED;
kfilm->pass_volume_indirect = PASS_UNUSED;
- kfilm->pass_volume_direct = PASS_UNUSED;
- kfilm->pass_volume_indirect = PASS_UNUSED;
kfilm->pass_shadow = PASS_UNUSED;
/* Mark passes as unused so that the kernel knows the pass is inaccessible. */
@@ -673,13 +671,12 @@ uint Film::get_kernel_features(const Scene *scene) const
kernel_features |= KERNEL_FEATURE_DENOISING;
}
- if (pass_type != PASS_NONE && pass_type != PASS_COMBINED &&
- pass_type <= PASS_CATEGORY_LIGHT_END) {
+ if (pass_type >= PASS_DIFFUSE && pass_type <= PASS_VOLUME_INDIRECT) {
kernel_features |= KERNEL_FEATURE_LIGHT_PASSES;
+ }
- if (pass_type == PASS_SHADOW) {
- kernel_features |= KERNEL_FEATURE_SHADOW_PASS;
- }
+ if (pass_type == PASS_SHADOW) {
+ kernel_features |= KERNEL_FEATURE_SHADOW_PASS;
}
if (pass_type == PASS_AO) {
diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp
index e9ff868c3fc..737db8b98d5 100644
--- a/intern/cycles/scene/integrator.cpp
+++ b/intern/cycles/scene/integrator.cpp
@@ -63,6 +63,14 @@ NODE_DEFINE(Integrator)
SOCKET_BOOLEAN(caustics_reflective, "Reflective Caustics", true);
SOCKET_BOOLEAN(caustics_refractive, "Refractive Caustics", true);
SOCKET_FLOAT(filter_glossy, "Filter Glossy", 0.0f);
+
+ SOCKET_BOOLEAN(use_direct_light, "Use Direct Light", true);
+ SOCKET_BOOLEAN(use_indirect_light, "Use Indirect Light", true);
+ SOCKET_BOOLEAN(use_diffuse, "Use Diffuse", true);
+ SOCKET_BOOLEAN(use_glossy, "Use Glossy", true);
+ SOCKET_BOOLEAN(use_transmission, "Use Transmission", true);
+ SOCKET_BOOLEAN(use_emission, "Use Emission", true);
+
SOCKET_INT(seed, "Seed", 0);
SOCKET_FLOAT(sample_clamp_direct, "Sample Clamp Direct", 0.0f);
SOCKET_FLOAT(sample_clamp_indirect, "Sample Clamp Indirect", 0.0f);
@@ -184,6 +192,27 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
kintegrator->caustics_refractive = caustics_refractive;
kintegrator->filter_glossy = (filter_glossy == 0.0f) ? FLT_MAX : 1.0f / filter_glossy;
+ kintegrator->filter_closures = 0;
+ if (!use_direct_light) {
+ kintegrator->filter_closures |= FILTER_CLOSURE_DIRECT_LIGHT;
+ }
+ if (!use_indirect_light) {
+ kintegrator->min_bounce = 1;
+ kintegrator->max_bounce = 1;
+ }
+ if (!use_diffuse) {
+ kintegrator->filter_closures |= FILTER_CLOSURE_DIFFUSE;
+ }
+ if (!use_glossy) {
+ kintegrator->filter_closures |= FILTER_CLOSURE_GLOSSY;
+ }
+ if (!use_transmission) {
+ kintegrator->filter_closures |= FILTER_CLOSURE_TRANSMISSION;
+ }
+ if (!use_emission) {
+ kintegrator->filter_closures |= FILTER_CLOSURE_EMISSION;
+ }
+
kintegrator->seed = seed;
kintegrator->sample_clamp_direct = (sample_clamp_direct == 0.0f) ? FLT_MAX :
diff --git a/intern/cycles/scene/integrator.h b/intern/cycles/scene/integrator.h
index 75764bcdedc..464d96ca01b 100644
--- a/intern/cycles/scene/integrator.h
+++ b/intern/cycles/scene/integrator.h
@@ -56,6 +56,13 @@ class Integrator : public Node {
NODE_SOCKET_API(bool, caustics_refractive)
NODE_SOCKET_API(float, filter_glossy)
+ NODE_SOCKET_API(bool, use_direct_light);
+ NODE_SOCKET_API(bool, use_indirect_light);
+ NODE_SOCKET_API(bool, use_diffuse);
+ NODE_SOCKET_API(bool, use_glossy);
+ NODE_SOCKET_API(bool, use_transmission);
+ NODE_SOCKET_API(bool, use_emission);
+
NODE_SOCKET_API(int, seed)
NODE_SOCKET_API(float, sample_clamp_direct)
diff --git a/intern/cycles/scene/osl.cpp b/intern/cycles/scene/osl.cpp
index c5f38d4f270..0844bff7d4a 100644
--- a/intern/cycles/scene/osl.cpp
+++ b/intern/cycles/scene/osl.cpp
@@ -274,19 +274,26 @@ void OSLShaderManager::shading_system_init()
"diffuse_ancestor", /* PATH_RAY_DIFFUSE_ANCESTOR */
- "__unused__", /* PATH_RAY_SINGLE_PASS_DONE */
- "__unused__", /* PATH_RAY_TRANSPARENT_BACKGROUND */
- "__unused__", /* PATH_RAY_TERMINATE_IMMEDIATE */
- "__unused__", /* PATH_RAY_TERMINATE_AFTER_TRANSPARENT */
- "__unused__", /* PATH_RAY_EMISSION */
- "__unused__", /* PATH_RAY_SUBSURFACE */
- "__unused__", /* PATH_RAY_DENOISING_FEATURES */
- "__unused__", /* PATH_RAY_REFLECT_PASS */
- "__unused__", /* PATH_RAY_TRANSMISSION_PASS */
- "__unused__", /* PATH_RAY_VOLUME_PASS */
- "__unused__", /* PATH_RAY_SHADOW_FOR_LIGHT */
- "__unused__", /* PATH_RAY_SHADOW_CATCHER_HIT */
- "__unused__", /* PATH_RAY_SHADOW_CATCHER_PASS */
+ /* Remaining irrelevant bits up to 32. */
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
+ "__unused__",
};
const int nraytypes = sizeof(raytypes) / sizeof(raytypes[0]);