2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
2014-12-25 02:50:24 +01:00
|
|
|
* limitations under the License.
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 20:39:14 +02:00
|
|
|
#include "render/film.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "device/device.h"
|
|
|
|
|
#include "render/camera.h"
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 20:39:14 +02:00
|
|
|
#include "render/integrator.h"
|
|
|
|
|
#include "render/mesh.h"
|
|
|
|
|
#include "render/scene.h"
|
2020-10-01 23:16:01 +02:00
|
|
|
#include "render/stats.h"
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 20:39:14 +02:00
|
|
|
#include "render/tables.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 20:39:14 +02:00
|
|
|
#include "util/util_algorithm.h"
|
|
|
|
|
#include "util/util_foreach.h"
|
|
|
|
|
#include "util/util_math.h"
|
|
|
|
|
#include "util/util_math_cdf.h"
|
2020-10-01 23:16:01 +02:00
|
|
|
#include "util/util_time.h"
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
/* Pass */
|
|
|
|
|
|
2012-01-27 13:58:32 +00:00
|
|
|
static bool compare_pass_order(const Pass &a, const Pass &b)
|
|
|
|
|
{
|
|
|
|
|
if (a.components == b.components)
|
|
|
|
|
return (a.type < b.type);
|
|
|
|
|
return (a.components > b.components);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
static NodeEnum *get_pass_type_enum()
|
2020-08-18 12:15:46 +02:00
|
|
|
{
|
|
|
|
|
static NodeEnum pass_type_enum;
|
|
|
|
|
pass_type_enum.insert("combined", PASS_COMBINED);
|
|
|
|
|
pass_type_enum.insert("depth", PASS_DEPTH);
|
|
|
|
|
pass_type_enum.insert("normal", PASS_NORMAL);
|
|
|
|
|
pass_type_enum.insert("uv", PASS_UV);
|
|
|
|
|
pass_type_enum.insert("object_id", PASS_OBJECT_ID);
|
|
|
|
|
pass_type_enum.insert("material_id", PASS_MATERIAL_ID);
|
|
|
|
|
pass_type_enum.insert("motion", PASS_MOTION);
|
|
|
|
|
pass_type_enum.insert("motion_weight", PASS_MOTION_WEIGHT);
|
|
|
|
|
#ifdef __KERNEL_DEBUG__
|
|
|
|
|
pass_type_enum.insert("traversed_nodes", PASS_BVH_TRAVERSED_NODES);
|
|
|
|
|
pass_type_enum.insert("traverse_instances", PASS_BVH_TRAVERSED_INSTANCES);
|
|
|
|
|
pass_type_enum.insert("bvh_intersections", PASS_BVH_INTERSECTIONS);
|
|
|
|
|
pass_type_enum.insert("ray_bounces", PASS_RAY_BOUNCES);
|
|
|
|
|
#endif
|
|
|
|
|
pass_type_enum.insert("render_time", PASS_RENDER_TIME);
|
|
|
|
|
pass_type_enum.insert("cryptomatte", PASS_CRYPTOMATTE);
|
|
|
|
|
pass_type_enum.insert("aov_color", PASS_AOV_COLOR);
|
|
|
|
|
pass_type_enum.insert("aov_value", PASS_AOV_VALUE);
|
|
|
|
|
pass_type_enum.insert("adaptive_aux_buffer", PASS_ADAPTIVE_AUX_BUFFER);
|
|
|
|
|
pass_type_enum.insert("sample_count", PASS_SAMPLE_COUNT);
|
|
|
|
|
pass_type_enum.insert("mist", PASS_MIST);
|
|
|
|
|
pass_type_enum.insert("emission", PASS_EMISSION);
|
|
|
|
|
pass_type_enum.insert("background", PASS_BACKGROUND);
|
|
|
|
|
pass_type_enum.insert("ambient_occlusion", PASS_AO);
|
|
|
|
|
pass_type_enum.insert("shadow", PASS_SHADOW);
|
|
|
|
|
pass_type_enum.insert("diffuse_direct", PASS_DIFFUSE_DIRECT);
|
|
|
|
|
pass_type_enum.insert("diffuse_indirect", PASS_DIFFUSE_INDIRECT);
|
|
|
|
|
pass_type_enum.insert("diffuse_color", PASS_DIFFUSE_COLOR);
|
|
|
|
|
pass_type_enum.insert("glossy_direct", PASS_GLOSSY_DIRECT);
|
|
|
|
|
pass_type_enum.insert("glossy_indirect", PASS_GLOSSY_INDIRECT);
|
|
|
|
|
pass_type_enum.insert("glossy_color", PASS_GLOSSY_COLOR);
|
|
|
|
|
pass_type_enum.insert("transmission_direct", PASS_TRANSMISSION_DIRECT);
|
|
|
|
|
pass_type_enum.insert("transmission_indirect", PASS_TRANSMISSION_INDIRECT);
|
|
|
|
|
pass_type_enum.insert("transmission_color", PASS_TRANSMISSION_COLOR);
|
|
|
|
|
pass_type_enum.insert("volume_direct", PASS_VOLUME_DIRECT);
|
|
|
|
|
pass_type_enum.insert("volume_indirect", PASS_VOLUME_INDIRECT);
|
|
|
|
|
pass_type_enum.insert("bake_primitive", PASS_BAKE_PRIMITIVE);
|
|
|
|
|
pass_type_enum.insert("bake_differential", PASS_BAKE_DIFFERENTIAL);
|
|
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
return &pass_type_enum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NODE_DEFINE(Pass)
|
|
|
|
|
{
|
|
|
|
|
NodeType *type = NodeType::add("pass", create);
|
|
|
|
|
|
|
|
|
|
NodeEnum *pass_type_enum = get_pass_type_enum();
|
|
|
|
|
SOCKET_ENUM(type, "Type", *pass_type_enum, PASS_COMBINED);
|
2020-08-18 12:15:46 +02:00
|
|
|
SOCKET_STRING(name, "Name", ustring());
|
|
|
|
|
|
|
|
|
|
return type;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-15 16:11:12 +01:00
|
|
|
Pass::Pass() : Node(get_node_type())
|
2020-08-18 12:15:46 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-28 05:37:41 -04:00
|
|
|
void Pass::add(PassType type, vector<Pass> &passes, const char *name)
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
{
|
2018-10-28 05:37:41 -04:00
|
|
|
for (size_t i = 0; i < passes.size(); i++) {
|
2019-12-20 19:49:11 +01:00
|
|
|
if (passes[i].type != type) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* An empty name is used as a placeholder to signal that any pass of
|
|
|
|
|
* that type is fine (because the content always is the same).
|
|
|
|
|
* This is important to support divide_type: If the pass that has a
|
|
|
|
|
* divide_type is added first, a pass for divide_type with an empty
|
|
|
|
|
* name will be added. Then, if a matching pass with a name is later
|
|
|
|
|
* requested, the existing placeholder will be renamed to that.
|
|
|
|
|
* If the divide_type is explicitly allocated with a name first and
|
|
|
|
|
* then again as part of another pass, the second one will just be
|
|
|
|
|
* skipped because that type already exists. */
|
|
|
|
|
|
|
|
|
|
/* If no name is specified, any pass of the correct type will match. */
|
|
|
|
|
if (name == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we already have a placeholder pass, rename that one. */
|
|
|
|
|
if (passes[i].name.empty()) {
|
|
|
|
|
passes[i].name = name;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If neither existing nor requested pass have placeholder name, they
|
|
|
|
|
* must match. */
|
|
|
|
|
if (name == passes[i].name) {
|
2012-03-28 12:18:12 +00:00
|
|
|
return;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2018-10-28 05:37:41 -04:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
Pass pass;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
pass.type = type;
|
2020-04-06 23:19:01 +02:00
|
|
|
pass.filter = true;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
pass.exposure = false;
|
2012-03-28 12:18:12 +00:00
|
|
|
pass.divide_type = PASS_NONE;
|
2018-10-28 05:37:41 -04:00
|
|
|
if (name) {
|
|
|
|
|
pass.name = name;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
switch (type) {
|
|
|
|
|
case PASS_NONE:
|
|
|
|
|
pass.components = 0;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_COMBINED:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_DEPTH:
|
|
|
|
|
pass.components = 1;
|
2020-04-06 23:19:01 +02:00
|
|
|
pass.filter = false;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
break;
|
2013-06-07 12:45:26 +00:00
|
|
|
case PASS_MIST:
|
|
|
|
|
pass.components = 1;
|
|
|
|
|
break;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_NORMAL:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_UV:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
2012-04-30 12:49:26 +00:00
|
|
|
case PASS_MOTION:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.divide_type = PASS_MOTION_WEIGHT;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_MOTION_WEIGHT:
|
|
|
|
|
pass.components = 1;
|
|
|
|
|
break;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_OBJECT_ID:
|
|
|
|
|
case PASS_MATERIAL_ID:
|
|
|
|
|
pass.components = 1;
|
2020-04-06 23:19:01 +02:00
|
|
|
pass.filter = false;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_EMISSION:
|
|
|
|
|
case PASS_BACKGROUND:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
break;
|
2012-02-28 16:45:08 +00:00
|
|
|
case PASS_AO:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
2012-03-28 10:39:21 +00:00
|
|
|
case PASS_SHADOW:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = false;
|
|
|
|
|
break;
|
2014-01-02 19:05:07 -02:00
|
|
|
case PASS_LIGHT:
|
2015-09-03 13:52:56 +05:00
|
|
|
/* This isn't a real pass, used by baking to see whether
|
|
|
|
|
* light data is needed or not.
|
|
|
|
|
*
|
|
|
|
|
* Set components to 0 so pass sort below happens in a
|
|
|
|
|
* determined way.
|
|
|
|
|
*/
|
|
|
|
|
pass.components = 0;
|
2014-01-02 19:05:07 -02:00
|
|
|
break;
|
2014-10-04 19:00:26 +06:00
|
|
|
#ifdef WITH_CYCLES_DEBUG
|
2017-01-12 13:44:35 +01:00
|
|
|
case PASS_BVH_TRAVERSED_NODES:
|
2015-06-12 00:12:03 +02:00
|
|
|
case PASS_BVH_TRAVERSED_INSTANCES:
|
2017-01-12 13:44:35 +01:00
|
|
|
case PASS_BVH_INTERSECTIONS:
|
2015-06-11 10:42:38 +02:00
|
|
|
case PASS_RAY_BOUNCES:
|
|
|
|
|
pass.components = 1;
|
|
|
|
|
pass.exposure = false;
|
|
|
|
|
break;
|
2014-10-04 19:00:26 +06:00
|
|
|
#endif
|
2017-11-17 14:23:48 +01:00
|
|
|
case PASS_RENDER_TIME:
|
|
|
|
|
/* This pass is handled entirely on the host side. */
|
|
|
|
|
pass.components = 0;
|
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-11-14 07:20:02 +01:00
|
|
|
case PASS_DIFFUSE_COLOR:
|
|
|
|
|
case PASS_GLOSSY_COLOR:
|
|
|
|
|
case PASS_TRANSMISSION_COLOR:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_DIFFUSE_DIRECT:
|
|
|
|
|
case PASS_DIFFUSE_INDIRECT:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
pass.divide_type = PASS_DIFFUSE_COLOR;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_GLOSSY_DIRECT:
|
|
|
|
|
case PASS_GLOSSY_INDIRECT:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
pass.divide_type = PASS_GLOSSY_COLOR;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_TRANSMISSION_DIRECT:
|
|
|
|
|
case PASS_TRANSMISSION_INDIRECT:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
pass.divide_type = PASS_TRANSMISSION_COLOR;
|
|
|
|
|
break;
|
2017-11-14 07:21:07 +01:00
|
|
|
case PASS_VOLUME_DIRECT:
|
|
|
|
|
case PASS_VOLUME_INDIRECT:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
pass.exposure = true;
|
|
|
|
|
break;
|
2018-10-28 05:37:41 -04:00
|
|
|
case PASS_CRYPTOMATTE:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
2020-03-05 12:05:42 +01:00
|
|
|
case PASS_ADAPTIVE_AUX_BUFFER:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_SAMPLE_COUNT:
|
|
|
|
|
pass.components = 1;
|
|
|
|
|
pass.exposure = false;
|
|
|
|
|
break;
|
2019-12-04 19:57:28 +01:00
|
|
|
case PASS_AOV_COLOR:
|
|
|
|
|
pass.components = 4;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_AOV_VALUE:
|
|
|
|
|
pass.components = 1;
|
|
|
|
|
break;
|
Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.
A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.
With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.
Reviewers: #cycles
Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben
Differential Revision: https://developer.blender.org/D3108
2019-05-10 21:39:58 +02:00
|
|
|
case PASS_BAKE_PRIMITIVE:
|
|
|
|
|
case PASS_BAKE_DIFFERENTIAL:
|
|
|
|
|
pass.components = 4;
|
2020-08-25 15:53:57 +02:00
|
|
|
pass.exposure = false;
|
|
|
|
|
pass.filter = false;
|
Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.
A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.
With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.
Reviewers: #cycles
Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben
Differential Revision: https://developer.blender.org/D3108
2019-05-10 21:39:58 +02:00
|
|
|
break;
|
2017-11-14 07:20:02 +01:00
|
|
|
default:
|
|
|
|
|
assert(false);
|
|
|
|
|
break;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-28 05:37:41 -04:00
|
|
|
passes.push_back(pass);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-20 15:56:24 +01:00
|
|
|
/* Order from by components, to ensure alignment so passes with size 4
|
|
|
|
|
* come first and then passes with size 1. Note this must use stable sort
|
|
|
|
|
* so cryptomatte passes remain in the right order. */
|
|
|
|
|
stable_sort(&passes[0], &passes[0] + passes.size(), compare_pass_order);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-28 12:18:12 +00:00
|
|
|
if (pass.divide_type != PASS_NONE)
|
|
|
|
|
Pass::add(pass.divide_type, passes);
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
}
|
|
|
|
|
|
2018-10-28 05:37:41 -04:00
|
|
|
bool Pass::equals(const vector<Pass> &A, const vector<Pass> &B)
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
{
|
|
|
|
|
if (A.size() != B.size())
|
|
|
|
|
return false;
|
2018-07-06 10:17:58 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
for (int i = 0; i < A.size(); i++)
|
2018-10-28 05:37:41 -04:00
|
|
|
if (A[i].type != B[i].type || A[i].name != B[i].name)
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
return false;
|
2018-07-06 10:17:58 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-28 05:37:41 -04:00
|
|
|
bool Pass::contains(const vector<Pass> &passes, PassType type)
|
2012-04-30 12:49:26 +00:00
|
|
|
{
|
2016-05-07 20:30:16 +02:00
|
|
|
for (size_t i = 0; i < passes.size(); i++)
|
|
|
|
|
if (passes[i].type == type)
|
2012-04-30 12:49:26 +00:00
|
|
|
return true;
|
2018-07-06 10:17:58 +02:00
|
|
|
|
2012-04-30 12:49:26 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
/* Pixel Filter */
|
|
|
|
|
|
2015-03-27 15:47:55 +05:00
|
|
|
static float filter_func_box(float /*v*/, float /*width*/)
|
2013-04-01 20:26:43 +00:00
|
|
|
{
|
2013-05-09 14:37:32 +00:00
|
|
|
return 1.0f;
|
2013-04-01 20:26:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static float filter_func_gaussian(float v, float width)
|
|
|
|
|
{
|
2015-08-06 21:04:43 +02:00
|
|
|
v *= 6.0f / width;
|
2013-05-09 14:37:32 +00:00
|
|
|
return expf(-2.0f * v * v);
|
2013-04-01 20:26:43 +00:00
|
|
|
}
|
|
|
|
|
|
2015-08-06 21:04:43 +02:00
|
|
|
static float filter_func_blackman_harris(float v, float width)
|
|
|
|
|
{
|
|
|
|
|
v = M_2PI_F * (v / width + 0.5f);
|
|
|
|
|
return 0.35875f - 0.48829f * cosf(v) + 0.14128f * cosf(2.0f * v) - 0.01168f * cosf(3.0f * v);
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
static vector<float> filter_table(FilterType type, float width)
|
|
|
|
|
{
|
2015-10-26 20:23:18 +05:00
|
|
|
vector<float> filter_table(FILTER_TABLE_SIZE);
|
2013-04-01 20:26:43 +00:00
|
|
|
float (*filter_func)(float, float) = NULL;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
switch (type) {
|
|
|
|
|
case FILTER_BOX:
|
|
|
|
|
filter_func = filter_func_box;
|
|
|
|
|
break;
|
|
|
|
|
case FILTER_GAUSSIAN:
|
|
|
|
|
filter_func = filter_func_gaussian;
|
2015-08-06 21:04:43 +02:00
|
|
|
width *= 3.0f;
|
|
|
|
|
break;
|
|
|
|
|
case FILTER_BLACKMAN_HARRIS:
|
|
|
|
|
filter_func = filter_func_blackman_harris;
|
|
|
|
|
width *= 2.0f;
|
2013-04-01 20:26:43 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
assert(0);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-26 20:23:18 +05:00
|
|
|
/* Create importance sampling table. */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-26 20:23:18 +05:00
|
|
|
/* TODO(sergey): With the even filter table size resolution we can not
|
|
|
|
|
* really make it nice symmetric importance map without sampling full range
|
|
|
|
|
* (meaning, we would need to sample full filter range and not use the
|
|
|
|
|
* make_symmetric argument).
|
|
|
|
|
*
|
|
|
|
|
* Current code matches exactly initial filter table code, but we should
|
|
|
|
|
* consider either making FILTER_TABLE_SIZE odd value or sample full filter.
|
|
|
|
|
*/
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-26 20:23:18 +05:00
|
|
|
util_cdf_inverted(FILTER_TABLE_SIZE,
|
|
|
|
|
0.0f,
|
|
|
|
|
width * 0.5f,
|
|
|
|
|
function_bind(filter_func, _1, width),
|
|
|
|
|
true,
|
|
|
|
|
filter_table);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
return filter_table;
|
|
|
|
|
}
|
|
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
/* Film */
|
|
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
NODE_DEFINE(Film)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2016-05-07 20:30:16 +02:00
|
|
|
NodeType *type = NodeType::add("film", create);
|
2013-04-01 20:26:43 +00:00
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
SOCKET_FLOAT(exposure, "Exposure", 0.8f);
|
2019-09-05 12:47:20 +02:00
|
|
|
SOCKET_FLOAT(pass_alpha_threshold, "Pass Alpha Threshold", 0.0f);
|
2016-05-07 20:30:16 +02:00
|
|
|
|
|
|
|
|
static NodeEnum filter_enum;
|
|
|
|
|
filter_enum.insert("box", FILTER_BOX);
|
|
|
|
|
filter_enum.insert("gaussian", FILTER_GAUSSIAN);
|
|
|
|
|
filter_enum.insert("blackman_harris", FILTER_BLACKMAN_HARRIS);
|
2013-04-01 20:26:43 +00:00
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
SOCKET_ENUM(filter_type, "Filter Type", filter_enum, FILTER_BOX);
|
|
|
|
|
SOCKET_FLOAT(filter_width, "Filter Width", 1.0f);
|
|
|
|
|
|
|
|
|
|
SOCKET_FLOAT(mist_start, "Mist Start", 0.0f);
|
|
|
|
|
SOCKET_FLOAT(mist_depth, "Mist Depth", 100.0f);
|
|
|
|
|
SOCKET_FLOAT(mist_falloff, "Mist Falloff", 1.0f);
|
|
|
|
|
|
2017-05-07 14:40:58 +02:00
|
|
|
SOCKET_BOOLEAN(denoising_data_pass, "Generate Denoising Data Pass", false);
|
|
|
|
|
SOCKET_BOOLEAN(denoising_clean_pass, "Generate Denoising Clean Pass", false);
|
2019-02-06 12:42:10 +01:00
|
|
|
SOCKET_BOOLEAN(denoising_prefiltered_pass, "Generate Denoising Prefiltered Pass", false);
|
2017-05-07 14:40:58 +02:00
|
|
|
SOCKET_INT(denoising_flags, "Denoising Flags", 0);
|
2020-03-05 12:05:42 +01:00
|
|
|
SOCKET_BOOLEAN(use_adaptive_sampling, "Use Adaptive Sampling", false);
|
2017-05-07 14:40:58 +02:00
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
SOCKET_BOOLEAN(use_light_visibility, "Use Light Visibility", false);
|
|
|
|
|
|
|
|
|
|
NodeEnum *pass_type_enum = get_pass_type_enum();
|
|
|
|
|
SOCKET_ENUM(display_pass, "Display Pass", *pass_type_enum, PASS_COMBINED);
|
|
|
|
|
|
|
|
|
|
static NodeEnum cryptomatte_passes_enum;
|
|
|
|
|
cryptomatte_passes_enum.insert("none", CRYPT_NONE);
|
|
|
|
|
cryptomatte_passes_enum.insert("object", CRYPT_OBJECT);
|
|
|
|
|
cryptomatte_passes_enum.insert("material", CRYPT_MATERIAL);
|
|
|
|
|
cryptomatte_passes_enum.insert("asset", CRYPT_ASSET);
|
|
|
|
|
cryptomatte_passes_enum.insert("accurate", CRYPT_ACCURATE);
|
|
|
|
|
SOCKET_ENUM(cryptomatte_passes, "Cryptomatte Passes", cryptomatte_passes_enum, CRYPT_NONE);
|
|
|
|
|
|
|
|
|
|
SOCKET_INT(cryptomatte_depth, "Cryptomatte Depth", 0);
|
|
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
return type;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-15 16:11:12 +01:00
|
|
|
Film::Film() : Node(get_node_type())
|
2016-05-07 20:30:16 +02:00
|
|
|
{
|
2013-06-07 18:59:23 +00:00
|
|
|
use_light_visibility = false;
|
2016-05-07 20:30:16 +02:00
|
|
|
filter_table_offset = TABLE_OFFSET_INVALID;
|
2018-10-28 05:37:41 -04:00
|
|
|
cryptomatte_passes = CRYPT_NONE;
|
2020-01-31 15:23:17 +01:00
|
|
|
display_pass = PASS_COMBINED;
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Film::~Film()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 12:15:46 +02:00
|
|
|
void Film::add_default(Scene *scene)
|
|
|
|
|
{
|
|
|
|
|
Pass::add(PASS_COMBINED, scene->passes);
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2020-11-04 11:17:38 +01:00
|
|
|
if (!is_modified())
|
2011-04-27 11:58:34 +00:00
|
|
|
return;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-10-01 23:16:01 +02:00
|
|
|
scoped_callback_timer timer([scene](double time) {
|
|
|
|
|
if (scene->update_stats) {
|
|
|
|
|
scene->update_stats->film.times.add_entry({"update", time});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
device_free(device, dscene, scene);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
KernelFilm *kfilm = &dscene->data.film;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
/* update __data */
|
|
|
|
|
kfilm->exposure = exposure;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kfilm->pass_flag = 0;
|
2019-09-05 12:47:20 +02:00
|
|
|
|
|
|
|
|
kfilm->display_pass_stride = -1;
|
|
|
|
|
kfilm->display_pass_components = 0;
|
|
|
|
|
kfilm->display_divide_pass_stride = -1;
|
|
|
|
|
kfilm->use_display_exposure = false;
|
|
|
|
|
kfilm->use_display_pass_alpha = (display_pass == PASS_COMBINED);
|
|
|
|
|
|
2018-01-24 10:56:13 +01:00
|
|
|
kfilm->light_pass_flag = 0;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kfilm->pass_stride = 0;
|
2019-12-08 21:19:37 +01:00
|
|
|
kfilm->use_light_pass = use_light_visibility;
|
2020-04-06 22:37:50 +02:00
|
|
|
kfilm->pass_aov_value_num = 0;
|
|
|
|
|
kfilm->pass_aov_color_num = 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-06 22:37:50 +02:00
|
|
|
bool have_cryptomatte = false;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-08-18 12:15:46 +02:00
|
|
|
for (size_t i = 0; i < scene->passes.size(); i++) {
|
|
|
|
|
Pass &pass = scene->passes[i];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-02 17:46:57 +01:00
|
|
|
if (pass.type == PASS_NONE) {
|
2017-11-14 07:20:02 +01:00
|
|
|
continue;
|
2019-01-02 17:46:57 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-02 17:46:57 +01:00
|
|
|
/* Can't do motion pass if no motion vectors are available. */
|
|
|
|
|
if (pass.type == PASS_MOTION || pass.type == PASS_MOTION_WEIGHT) {
|
|
|
|
|
if (scene->need_motion() != Scene::MOTION_PASS) {
|
|
|
|
|
kfilm->pass_stride += pass.components;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-11-14 07:20:02 +01:00
|
|
|
int pass_flag = (1 << (pass.type % 32));
|
|
|
|
|
if (pass.type <= PASS_CATEGORY_MAIN_END) {
|
|
|
|
|
kfilm->pass_flag |= pass_flag;
|
|
|
|
|
}
|
Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.
A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.
With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.
Reviewers: #cycles
Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben
Differential Revision: https://developer.blender.org/D3108
2019-05-10 21:39:58 +02:00
|
|
|
else if (pass.type <= PASS_CATEGORY_LIGHT_END) {
|
2017-11-14 07:20:02 +01:00
|
|
|
kfilm->use_light_pass = 1;
|
|
|
|
|
kfilm->light_pass_flag |= pass_flag;
|
|
|
|
|
}
|
Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.
A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.
With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.
Reviewers: #cycles
Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben
Differential Revision: https://developer.blender.org/D3108
2019-05-10 21:39:58 +02:00
|
|
|
else {
|
|
|
|
|
assert(pass.type <= PASS_CATEGORY_BAKE_END);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
switch (pass.type) {
|
|
|
|
|
case PASS_COMBINED:
|
|
|
|
|
kfilm->pass_combined = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_DEPTH:
|
|
|
|
|
kfilm->pass_depth = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_NORMAL:
|
|
|
|
|
kfilm->pass_normal = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_UV:
|
|
|
|
|
kfilm->pass_uv = kfilm->pass_stride;
|
|
|
|
|
break;
|
2012-04-30 12:49:26 +00:00
|
|
|
case PASS_MOTION:
|
|
|
|
|
kfilm->pass_motion = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_MOTION_WEIGHT:
|
|
|
|
|
kfilm->pass_motion_weight = kfilm->pass_stride;
|
|
|
|
|
break;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_OBJECT_ID:
|
|
|
|
|
kfilm->pass_object_id = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_MATERIAL_ID:
|
|
|
|
|
kfilm->pass_material_id = kfilm->pass_stride;
|
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-11-14 07:20:02 +01:00
|
|
|
case PASS_MIST:
|
|
|
|
|
kfilm->pass_mist = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_EMISSION:
|
|
|
|
|
kfilm->pass_emission = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_BACKGROUND:
|
|
|
|
|
kfilm->pass_background = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_AO:
|
|
|
|
|
kfilm->pass_ao = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_SHADOW:
|
|
|
|
|
kfilm->pass_shadow = kfilm->pass_stride;
|
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-11-14 07:20:02 +01:00
|
|
|
case PASS_LIGHT:
|
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_DIFFUSE_COLOR:
|
|
|
|
|
kfilm->pass_diffuse_color = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_GLOSSY_COLOR:
|
|
|
|
|
kfilm->pass_glossy_color = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_TRANSMISSION_COLOR:
|
|
|
|
|
kfilm->pass_transmission_color = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_DIFFUSE_INDIRECT:
|
|
|
|
|
kfilm->pass_diffuse_indirect = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_GLOSSY_INDIRECT:
|
|
|
|
|
kfilm->pass_glossy_indirect = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_TRANSMISSION_INDIRECT:
|
|
|
|
|
kfilm->pass_transmission_indirect = kfilm->pass_stride;
|
|
|
|
|
break;
|
2017-11-14 07:21:07 +01:00
|
|
|
case PASS_VOLUME_INDIRECT:
|
|
|
|
|
kfilm->pass_volume_indirect = kfilm->pass_stride;
|
|
|
|
|
break;
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
case PASS_DIFFUSE_DIRECT:
|
|
|
|
|
kfilm->pass_diffuse_direct = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_GLOSSY_DIRECT:
|
|
|
|
|
kfilm->pass_glossy_direct = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_TRANSMISSION_DIRECT:
|
|
|
|
|
kfilm->pass_transmission_direct = kfilm->pass_stride;
|
|
|
|
|
break;
|
2017-11-14 07:21:07 +01:00
|
|
|
case PASS_VOLUME_DIRECT:
|
|
|
|
|
kfilm->pass_volume_direct = kfilm->pass_stride;
|
|
|
|
|
break;
|
2014-10-04 19:00:26 +06:00
|
|
|
|
Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.
A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.
With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.
Reviewers: #cycles
Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben
Differential Revision: https://developer.blender.org/D3108
2019-05-10 21:39:58 +02:00
|
|
|
case PASS_BAKE_PRIMITIVE:
|
|
|
|
|
kfilm->pass_bake_primitive = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_BAKE_DIFFERENTIAL:
|
|
|
|
|
kfilm->pass_bake_differential = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
|
2014-10-04 19:00:26 +06:00
|
|
|
#ifdef WITH_CYCLES_DEBUG
|
2017-01-12 13:44:35 +01:00
|
|
|
case PASS_BVH_TRAVERSED_NODES:
|
|
|
|
|
kfilm->pass_bvh_traversed_nodes = kfilm->pass_stride;
|
2014-10-04 19:00:26 +06:00
|
|
|
break;
|
2015-06-12 00:12:03 +02:00
|
|
|
case PASS_BVH_TRAVERSED_INSTANCES:
|
|
|
|
|
kfilm->pass_bvh_traversed_instances = kfilm->pass_stride;
|
|
|
|
|
break;
|
2017-01-12 13:44:35 +01:00
|
|
|
case PASS_BVH_INTERSECTIONS:
|
|
|
|
|
kfilm->pass_bvh_intersections = kfilm->pass_stride;
|
|
|
|
|
break;
|
2015-06-11 10:42:38 +02:00
|
|
|
case PASS_RAY_BOUNCES:
|
|
|
|
|
kfilm->pass_ray_bounces = kfilm->pass_stride;
|
|
|
|
|
break;
|
2014-10-04 19:00:26 +06:00
|
|
|
#endif
|
2017-11-17 14:23:48 +01:00
|
|
|
case PASS_RENDER_TIME:
|
|
|
|
|
break;
|
2018-10-28 05:37:41 -04:00
|
|
|
case PASS_CRYPTOMATTE:
|
|
|
|
|
kfilm->pass_cryptomatte = have_cryptomatte ?
|
|
|
|
|
min(kfilm->pass_cryptomatte, kfilm->pass_stride) :
|
|
|
|
|
kfilm->pass_stride;
|
|
|
|
|
have_cryptomatte = true;
|
|
|
|
|
break;
|
2020-03-05 12:05:42 +01:00
|
|
|
case PASS_ADAPTIVE_AUX_BUFFER:
|
|
|
|
|
kfilm->pass_adaptive_aux_buffer = kfilm->pass_stride;
|
|
|
|
|
break;
|
|
|
|
|
case PASS_SAMPLE_COUNT:
|
|
|
|
|
kfilm->pass_sample_count = kfilm->pass_stride;
|
|
|
|
|
break;
|
2019-12-04 19:57:28 +01:00
|
|
|
case PASS_AOV_COLOR:
|
2020-04-08 14:09:10 +02:00
|
|
|
if (kfilm->pass_aov_color_num == 0) {
|
2019-12-04 19:57:28 +01:00
|
|
|
kfilm->pass_aov_color = kfilm->pass_stride;
|
|
|
|
|
}
|
2020-04-08 14:09:10 +02:00
|
|
|
kfilm->pass_aov_color_num++;
|
2019-12-04 19:57:28 +01:00
|
|
|
break;
|
|
|
|
|
case PASS_AOV_VALUE:
|
2020-04-08 14:09:10 +02:00
|
|
|
if (kfilm->pass_aov_value_num == 0) {
|
2019-12-04 19:57:28 +01:00
|
|
|
kfilm->pass_aov_value = kfilm->pass_stride;
|
|
|
|
|
}
|
2020-04-08 14:09:10 +02:00
|
|
|
kfilm->pass_aov_value_num++;
|
2019-12-04 19:57:28 +01:00
|
|
|
break;
|
2017-11-14 07:20:02 +01:00
|
|
|
default:
|
|
|
|
|
assert(false);
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-05 12:47:20 +02:00
|
|
|
if (pass.type == display_pass) {
|
|
|
|
|
kfilm->display_pass_stride = kfilm->pass_stride;
|
|
|
|
|
kfilm->display_pass_components = pass.components;
|
|
|
|
|
kfilm->use_display_exposure = pass.exposure && (kfilm->exposure != 1.0f);
|
|
|
|
|
}
|
|
|
|
|
else if (pass.type == PASS_DIFFUSE_COLOR || pass.type == PASS_TRANSMISSION_COLOR ||
|
2020-02-14 12:20:12 +01:00
|
|
|
pass.type == PASS_GLOSSY_COLOR) {
|
2019-09-05 12:47:20 +02:00
|
|
|
kfilm->display_divide_pass_stride = kfilm->pass_stride;
|
|
|
|
|
}
|
|
|
|
|
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kfilm->pass_stride += pass.components;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-05-07 14:40:58 +02:00
|
|
|
kfilm->pass_denoising_data = 0;
|
|
|
|
|
kfilm->pass_denoising_clean = 0;
|
|
|
|
|
kfilm->denoising_flags = 0;
|
|
|
|
|
if (denoising_data_pass) {
|
|
|
|
|
kfilm->pass_denoising_data = kfilm->pass_stride;
|
|
|
|
|
kfilm->pass_stride += DENOISING_PASS_SIZE_BASE;
|
|
|
|
|
kfilm->denoising_flags = denoising_flags;
|
|
|
|
|
if (denoising_clean_pass) {
|
|
|
|
|
kfilm->pass_denoising_clean = kfilm->pass_stride;
|
|
|
|
|
kfilm->pass_stride += DENOISING_PASS_SIZE_CLEAN;
|
|
|
|
|
kfilm->use_light_pass = 1;
|
|
|
|
|
}
|
2019-02-06 12:42:10 +01:00
|
|
|
if (denoising_prefiltered_pass) {
|
|
|
|
|
kfilm->pass_stride += DENOISING_PASS_SIZE_PREFILTERED;
|
2017-05-07 14:40:58 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-27 13:58:32 +00:00
|
|
|
kfilm->pass_stride = align_up(kfilm->pass_stride, 4);
|
2019-09-05 12:47:20 +02:00
|
|
|
|
|
|
|
|
/* When displaying the normal/uv pass in the viewport we need to disable
|
|
|
|
|
* transparency.
|
|
|
|
|
*
|
|
|
|
|
* We also don't need to perform light accumulations. Later we want to optimize this to suppress
|
|
|
|
|
* light calculations. */
|
|
|
|
|
if (display_pass == PASS_NORMAL || display_pass == PASS_UV) {
|
|
|
|
|
kfilm->use_light_pass = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
kfilm->pass_alpha_threshold = pass_alpha_threshold;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-01 20:26:43 +00:00
|
|
|
/* update filter table */
|
|
|
|
|
vector<float> table = filter_table(filter_type, filter_width);
|
2016-05-08 01:44:01 +02:00
|
|
|
scene->lookup_tables->remove_table(&filter_table_offset);
|
2013-04-01 20:26:43 +00:00
|
|
|
filter_table_offset = scene->lookup_tables->add_table(dscene, table);
|
|
|
|
|
kfilm->filter_table_offset = (int)filter_table_offset;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-06-07 12:45:26 +00:00
|
|
|
/* mist pass parameters */
|
|
|
|
|
kfilm->mist_start = mist_start;
|
|
|
|
|
kfilm->mist_inv_depth = (mist_depth > 0.0f) ? 1.0f / mist_depth : 0.0f;
|
|
|
|
|
kfilm->mist_falloff = mist_falloff;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-28 05:37:41 -04:00
|
|
|
kfilm->cryptomatte_passes = cryptomatte_passes;
|
|
|
|
|
kfilm->cryptomatte_depth = cryptomatte_depth;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-05-07 14:40:58 +02:00
|
|
|
pass_stride = kfilm->pass_stride;
|
|
|
|
|
denoising_data_offset = kfilm->pass_denoising_data;
|
|
|
|
|
denoising_clean_offset = kfilm->pass_denoising_clean;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
clear_modified();
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
2015-03-27 15:47:55 +05:00
|
|
|
void Film::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *scene)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2016-05-08 01:44:01 +02:00
|
|
|
scene->lookup_tables->remove_table(&filter_table_offset);
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
2019-09-05 12:47:20 +02:00
|
|
|
void Film::tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool update_passes)
|
2012-06-20 14:24:52 +00:00
|
|
|
{
|
2020-08-18 12:15:46 +02:00
|
|
|
if (Pass::contains(scene->passes, PASS_UV) != Pass::contains(passes_, PASS_UV)) {
|
Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).
Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.
The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.
On average, for a variety of animated scenes, this gives a 3x speedup.
Reviewed By: #cycles, brecht
Maniphest Tasks: T79174
Differential Revision: https://developer.blender.org/D9555
2021-01-22 15:01:26 +01:00
|
|
|
scene->geometry_manager->tag_update(scene, GeometryManager::UV_PASS_NEEDED);
|
2013-09-13 14:31:28 +00:00
|
|
|
|
|
|
|
|
foreach (Shader *shader, scene->shaders)
|
Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).
Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.
The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.
On average, for a variety of animated scenes, this gives a 3x speedup.
Reviewed By: #cycles, brecht
Maniphest Tasks: T79174
Differential Revision: https://developer.blender.org/D9555
2021-01-22 15:01:26 +01:00
|
|
|
shader->need_update_uvs = true;
|
2013-09-13 14:31:28 +00:00
|
|
|
}
|
2020-08-18 12:15:46 +02:00
|
|
|
else if (Pass::contains(scene->passes, PASS_MOTION) != Pass::contains(passes_, PASS_MOTION)) {
|
Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).
Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.
The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.
On average, for a variety of animated scenes, this gives a 3x speedup.
Reviewed By: #cycles, brecht
Maniphest Tasks: T79174
Differential Revision: https://developer.blender.org/D9555
2021-01-22 15:01:26 +01:00
|
|
|
scene->geometry_manager->tag_update(scene, GeometryManager::MOTION_PASS_NEEDED);
|
2019-09-05 12:47:20 +02:00
|
|
|
}
|
2020-08-18 12:15:46 +02:00
|
|
|
else if (Pass::contains(scene->passes, PASS_AO) != Pass::contains(passes_, PASS_AO)) {
|
Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).
Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.
The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.
On average, for a variety of animated scenes, this gives a 3x speedup.
Reviewed By: #cycles, brecht
Maniphest Tasks: T79174
Differential Revision: https://developer.blender.org/D9555
2021-01-22 15:01:26 +01:00
|
|
|
scene->integrator->tag_update(scene, Integrator::AO_PASS_MODIFIED);
|
2019-09-05 12:47:20 +02:00
|
|
|
}
|
2012-06-20 14:24:52 +00:00
|
|
|
|
2019-09-05 12:47:20 +02:00
|
|
|
if (update_passes) {
|
2020-08-18 12:15:46 +02:00
|
|
|
scene->passes = passes_;
|
2019-09-05 12:47:20 +02:00
|
|
|
}
|
2012-06-20 14:24:52 +00:00
|
|
|
}
|
|
|
|
|
|
2020-08-18 12:15:46 +02:00
|
|
|
int Film::get_aov_offset(Scene *scene, string name, bool &is_color)
|
2019-12-04 19:57:28 +01:00
|
|
|
{
|
|
|
|
|
int num_color = 0, num_value = 0;
|
2020-08-18 12:15:46 +02:00
|
|
|
foreach (const Pass &pass, scene->passes) {
|
2019-12-04 19:57:28 +01:00
|
|
|
if (pass.type == PASS_AOV_COLOR) {
|
|
|
|
|
num_color++;
|
|
|
|
|
}
|
|
|
|
|
else if (pass.type == PASS_AOV_VALUE) {
|
|
|
|
|
num_value++;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pass.name == name) {
|
|
|
|
|
is_color = (pass.type == PASS_AOV_COLOR);
|
|
|
|
|
return (is_color ? num_color : num_value) - 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
int Film::get_pass_stride() const
|
|
|
|
|
{
|
|
|
|
|
return pass_stride;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Film::get_denoising_data_offset() const
|
|
|
|
|
{
|
|
|
|
|
return denoising_data_offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Film::get_denoising_clean_offset() const
|
|
|
|
|
{
|
|
|
|
|
return denoising_clean_offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t Film::get_filter_table_offset() const
|
|
|
|
|
{
|
|
|
|
|
return filter_table_offset;
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_END
|