diff options
author | Dilith Jayakody <dilithjay@gmail.com> | 2022-04-03 05:38:54 +0300 |
---|---|---|
committer | Dilith Jayakody <dilithjay@gmail.com> | 2022-04-03 05:38:54 +0300 |
commit | bb44667a2e8f9c91548a574443e750583918e996 (patch) | |
tree | 12347d0a95971a9b7cd7d11786ccc2f948b214c6 /intern/cycles/scene/pass.cpp | |
parent | 2579367c93296eb2ab1da0b51dc107287dc09fd3 (diff) | |
parent | 79ff65d07bac0ecf0170542f86dc03a0228b53d5 (diff) |
Merge branch 'master' into soc-2021-curvessoc-2021-curves
Diffstat (limited to 'intern/cycles/scene/pass.cpp')
-rw-r--r-- | intern/cycles/scene/pass.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/intern/cycles/scene/pass.cpp b/intern/cycles/scene/pass.cpp index 41730cb189d..5f5b19e710d 100644 --- a/intern/cycles/scene/pass.cpp +++ b/intern/cycles/scene/pass.cpp @@ -124,6 +124,7 @@ NODE_DEFINE(Pass) SOCKET_ENUM(mode, "Mode", *pass_mode_enum, static_cast<int>(PassMode::DENOISED)); SOCKET_STRING(name, "Name", ustring()); SOCKET_BOOLEAN(include_albedo, "Include Albedo", false); + SOCKET_STRING(lightgroup, "Light Group", ustring()); return type; } @@ -134,7 +135,7 @@ Pass::Pass() : Node(get_node_type()), is_auto_(false) PassInfo Pass::get_info() const { - return get_info(type, include_albedo); + return get_info(type, include_albedo, !lightgroup.empty()); } bool Pass::is_written() const @@ -142,7 +143,7 @@ bool Pass::is_written() const return get_info().is_written; } -PassInfo Pass::get_info(const PassType type, const bool include_albedo) +PassInfo Pass::get_info(const PassType type, const bool include_albedo, const bool is_lightgroup) { PassInfo pass_info; @@ -157,9 +158,9 @@ PassInfo Pass::get_info(const PassType type, const bool include_albedo) pass_info.num_components = 0; break; case PASS_COMBINED: - pass_info.num_components = 4; + pass_info.num_components = is_lightgroup ? 3 : 4; pass_info.use_exposure = true; - pass_info.support_denoise = true; + pass_info.support_denoise = !is_lightgroup; break; case PASS_DEPTH: pass_info.num_components = 1; @@ -369,13 +370,16 @@ const Pass *Pass::find(const vector<Pass *> &passes, const string &name) return nullptr; } -const Pass *Pass::find(const vector<Pass *> &passes, PassType type, PassMode mode) +const Pass *Pass::find(const vector<Pass *> &passes, + PassType type, + PassMode mode, + const ustring &lightgroup) { for (const Pass *pass : passes) { - if (pass->get_type() != type || pass->get_mode() != mode) { + if (pass->get_type() != type || pass->get_mode() != mode || + pass->get_lightgroup() != lightgroup) { continue; } - return pass; } |