24 int index =
static_cast<int>(pass_type) * 2;
63 :
Node(get_node_type()),
64 type(scene_pass->get_type()),
65 mode(scene_pass->get_mode()),
66 name(scene_pass->get_name()),
67 include_albedo(scene_pass->get_include_albedo()),
68 lightgroup(scene_pass->get_lightgroup())
102 SOCKET_BOOLEAN(use_approximate_shadow_catcher,
"Use Approximate Shadow Catcher",
false);
103 SOCKET_BOOLEAN(use_transparent_background,
"Transparent Background",
false);
143 for (
const Pass *scene_pass : scene_passes) {
146 if (scene_pass->is_written()) {
148 pass_stride += scene_pass->get_info().num_components;
154 passes.emplace_back(std::move(buffer_pass));
180 if (pass.name == name) {
191 if (pass.type == type && pass.mode == mode) {
211 if (pass->type ==
PASS_COMBINED && pass->lightgroup.empty()) {
213 if (shadow_catcher_matte_pass) {
214 pass = shadow_catcher_matte_pass;
229 if (
width != other.width ||
height != other.height) {
245 if (offset != other.offset ||
stride != other.stride ||
pass_stride != other.pass_stride) {
249 if (layer != other.layer || view != other.view) {
253 if (exposure != other.exposure ||
260 return !(passes == other.passes);
311 const size_t src_offset)
327 for (
int i = 0; i <
PASS_NUM; ++i) {
340 pass_offsets[num_passes].dst_offset = dst_pass_offset;
341 pass_offsets[num_passes].src_offset = src_pass_offset;
351 const int64_t dst_num_pixels = dst_width * dst_height;
354 const int64_t src_offset_in_floats = src_offset * src_pass_stride;
356 const float *src_pixel = src->
buffer.
data() + src_offset_in_floats;
359 for (
int i = 0; i < dst_num_pixels;
360 ++i, src_pixel += src_pass_stride, dst_pixel += dst_pass_stride)
362 for (
int pass_offset_idx = 0; pass_offset_idx < num_passes; ++pass_offset_idx) {
363 const int dst_pass_offset = pass_offsets[pass_offset_idx].dst_offset;
364 const int src_pass_offset = pass_offsets[pass_offset_idx].src_offset;
367 dst_pixel[dst_pass_offset + 0] = src_pixel[src_pass_offset + 0];
368 dst_pixel[dst_pass_offset + 1] = src_pixel[src_pass_offset + 1];
369 dst_pixel[dst_pass_offset + 2] = src_pixel[src_pass_offset + 2];
370 dst_pixel[dst_pass_offset + 3] = src_pixel[src_pass_offset + 3];
static CCL_NAMESPACE_BEGIN int pass_type_mode_to_index(PassType pass_type, PassMode mode)
void render_buffers_host_copy_denoised(RenderBuffers *dst, const BufferParams &dst_params, const RenderBuffers *src, const BufferParams &src_params, const size_t src_offset)
static int pass_to_index(const BufferPass &pass)
int pass_offset_[kNumPassOffsets]
bool use_approximate_shadow_catcher
vector< BufferPass > passes
static constexpr int kNumPassOffsets
int get_pass_offset(PassType type, PassMode mode=PassMode::NOISY) const
void update_offset_stride()
bool modified(const BufferParams &other) const
const BufferPass * find_pass(string_view name) const
const BufferPass * get_actual_display_pass(PassType type, PassMode mode=PassMode::NOISY) const
bool use_transparent_background
PassInfo get_info() const
PassInfo get_info() const
static const NodeEnum * get_type_enum()
static const NodeEnum * get_mode_enum()
device_vector< float > buffer
void reset(const BufferParams ¶ms)
RenderBuffers(Device *device)
device_ptr device_pointer
T * alloc(size_t width, size_t height=0, size_t depth=0)
#define CCL_NAMESPACE_END
@ PASS_SHADOW_CATCHER_MATTE
#define DCHECK(expression)
#define SOCKET_FLOAT(name, ui_name, default_value,...)
#define SOCKET_INT(name, ui_name, default_value,...)
#define NODE_DEFINE(structname)
#define SOCKET_BOOLEAN(name, ui_name, default_value,...)
#define SOCKET_STRING(name, ui_name, default_value,...)
#define SOCKET_ENUM(name, ui_name, values, default_value,...)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)