Blender V4.3
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#ifndef __FILM_H__
6#define __FILM_H__
7
8#include "scene/pass.h"
9#include "util/string.h"
10#include "util/vector.h"
11
12#include "kernel/types.h"
13
14#include "graph/node.h"
15
17
18class Device;
19class DeviceScene;
20class Scene;
21
29
30class Film : public Node {
31 public:
33
34 NODE_SOCKET_API(float, exposure)
35 NODE_SOCKET_API(float, pass_alpha_threshold)
36
37 NODE_SOCKET_API(PassType, display_pass)
38 NODE_SOCKET_API(bool, show_active_pixels)
39
40 NODE_SOCKET_API(FilterType, filter_type)
41 NODE_SOCKET_API(float, filter_width)
42
43 NODE_SOCKET_API(float, mist_start)
44 NODE_SOCKET_API(float, mist_depth)
45 NODE_SOCKET_API(float, mist_falloff)
46
47 NODE_SOCKET_API(CryptomatteType, cryptomatte_passes)
48 NODE_SOCKET_API(int, cryptomatte_depth)
49
50 /* Approximate shadow catcher pass into its matte pass, so that both artificial objects and
51 * shadows can be alpha-overed onto a backdrop. */
52 NODE_SOCKET_API(bool, use_approximate_shadow_catcher)
53
54 private:
55 size_t filter_table_offset_;
56 bool prev_have_uv_pass = false;
57 bool prev_have_motion_pass = false;
58 bool prev_have_ao_pass = false;
59
60 public:
61 Film();
62 ~Film();
63
64 /* add default passes to scene */
65 static void add_default(Scene *scene);
66
67 void device_update(Device *device, DeviceScene *dscene, Scene *scene);
68 void device_free(Device *device, DeviceScene *dscene, Scene *scene);
69
70 int get_aov_offset(Scene *scene, string name, bool &is_color);
71
72 bool update_lightgroups(Scene *scene);
73
74 /* Update passes so that they contain all passes required for the configured functionality.
75 *
76 * If `add_sample_count_pass` is true then the SAMPLE_COUNT pass is ensured to be added. */
77 void update_passes(Scene *scene, bool add_sample_count_pass);
78
79 uint get_kernel_features(const Scene *scene) const;
80
81 private:
82 void add_auto_pass(Scene *scene, PassType type, const char *name = nullptr);
83 void add_auto_pass(Scene *scene, PassType type, PassMode mode, const char *name = nullptr);
84 void remove_auto_passes(Scene *scene);
85 void finalize_passes(Scene *scene, const bool use_denoise);
86};
87
89
90#endif /* __FILM_H__ */
unsigned int uint
Definition film.h:30
int get_aov_offset(Scene *scene, string name, bool &is_color)
Definition film.cpp:425
uint get_kernel_features(const Scene *scene) const
Definition film.cpp:711
~Film()
Definition film.cpp:129
static void add_default(Scene *scene)
Definition film.cpp:131
void update_passes(Scene *scene, bool add_sample_count_pass)
Definition film.cpp:471
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
Definition film.cpp:420
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
Definition film.cpp:137
Film()
Definition film.cpp:127
bool update_lightgroups(Scene *scene)
Definition film.cpp:451
#define CCL_NAMESPACE_END
FilterType
Definition film.h:22
@ FILTER_NUM_TYPES
Definition film.h:27
@ FILTER_BOX
Definition film.h:23
@ FILTER_BLACKMAN_HARRIS
Definition film.h:25
@ FILTER_GAUSSIAN
Definition film.h:24
#define NODE_SOCKET_API(type_, name)
Definition graph/node.h:55
CryptomatteType
PassType
#define NODE_DECLARE
Definition node_type.h:142
PassMode
Definition pass.h:20