Blender V5.0
film.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "scene/pass.h"
8
9#include "kernel/types.h"
10
11#include "graph/node.h"
12
13#include "util/string.h"
14
16
17class Device;
18class DeviceScene;
19class Scene;
20
28
29class Film : public Node {
30 public:
32
33 NODE_SOCKET_API(float, exposure)
34 NODE_SOCKET_API(float, pass_alpha_threshold)
35
36 NODE_SOCKET_API(PassType, display_pass)
37 NODE_SOCKET_API(bool, show_active_pixels)
38
39 NODE_SOCKET_API(FilterType, filter_type)
40 NODE_SOCKET_API(float, filter_width)
41
42 NODE_SOCKET_API(float, mist_start)
43 NODE_SOCKET_API(float, mist_depth)
44 NODE_SOCKET_API(float, mist_falloff)
45
46 NODE_SOCKET_API(CryptomatteType, cryptomatte_passes)
47 NODE_SOCKET_API(int, cryptomatte_depth)
48
49 /* Approximate shadow catcher pass into its matte pass, so that both artificial objects and
50 * shadows can be alpha-overed onto a backdrop. */
51 NODE_SOCKET_API(bool, use_approximate_shadow_catcher)
52
53 NODE_SOCKET_API(bool, use_sample_count)
54
55 private:
56 size_t filter_table_offset_;
57 bool prev_have_uv_pass = false;
58 bool prev_have_motion_pass = false;
59 bool prev_have_ao_pass = false;
60
61 public:
62 Film();
63 ~Film() override;
64
65 /* add default passes to scene */
66 static void add_default(Scene *scene);
67
68 void device_update(Device *device, DeviceScene *dscene, Scene *scene);
69 void device_free(Device *device, DeviceScene *dscene, Scene *scene);
70
71 int get_aov_offset(Scene *scene, string name, bool &is_color);
72
73 bool update_lightgroups(Scene *scene);
74
75 /* Update passes so that they contain all passes required for the configured functionality. */
76 void update_passes(Scene *scene);
77
78 uint get_kernel_features(const Scene *scene) const;
79
80 private:
81 void add_auto_pass(Scene *scene, PassType type, const char *name = nullptr);
82 void add_auto_pass(Scene *scene, PassType type, PassMode mode, const char *name = nullptr);
83 void remove_auto_passes(Scene *scene);
84 void finalize_passes(Scene *scene, const bool use_denoise);
85};
86
unsigned int uint
int get_aov_offset(Scene *scene, string name, bool &is_color)
Definition film.cpp:454
uint get_kernel_features(const Scene *scene) const
Definition film.cpp:755
void update_passes(Scene *scene)
Definition film.cpp:501
static void add_default(Scene *scene)
Definition film.cpp:133
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
Definition film.cpp:449
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
Definition film.cpp:139
Film()
Definition film.cpp:129
~Film() override
bool update_lightgroups(Scene *scene)
Definition film.cpp:481
#define CCL_NAMESPACE_END
FilterType
Definition film.h:21
@ FILTER_NUM_TYPES
Definition film.h:26
@ FILTER_BOX
Definition film.h:22
@ FILTER_BLACKMAN_HARRIS
Definition film.h:24
@ FILTER_GAUSSIAN
Definition film.h:23
#define NODE_SOCKET_API(type_, name)
Definition graph/node.h:55
CryptomatteType
PassType
#define NODE_DECLARE
Definition node_type.h:145
PassMode
Definition pass.h:20
const NodeType * type
Definition graph/node.h:178
ustring name
Definition graph/node.h:177
Node(const NodeType *type, ustring name=ustring())