2023-06-14 08:52:36 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2011-04-27 13:58:34 +02:00
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "scene/film.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "device/device.h"
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "scene/background.h"
|
|
|
|
#include "scene/bake.h"
|
|
|
|
#include "scene/camera.h"
|
|
|
|
#include "scene/integrator.h"
|
|
|
|
#include "scene/mesh.h"
|
|
|
|
#include "scene/object.h"
|
|
|
|
#include "scene/scene.h"
|
|
|
|
#include "scene/stats.h"
|
|
|
|
#include "scene/tables.h"
|
2011-04-27 13:58:34 +02:00
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "util/algorithm.h"
|
|
|
|
#include "util/foreach.h"
|
|
|
|
#include "util/math.h"
|
|
|
|
#include "util/math_cdf.h"
|
|
|
|
#include "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 18:23:52 +01:00
|
|
|
|
2011-04-27 13:58:34 +02:00
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
2013-04-01 22:26:43 +02:00
|
|
|
/* Pixel Filter */
|
|
|
|
|
2015-03-27 11:47:55 +01:00
|
|
|
static float filter_func_box(float /*v*/, float /*width*/)
|
2013-04-01 22:26:43 +02:00
|
|
|
{
|
2013-05-09 16:37:32 +02:00
|
|
|
return 1.0f;
|
2013-04-01 22:26:43 +02: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 16:37:32 +02:00
|
|
|
return expf(-2.0f * v * v);
|
2013-04-01 22:26:43 +02: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 22:26:43 +02:00
|
|
|
static vector<float> filter_table(FilterType type, float width)
|
|
|
|
{
|
2015-10-26 16:23:18 +01:00
|
|
|
vector<float> filter_table(FILTER_TABLE_SIZE);
|
2013-04-01 22:26:43 +02:00
|
|
|
float (*filter_func)(float, float) = NULL;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-01 22:26:43 +02: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 22:26:43 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-26 16:23:18 +01:00
|
|
|
/* Create importance sampling table. */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-26 16:23:18 +01: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 16:23:18 +01: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 22:26:43 +02: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 18:23:52 +01:00
|
|
|
/* Film */
|
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
NODE_DEFINE(Film)
|
2011-04-27 13:58:34 +02:00
|
|
|
{
|
2016-05-07 20:30:16 +02:00
|
|
|
NodeType *type = NodeType::add("film", create);
|
2013-04-01 22:26:43 +02:00
|
|
|
|
2022-12-12 17:52:51 +01:00
|
|
|
SOCKET_FLOAT(exposure, "Exposure", 1.0f);
|
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 22:26:43 +02: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);
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
const NodeEnum *pass_type_enum = Pass::get_type_enum();
|
2020-11-04 11:17:38 +01:00
|
|
|
SOCKET_ENUM(display_pass, "Display Pass", *pass_type_enum, PASS_COMBINED);
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
SOCKET_BOOLEAN(show_active_pixels, "Show Active Pixels", false);
|
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
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);
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
SOCKET_BOOLEAN(use_approximate_shadow_catcher, "Use Approximate Shadow Catcher", false);
|
|
|
|
|
2016-05-07 20:30:16 +02:00
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2023-03-29 16:50:54 +02:00
|
|
|
Film::Film() : Node(get_node_type()), filter_table_offset_(TABLE_OFFSET_INVALID) {}
|
2011-04-27 13:58:34 +02:00
|
|
|
|
2023-03-29 16:50:54 +02:00
|
|
|
Film::~Film() {}
|
2011-04-27 13:58:34 +02:00
|
|
|
|
2020-08-18 12:15:46 +02:00
|
|
|
void Film::add_default(Scene *scene)
|
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
Pass *pass = scene->create_node<Pass>();
|
|
|
|
pass->set_type(PASS_COMBINED);
|
2020-08-18 12:15:46 +02:00
|
|
|
}
|
|
|
|
|
2013-04-01 22:26:43 +02:00
|
|
|
void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
2011-04-27 13:58:34 +02:00
|
|
|
{
|
2023-09-17 01:01:48 +02:00
|
|
|
if (!is_modified()) {
|
2011-04-27 13:58:34 +02:00
|
|
|
return;
|
2023-09-17 01:01:48 +02:00
|
|
|
}
|
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 22:26:43 +02:00
|
|
|
device_free(device, dscene, scene);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-04-27 13:58:34 +02:00
|
|
|
KernelFilm *kfilm = &dscene->data.film;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-06-17 17:16:37 +02:00
|
|
|
/* update data */
|
2011-04-27 13:58:34 +02:00
|
|
|
kfilm->exposure = exposure;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->pass_alpha_threshold = pass_alpha_threshold;
|
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 18:23:52 +01:00
|
|
|
kfilm->pass_flag = 0;
|
2019-09-05 12:47:20 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->use_approximate_shadow_catcher = get_use_approximate_shadow_catcher();
|
2019-09-05 12:47:20 +02:00
|
|
|
|
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 18:23:52 +01:00
|
|
|
kfilm->pass_stride = 0;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
/* Mark with PASS_UNUSED to avoid mask test in the kernel. */
|
2022-04-28 18:29:13 +02:00
|
|
|
kfilm->pass_combined = PASS_UNUSED;
|
|
|
|
kfilm->pass_depth = PASS_UNUSED;
|
|
|
|
kfilm->pass_position = PASS_UNUSED;
|
|
|
|
kfilm->pass_normal = PASS_UNUSED;
|
|
|
|
kfilm->pass_roughness = PASS_UNUSED;
|
|
|
|
kfilm->pass_motion = PASS_UNUSED;
|
|
|
|
kfilm->pass_motion_weight = PASS_UNUSED;
|
|
|
|
kfilm->pass_uv = PASS_UNUSED;
|
|
|
|
kfilm->pass_object_id = PASS_UNUSED;
|
|
|
|
kfilm->pass_material_id = PASS_UNUSED;
|
|
|
|
kfilm->pass_diffuse_color = PASS_UNUSED;
|
|
|
|
kfilm->pass_glossy_color = PASS_UNUSED;
|
|
|
|
kfilm->pass_transmission_color = PASS_UNUSED;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->pass_background = PASS_UNUSED;
|
|
|
|
kfilm->pass_emission = PASS_UNUSED;
|
|
|
|
kfilm->pass_ao = PASS_UNUSED;
|
|
|
|
kfilm->pass_diffuse_direct = PASS_UNUSED;
|
|
|
|
kfilm->pass_diffuse_indirect = PASS_UNUSED;
|
|
|
|
kfilm->pass_glossy_direct = PASS_UNUSED;
|
|
|
|
kfilm->pass_glossy_indirect = PASS_UNUSED;
|
|
|
|
kfilm->pass_transmission_direct = PASS_UNUSED;
|
|
|
|
kfilm->pass_transmission_indirect = PASS_UNUSED;
|
|
|
|
kfilm->pass_volume_direct = PASS_UNUSED;
|
|
|
|
kfilm->pass_volume_indirect = PASS_UNUSED;
|
2022-04-02 00:11:11 +02:00
|
|
|
kfilm->pass_lightgroup = PASS_UNUSED;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
/* Mark passes as unused so that the kernel knows the pass is inaccessible. */
|
|
|
|
kfilm->pass_denoising_normal = PASS_UNUSED;
|
|
|
|
kfilm->pass_denoising_albedo = PASS_UNUSED;
|
2021-10-28 15:44:50 +02:00
|
|
|
kfilm->pass_denoising_depth = PASS_UNUSED;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->pass_sample_count = PASS_UNUSED;
|
|
|
|
kfilm->pass_adaptive_aux_buffer = PASS_UNUSED;
|
|
|
|
kfilm->pass_shadow_catcher = PASS_UNUSED;
|
|
|
|
kfilm->pass_shadow_catcher_sample_count = PASS_UNUSED;
|
|
|
|
kfilm->pass_shadow_catcher_matte = PASS_UNUSED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-09-21 17:58:34 +02:00
|
|
|
kfilm->pass_guiding_color = PASS_UNUSED;
|
|
|
|
kfilm->pass_guiding_probability = PASS_UNUSED;
|
|
|
|
kfilm->pass_guiding_avg_roughness = PASS_UNUSED;
|
|
|
|
|
2020-04-06 22:37:50 +02:00
|
|
|
bool have_cryptomatte = false;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
bool have_aov_color = false;
|
|
|
|
bool have_aov_value = false;
|
2022-04-02 00:11:11 +02:00
|
|
|
bool have_lightgroup = 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++) {
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
const Pass *pass = scene->passes[i];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (pass->get_type() == PASS_NONE || !pass->is_written()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pass->get_mode() == PassMode::DENOISED) {
|
|
|
|
/* Generally we only storing offsets of the noisy passes. The display pass is an exception
|
|
|
|
* since it is a read operation and not a write. */
|
|
|
|
kfilm->pass_stride += pass->get_info().num_components;
|
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. */
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (pass->get_type() == PASS_MOTION || pass->get_type() == PASS_MOTION_WEIGHT) {
|
2019-01-02 17:46:57 +01:00
|
|
|
if (scene->need_motion() != Scene::MOTION_PASS) {
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->pass_stride += pass->get_info().num_components;
|
2019-01-02 17:46:57 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
const int pass_flag = (1 << (pass->get_type() % 32));
|
|
|
|
if (pass->get_type() <= PASS_CATEGORY_LIGHT_END) {
|
2017-11-14 07:20:02 +01:00
|
|
|
kfilm->light_pass_flag |= pass_flag;
|
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
else if (pass->get_type() <= PASS_CATEGORY_DATA_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 {
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
assert(pass->get_type() <= PASS_CATEGORY_BAKE_END);
|
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
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-04-02 00:11:11 +02:00
|
|
|
if (pass->get_lightgroup() != ustring()) {
|
|
|
|
if (!have_lightgroup) {
|
|
|
|
kfilm->pass_lightgroup = kfilm->pass_stride;
|
|
|
|
have_lightgroup = true;
|
|
|
|
}
|
|
|
|
kfilm->pass_stride += pass->get_info().num_components;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
switch (pass->get_type()) {
|
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 18:23:52 +01:00
|
|
|
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;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
case PASS_POSITION:
|
|
|
|
kfilm->pass_position = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_ROUGHNESS:
|
|
|
|
kfilm->pass_roughness = 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 18:23:52 +01:00
|
|
|
case PASS_UV:
|
|
|
|
kfilm->pass_uv = kfilm->pass_stride;
|
|
|
|
break;
|
2012-04-30 14:49:26 +02: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 18:23:52 +01: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;
|
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 18:23:52 +01: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 18:23:52 +01: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 15:00:26 +02: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;
|
|
|
|
|
2018-10-28 10:37:41 +01:00
|
|
|
case PASS_CRYPTOMATTE:
|
|
|
|
kfilm->pass_cryptomatte = have_cryptomatte ?
|
|
|
|
min(kfilm->pass_cryptomatte, kfilm->pass_stride) :
|
|
|
|
kfilm->pass_stride;
|
|
|
|
have_cryptomatte = true;
|
|
|
|
break;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
case PASS_DENOISING_NORMAL:
|
|
|
|
kfilm->pass_denoising_normal = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_DENOISING_ALBEDO:
|
|
|
|
kfilm->pass_denoising_albedo = kfilm->pass_stride;
|
|
|
|
break;
|
2021-10-25 19:30:19 +02:00
|
|
|
case PASS_DENOISING_DEPTH:
|
|
|
|
kfilm->pass_denoising_depth = kfilm->pass_stride;
|
|
|
|
break;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
case PASS_SHADOW_CATCHER:
|
|
|
|
kfilm->pass_shadow_catcher = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_SHADOW_CATCHER_SAMPLE_COUNT:
|
|
|
|
kfilm->pass_shadow_catcher_sample_count = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_SHADOW_CATCHER_MATTE:
|
|
|
|
kfilm->pass_shadow_catcher_matte = kfilm->pass_stride;
|
|
|
|
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;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
2019-12-04 19:57:28 +01:00
|
|
|
case PASS_AOV_COLOR:
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (!have_aov_color) {
|
2019-12-04 19:57:28 +01:00
|
|
|
kfilm->pass_aov_color = kfilm->pass_stride;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
have_aov_color = true;
|
2019-12-04 19:57:28 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case PASS_AOV_VALUE:
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (!have_aov_value) {
|
2019-12-04 19:57:28 +01:00
|
|
|
kfilm->pass_aov_value = kfilm->pass_stride;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
have_aov_value = true;
|
2019-12-04 19:57:28 +01:00
|
|
|
}
|
|
|
|
break;
|
2022-09-21 17:58:34 +02:00
|
|
|
case PASS_GUIDING_COLOR:
|
|
|
|
kfilm->pass_guiding_color = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_GUIDING_PROBABILITY:
|
|
|
|
kfilm->pass_guiding_probability = kfilm->pass_stride;
|
|
|
|
break;
|
|
|
|
case PASS_GUIDING_AVG_ROUGHNESS:
|
|
|
|
kfilm->pass_guiding_avg_roughness = kfilm->pass_stride;
|
|
|
|
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 18:23:52 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kfilm->pass_stride += pass->get_info().num_components;
|
2019-09-05 12:47:20 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-01 22:26:43 +02:00
|
|
|
/* update filter table */
|
|
|
|
vector<float> table = filter_table(filter_type, filter_width);
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
scene->lookup_tables->remove_table(&filter_table_offset_);
|
|
|
|
filter_table_offset_ = scene->lookup_tables->add_table(dscene, table);
|
2022-07-12 17:26:29 +02:00
|
|
|
dscene->data.tables.filter_table_offset = (int)filter_table_offset_;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-06-07 14:45:26 +02: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 10:37:41 +01:00
|
|
|
kfilm->cryptomatte_passes = cryptomatte_passes;
|
|
|
|
kfilm->cryptomatte_depth = cryptomatte_depth;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-11-04 11:17:38 +01:00
|
|
|
clear_modified();
|
2011-04-27 13:58:34 +02:00
|
|
|
}
|
|
|
|
|
2015-03-27 11:47:55 +01:00
|
|
|
void Film::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *scene)
|
2011-04-27 13:58:34 +02:00
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
scene->lookup_tables->remove_table(&filter_table_offset_);
|
2011-04-27 13:58:34 +02:00
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
int Film::get_aov_offset(Scene *scene, string name, bool &is_color)
|
2012-06-20 16:24:52 +02:00
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
int offset_color = 0, offset_value = 0;
|
|
|
|
foreach (const Pass *pass, scene->passes) {
|
|
|
|
if (pass->get_name() == name) {
|
|
|
|
if (pass->get_type() == PASS_AOV_VALUE) {
|
|
|
|
is_color = false;
|
|
|
|
return offset_value;
|
|
|
|
}
|
|
|
|
else if (pass->get_type() == PASS_AOV_COLOR) {
|
|
|
|
is_color = true;
|
|
|
|
return offset_color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pass->get_type() == PASS_AOV_VALUE) {
|
|
|
|
offset_value += pass->get_info().num_components;
|
|
|
|
}
|
|
|
|
else if (pass->get_type() == PASS_AOV_COLOR) {
|
|
|
|
offset_color += pass->get_info().num_components;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2022-04-02 00:11:11 +02:00
|
|
|
bool Film::update_lightgroups(Scene *scene)
|
|
|
|
{
|
|
|
|
map<ustring, int> lightgroups;
|
|
|
|
int i = 0;
|
|
|
|
foreach (const Pass *pass, scene->passes) {
|
|
|
|
ustring lightgroup = pass->get_lightgroup();
|
|
|
|
if (!lightgroup.empty()) {
|
|
|
|
if (!lightgroups.count(lightgroup)) {
|
|
|
|
lightgroups[lightgroup] = i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (scene->lightgroups != lightgroups) {
|
|
|
|
scene->lightgroups = lightgroups;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
void Film::update_passes(Scene *scene, bool add_sample_count_pass)
|
|
|
|
{
|
|
|
|
const Background *background = scene->background;
|
|
|
|
const BakeManager *bake_manager = scene->bake_manager;
|
|
|
|
const ObjectManager *object_manager = scene->object_manager;
|
|
|
|
Integrator *integrator = scene->integrator;
|
|
|
|
|
2021-09-28 14:37:59 +02:00
|
|
|
if (!is_modified() && !object_manager->need_update() && !integrator->is_modified() &&
|
|
|
|
!background->is_modified())
|
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Remove auto generated passes and recreate them. */
|
|
|
|
remove_auto_passes(scene);
|
|
|
|
|
|
|
|
/* Display pass for viewport. */
|
|
|
|
const PassType display_pass = get_display_pass();
|
|
|
|
add_auto_pass(scene, display_pass);
|
|
|
|
|
|
|
|
/* Assumption is that a combined pass always exists for now, for example
|
|
|
|
* adaptive sampling is always based on a combined pass. But we should
|
|
|
|
* try to lift this limitation in the future for faster rendering of
|
|
|
|
* individual passes. */
|
|
|
|
if (display_pass != PASS_COMBINED) {
|
|
|
|
add_auto_pass(scene, PASS_COMBINED);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create passes needed for adaptive sampling. */
|
|
|
|
const AdaptiveSampling adaptive_sampling = integrator->get_adaptive_sampling();
|
|
|
|
if (adaptive_sampling.use) {
|
|
|
|
add_auto_pass(scene, PASS_SAMPLE_COUNT);
|
|
|
|
add_auto_pass(scene, PASS_ADAPTIVE_AUX_BUFFER);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create passes needed for denoising. */
|
|
|
|
const bool use_denoise = integrator->get_use_denoise();
|
|
|
|
if (use_denoise) {
|
|
|
|
if (integrator->get_use_denoise_pass_normal()) {
|
|
|
|
add_auto_pass(scene, PASS_DENOISING_NORMAL);
|
|
|
|
}
|
|
|
|
if (integrator->get_use_denoise_pass_albedo()) {
|
|
|
|
add_auto_pass(scene, PASS_DENOISING_ALBEDO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create passes for shadow catcher. */
|
|
|
|
if (scene->has_shadow_catcher()) {
|
|
|
|
const bool need_background = get_use_approximate_shadow_catcher() &&
|
|
|
|
!background->get_transparent();
|
|
|
|
|
|
|
|
add_auto_pass(scene, PASS_SHADOW_CATCHER);
|
|
|
|
add_auto_pass(scene, PASS_SHADOW_CATCHER_SAMPLE_COUNT);
|
|
|
|
add_auto_pass(scene, PASS_SHADOW_CATCHER_MATTE);
|
|
|
|
|
|
|
|
if (need_background) {
|
|
|
|
add_auto_pass(scene, PASS_BACKGROUND);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (Pass::contains(scene->passes, PASS_SHADOW_CATCHER)) {
|
|
|
|
add_auto_pass(scene, PASS_SHADOW_CATCHER);
|
|
|
|
add_auto_pass(scene, PASS_SHADOW_CATCHER_SAMPLE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
const vector<Pass *> passes_immutable = scene->passes;
|
|
|
|
for (const Pass *pass : passes_immutable) {
|
|
|
|
const PassInfo info = pass->get_info();
|
|
|
|
/* Add utility passes needed to generate some light passes. */
|
|
|
|
if (info.divide_type != PASS_NONE) {
|
|
|
|
add_auto_pass(scene, info.divide_type);
|
|
|
|
}
|
|
|
|
if (info.direct_type != PASS_NONE) {
|
|
|
|
add_auto_pass(scene, info.direct_type);
|
|
|
|
}
|
|
|
|
if (info.indirect_type != PASS_NONE) {
|
|
|
|
add_auto_pass(scene, info.indirect_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* NOTE: Enable all denoised passes when storage is requested.
|
|
|
|
* This way it is possible to tweak denoiser parameters later on. */
|
|
|
|
if (info.support_denoise && use_denoise) {
|
|
|
|
add_auto_pass(scene, pass->get_type(), PassMode::DENOISED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bake_manager->get_baking()) {
|
|
|
|
add_auto_pass(scene, PASS_BAKE_PRIMITIVE, "BakePrimitive");
|
|
|
|
add_auto_pass(scene, PASS_BAKE_DIFFERENTIAL, "BakeDifferential");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (add_sample_count_pass) {
|
|
|
|
if (!Pass::contains(scene->passes, PASS_SAMPLE_COUNT)) {
|
|
|
|
add_auto_pass(scene, PASS_SAMPLE_COUNT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Remove duplicates and initialize internal pass info. */
|
|
|
|
finalize_passes(scene, use_denoise);
|
2013-09-13 16:31:28 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
/* Flush scene updates. */
|
|
|
|
const bool have_uv_pass = Pass::contains(scene->passes, PASS_UV);
|
|
|
|
const bool have_motion_pass = Pass::contains(scene->passes, PASS_MOTION);
|
|
|
|
const bool have_ao_pass = Pass::contains(scene->passes, PASS_AO);
|
|
|
|
|
|
|
|
if (have_uv_pass != prev_have_uv_pass) {
|
|
|
|
scene->geometry_manager->tag_update(scene, GeometryManager::UV_PASS_NEEDED);
|
2013-09-13 16:31:28 +02: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 16:31:28 +02:00
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (have_motion_pass != prev_have_motion_pass) {
|
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
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (have_ao_pass != prev_have_ao_pass) {
|
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 16:24:52 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
prev_have_uv_pass = have_uv_pass;
|
|
|
|
prev_have_motion_pass = have_motion_pass;
|
|
|
|
prev_have_ao_pass = have_ao_pass;
|
|
|
|
|
|
|
|
tag_modified();
|
|
|
|
|
|
|
|
/* Debug logging. */
|
2022-06-16 19:39:13 +02:00
|
|
|
if (VLOG_INFO_IS_ON) {
|
|
|
|
VLOG_INFO << "Effective scene passes:";
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
for (const Pass *pass : scene->passes) {
|
2022-06-16 19:39:13 +02:00
|
|
|
VLOG_INFO << "- " << *pass;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
}
|
2019-09-05 12:47:20 +02:00
|
|
|
}
|
2012-06-20 16:24:52 +02:00
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
void Film::add_auto_pass(Scene *scene, PassType type, const char *name)
|
2019-12-04 19:57:28 +01:00
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
add_auto_pass(scene, type, PassMode::NOISY, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Film::add_auto_pass(Scene *scene, PassType type, PassMode mode, const char *name)
|
|
|
|
{
|
|
|
|
Pass *pass = new Pass();
|
|
|
|
pass->set_type(type);
|
|
|
|
pass->set_mode(mode);
|
|
|
|
pass->set_name(ustring((name) ? name : ""));
|
|
|
|
pass->is_auto_ = true;
|
|
|
|
|
|
|
|
pass->set_owner(scene);
|
|
|
|
scene->passes.push_back(pass);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Film::remove_auto_passes(Scene *scene)
|
|
|
|
{
|
|
|
|
/* Remove all passes which were automatically created. */
|
|
|
|
vector<Pass *> new_passes;
|
|
|
|
|
|
|
|
for (Pass *pass : scene->passes) {
|
|
|
|
if (!pass->is_auto_) {
|
|
|
|
new_passes.push_back(pass);
|
2019-12-04 19:57:28 +01:00
|
|
|
}
|
|
|
|
else {
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
delete pass;
|
2019-12-04 19:57:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
scene->passes = new_passes;
|
2019-12-04 19:57:28 +01:00
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
static bool compare_pass_order(const Pass *a, const Pass *b)
|
2020-11-04 11:17:38 +01:00
|
|
|
{
|
2022-04-02 00:11:11 +02:00
|
|
|
/* On the highest level, sort by number of components.
|
|
|
|
* Within passes of the same component count, sort so that all non-lightgroup passes come first.
|
|
|
|
* Within that group, sort by type. */
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
const int num_components_a = a->get_info().num_components;
|
|
|
|
const int num_components_b = b->get_info().num_components;
|
2020-11-04 11:17:38 +01:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
if (num_components_a == num_components_b) {
|
2022-04-02 00:11:11 +02:00
|
|
|
const int is_lightgroup_a = !a->get_lightgroup().empty();
|
|
|
|
const int is_lightgroup_b = !b->get_lightgroup().empty();
|
|
|
|
if (is_lightgroup_a == is_lightgroup_b) {
|
|
|
|
return (a->get_type() < b->get_type());
|
|
|
|
}
|
|
|
|
return is_lightgroup_b;
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return num_components_a > num_components_b;
|
2020-11-04 11:17:38 +01:00
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
void Film::finalize_passes(Scene *scene, const bool use_denoise)
|
2020-11-04 11:17:38 +01:00
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
/* Remove duplicate passes. */
|
|
|
|
vector<Pass *> new_passes;
|
|
|
|
|
|
|
|
for (Pass *pass : scene->passes) {
|
|
|
|
/* Disable denoising on passes if denoising is disabled, or if the
|
|
|
|
* pass does not support it. */
|
|
|
|
pass->set_mode((use_denoise && pass->get_info().support_denoise) ? pass->get_mode() :
|
|
|
|
PassMode::NOISY);
|
|
|
|
|
|
|
|
/* Merge duplicate passes. */
|
|
|
|
bool duplicate_found = false;
|
|
|
|
for (Pass *new_pass : new_passes) {
|
|
|
|
/* If different type or denoising, don't merge. */
|
|
|
|
if (new_pass->get_type() != pass->get_type() || new_pass->get_mode() != pass->get_mode()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If both passes have a name and the names are different, don't merge.
|
|
|
|
* If either pass has a name, we'll use that name. */
|
|
|
|
if (!pass->get_name().empty() && !new_pass->get_name().empty() &&
|
|
|
|
pass->get_name() != new_pass->get_name())
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pass->get_name().empty() && new_pass->get_name().empty()) {
|
|
|
|
new_pass->set_name(pass->get_name());
|
|
|
|
}
|
|
|
|
|
|
|
|
new_pass->is_auto_ &= pass->is_auto_;
|
|
|
|
duplicate_found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!duplicate_found) {
|
|
|
|
new_passes.push_back(pass);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
delete pass;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Order from by components and type, This is required to for AOVs and cryptomatte passes,
|
|
|
|
* which the kernel assumes to be in order. Note this must use stable sort so cryptomatte
|
|
|
|
* passes remain in the right order. */
|
|
|
|
stable_sort(new_passes.begin(), new_passes.end(), compare_pass_order);
|
|
|
|
|
|
|
|
scene->passes = new_passes;
|
2020-11-04 11:17:38 +01:00
|
|
|
}
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
uint Film::get_kernel_features(const Scene *scene) const
|
2020-11-04 11:17:38 +01:00
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
uint kernel_features = 0;
|
|
|
|
|
|
|
|
for (const Pass *pass : scene->passes) {
|
|
|
|
if (!pass->is_written()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
const PassType pass_type = pass->get_type();
|
|
|
|
const PassMode pass_mode = pass->get_mode();
|
|
|
|
|
|
|
|
if (pass_mode == PassMode::DENOISED || pass_type == PASS_DENOISING_NORMAL ||
|
2021-10-25 19:30:19 +02:00
|
|
|
pass_type == PASS_DENOISING_ALBEDO || pass_type == PASS_DENOISING_DEPTH)
|
|
|
|
{
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kernel_features |= KERNEL_FEATURE_DENOISING;
|
|
|
|
}
|
|
|
|
|
2021-11-12 16:43:43 +01:00
|
|
|
if (pass_type >= PASS_DIFFUSE && pass_type <= PASS_VOLUME_INDIRECT) {
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kernel_features |= KERNEL_FEATURE_LIGHT_PASSES;
|
2021-11-12 16:43:43 +01:00
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
2021-10-21 17:42:15 +02:00
|
|
|
if (pass_type == PASS_AO) {
|
|
|
|
kernel_features |= KERNEL_FEATURE_AO_PASS;
|
|
|
|
}
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return kernel_features;
|
2020-11-04 11:17:38 +01:00
|
|
|
}
|
|
|
|
|
2011-04-27 13:58:34 +02:00
|
|
|
CCL_NAMESPACE_END
|