Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/render/film.cpp')
-rw-r--r--intern/cycles/render/film.cpp73
1 files changed, 55 insertions, 18 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index 2da28222a7f..5c3778f6ae5 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -20,12 +20,14 @@
#include "render/integrator.h"
#include "render/mesh.h"
#include "render/scene.h"
+#include "render/stats.h"
#include "render/tables.h"
#include "util/util_algorithm.h"
#include "util/util_foreach.h"
#include "util/util_math.h"
#include "util/util_math_cdf.h"
+#include "util/util_time.h"
CCL_NAMESPACE_BEGIN
@@ -38,10 +40,8 @@ static bool compare_pass_order(const Pass &a, const Pass &b)
return (a.components > b.components);
}
-NODE_DEFINE(Pass)
+static NodeEnum *get_pass_type_enum()
{
- NodeType *type = NodeType::add("pass", create);
-
static NodeEnum pass_type_enum;
pass_type_enum.insert("combined", PASS_COMBINED);
pass_type_enum.insert("depth", PASS_DEPTH);
@@ -82,7 +82,15 @@ NODE_DEFINE(Pass)
pass_type_enum.insert("bake_primitive", PASS_BAKE_PRIMITIVE);
pass_type_enum.insert("bake_differential", PASS_BAKE_DIFFERENTIAL);
- SOCKET_ENUM(type, "Type", pass_type_enum, PASS_COMBINED);
+ return &pass_type_enum;
+}
+
+NODE_DEFINE(Pass)
+{
+ NodeType *type = NodeType::add("pass", create);
+
+ NodeEnum *pass_type_enum = get_pass_type_enum();
+ SOCKET_ENUM(type, "Type", *pass_type_enum, PASS_COMBINED);
SOCKET_STRING(name, "Name", ustring());
return type;
@@ -381,6 +389,21 @@ NODE_DEFINE(Film)
SOCKET_INT(denoising_flags, "Denoising Flags", 0);
SOCKET_BOOLEAN(use_adaptive_sampling, "Use Adaptive Sampling", false);
+ SOCKET_BOOLEAN(use_light_visibility, "Use Light Visibility", false);
+
+ NodeEnum *pass_type_enum = get_pass_type_enum();
+ SOCKET_ENUM(display_pass, "Display Pass", *pass_type_enum, PASS_COMBINED);
+
+ static NodeEnum cryptomatte_passes_enum;
+ cryptomatte_passes_enum.insert("none", CRYPT_NONE);
+ cryptomatte_passes_enum.insert("object", CRYPT_OBJECT);
+ cryptomatte_passes_enum.insert("material", CRYPT_MATERIAL);
+ cryptomatte_passes_enum.insert("asset", CRYPT_ASSET);
+ cryptomatte_passes_enum.insert("accurate", CRYPT_ACCURATE);
+ SOCKET_ENUM(cryptomatte_passes, "Cryptomatte Passes", cryptomatte_passes_enum, CRYPT_NONE);
+
+ SOCKET_INT(cryptomatte_depth, "Cryptomatte Depth", 0);
+
return type;
}
@@ -390,8 +413,6 @@ Film::Film() : Node(node_type)
filter_table_offset = TABLE_OFFSET_INVALID;
cryptomatte_passes = CRYPT_NONE;
display_pass = PASS_COMBINED;
-
- need_update = true;
}
Film::~Film()
@@ -405,9 +426,15 @@ void Film::add_default(Scene *scene)
void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
{
- if (!need_update)
+ if (!is_modified())
return;
+ scoped_callback_timer timer([scene](double time) {
+ if (scene->update_stats) {
+ scene->update_stats->film.times.add_entry({"update", time});
+ }
+ });
+
device_free(device, dscene, scene);
KernelFilm *kfilm = &dscene->data.film;
@@ -650,7 +677,7 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
denoising_data_offset = kfilm->pass_denoising_data;
denoising_clean_offset = kfilm->pass_denoising_clean;
- need_update = false;
+ clear_modified();
}
void Film::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *scene)
@@ -658,11 +685,6 @@ void Film::device_free(Device * /*device*/, DeviceScene * /*dscene*/, Scene *sce
scene->lookup_tables->remove_table(&filter_table_offset);
}
-bool Film::modified(const Film &film)
-{
- return !Node::equals(film);
-}
-
void Film::tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool update_passes)
{
if (Pass::contains(scene->passes, PASS_UV) != Pass::contains(passes_, PASS_UV)) {
@@ -683,11 +705,6 @@ void Film::tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool upd
}
}
-void Film::tag_update(Scene * /*scene*/)
-{
- need_update = true;
-}
-
int Film::get_aov_offset(Scene *scene, string name, bool &is_color)
{
int num_color = 0, num_value = 0;
@@ -711,4 +728,24 @@ int Film::get_aov_offset(Scene *scene, string name, bool &is_color)
return -1;
}
+int Film::get_pass_stride() const
+{
+ return pass_stride;
+}
+
+int Film::get_denoising_data_offset() const
+{
+ return denoising_data_offset;
+}
+
+int Film::get_denoising_clean_offset() const
+{
+ return denoising_clean_offset;
+}
+
+size_t Film::get_filter_table_offset() const
+{
+ return filter_table_offset;
+}
+
CCL_NAMESPACE_END