Blender V5.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
8
9#include "node_shader_util.hh"
10
11namespace blender {
12
14
16{
17 b.add_output<decl::Vector>("View Vector"_ustr);
18 b.add_output<decl::Float>("View Z Depth"_ustr);
19 b.add_output<decl::Float>("View Distance"_ustr);
20}
21
23 bNode *node,
24 bNodeExecData * /*execdata*/,
27{
28 return GPU_stack_link(mat, node, "camera", in, out, GPU_kernel_globals(), GPU_shading_data());
29}
30
32#ifdef WITH_MATERIALX
33{
34 /* NOTE: This node doesn't have an implementation in MaterialX. */
35 return get_output_default(socket_out_->identifier, NodeItem::Type::Any);
36}
37#endif
39
40} // namespace nodes::node_shader_camera_cc
41
43{
44 namespace file_ns = nodes::node_shader_camera_cc;
45
46 static bke::bNodeType ntype;
47
48 sh_node_type_base(&ntype, "ShaderNodeCameraData"_ustr, SH_NODE_CAMERA);
49 ntype.ui_name = "Camera Data";
50 ntype.ui_description =
51 "Retrieve information about the camera and how it relates to the current shading point's "
52 "position";
53 ntype.enum_name_legacy = "CAMERA";
55 ntype.declare = file_ns::node_declare;
56 ntype.gpu_fn = file_ns::gpu_shader_camera;
57 ntype.materialx_fn = file_ns::node_shader_materialx;
58
60}
61
62} // namespace blender
#define NODE_CLASS_INPUT
Definition BKE_node.hh:478
#define SH_NODE_CAMERA
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_camera(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
BMesh Iterators.
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
GPUNodeLink * GPU_shading_data()
void register_node_type_sh_camera()
GPUNodeLink * GPU_kernel_globals()
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
Defines a node type.
Definition BKE_node.hh:265
NodeMaterialXFunction materialx_fn
Definition BKE_node.hh:375
std::string ui_description
Definition BKE_node.hh:271
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:373
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393