Blender V5.0
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
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*/,
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_->identifier, 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, "ShaderNodeCameraData", SH_NODE_CAMERA);
47 ntype.ui_name = "Camera Data";
48 ntype.ui_description =
49 "Retrieve information about the camera and how it relates to the current shading point's "
50 "position";
51 ntype.enum_name_legacy = "CAMERA";
53 ntype.declare = file_ns::node_declare;
54 ntype.gpu_fn = file_ns::gpu_shader_camera;
55 ntype.materialx_fn = file_ns::node_shader_materialx;
56
58}
#define NODE_CLASS_INPUT
Definition BKE_node.hh:447
#define SH_NODE_CAMERA
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
#define in
#define out
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
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, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:238
NodeMaterialXFunction materialx_fn
Definition BKE_node.hh:344
std::string ui_description
Definition BKE_node.hh:244
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:342
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362