Blender V4.3
node_shader_camera.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "node_shader_util.hh"
10
12
14{
15 b.add_output<decl::Vector>("View Vector");
16 b.add_output<decl::Float>("View Z Depth");
17 b.add_output<decl::Float>("View Distance");
18}
19
21 bNode *node,
22 bNodeExecData * /*execdata*/,
23 GPUNodeStack *in,
24 GPUNodeStack *out)
25{
26 return GPU_stack_link(mat, node, "camera", in, out);
27}
28
30#ifdef WITH_MATERIALX
31{
32 /* NOTE: This node doesn't have an implementation in MaterialX. */
33 return get_output_default(socket_out_->name, NodeItem::Type::Any);
34}
35#endif
37
38} // namespace blender::nodes::node_shader_camera_cc
39
41{
42 namespace file_ns = blender::nodes::node_shader_camera_cc;
43
44 static blender::bke::bNodeType ntype;
45
46 sh_node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT);
47 ntype.declare = file_ns::node_declare;
48 ntype.gpu_fn = file_ns::gpu_shader_camera;
49 ntype.materialx_fn = file_ns::node_shader_materialx;
50
52}
#define SH_NODE_CAMERA
Definition BKE_node.hh:903
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_camera(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_camera()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeMaterialXFunction materialx_fn
Definition BKE_node.hh:320
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347