Blender
V4.5
source
blender
nodes
shader
node_shader_util.hh
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
#pragma once
10
11
#include <cfloat>
12
#include <optional>
13
14
#include "
BLI_listbase.h
"
// IWYU pragma: export
15
16
#include "
BKE_node.hh
"
17
#include "
BKE_node_legacy_types.hh
"
// IWYU pragma: export
18
19
#include "
DNA_node_types.h
"
20
21
#include "
GPU_material.hh
"
22
23
#include "
NOD_socket_declarations.hh
"
// IWYU pragma: export
24
25
#include "
node_shader_register.hh
"
// IWYU pragma: export
26
27
#ifdef WITH_MATERIALX
28
# include "
materialx/node_parser.h
"
// IWYU pragma: export
29
#else
30
# define NODE_SHADER_MATERIALX_BEGIN \
31
blender::bke::NodeMaterialXFunction node_shader_materialx = nullptr;
32
# define NODE_SHADER_MATERIALX_END
33
#endif
34
35
struct
bContext
;
36
struct
bNodeExecContext
;
37
struct
bNodeTreeExec
;
38
struct
GPUNodeLink
;
39
struct
GPUNodeStack
;
40
struct
GPUMaterial
;
41
42
bool
sh_node_poll_default
(
const
blender::bke::bNodeType
*ntype,
43
const
bNodeTree
*ntree,
44
const
char
**r_disabled_hint);
45
void
sh_node_type_base
(
blender::bke::bNodeType
*ntype,
46
std::string idname,
47
std::optional<int16_t> legacy_type = std::nullopt);
48
void
common_node_type_base
(
blender::bke::bNodeType
*ntype,
49
std::string idname,
50
std::optional<int16_t> legacy_type = std::nullopt);
51
bool
line_style_shader_nodes_poll
(
const
bContext
*
C
);
52
bool
world_shader_nodes_poll
(
const
bContext
*
C
);
53
bool
object_shader_nodes_poll
(
const
bContext
*
C
);
54
bool
object_cycles_shader_nodes_poll
(
const
bContext
*
C
);
55
bool
object_eevee_shader_nodes_poll
(
const
bContext
*
C
);
56
57
/* ********* exec data struct, remains internal *********** */
58
59
struct
XYZ_to_RGB
/* Transposed #imbuf_xyz_to_rgb, passed as 3x vec3. */
60
{
61
float
r
[3],
g
[3],
b
[3];
62
};
63
64
void
node_gpu_stack_from_data
(
GPUNodeStack
*gs,
int
type,
bNodeStack
*ns);
65
void
node_data_from_gpu_stack
(
bNodeStack
*ns,
GPUNodeStack
*gs);
66
void
node_shader_gpu_bump_tex_coord
(
GPUMaterial
*mat,
bNode
*node,
GPUNodeLink
**link);
67
void
node_shader_gpu_default_tex_coord
(
GPUMaterial
*mat,
bNode
*node,
GPUNodeLink
**link);
68
void
node_shader_gpu_tex_mapping
(
GPUMaterial
*mat,
69
bNode
*node,
70
GPUNodeStack
*
in
,
71
GPUNodeStack
*
out
);
72
73
bNodeTreeExec
*
ntreeShaderBeginExecTree_internal
(
bNodeExecContext
*context,
74
bNodeTree
*ntree,
75
bNodeInstanceKey
parent_key);
76
void
ntreeShaderEndExecTree_internal
(
bNodeTreeExec
*
exec
);
77
78
/* If depth_level is not null, only nodes where `node->runtime->tmp_flag == depth_level` will be
79
* executed. This allows finer control over node execution order without modifying the tree
80
* topology. */
81
void
ntreeExecGPUNodes
(
bNodeTreeExec
*
exec
,
82
GPUMaterial
*mat,
83
bNode
*output_node,
84
const
int
*depth_level =
nullptr
);
85
86
void
get_XYZ_to_RGB_for_gpu
(
XYZ_to_RGB
*
data
);
87
88
bool
node_socket_not_zero
(
const
GPUNodeStack
&socket);
89
bool
node_socket_not_white
(
const
GPUNodeStack
&socket);
90
bool
node_socket_not_black
(
const
GPUNodeStack
&socket);
BKE_node.hh
BKE_node_legacy_types.hh
BLI_listbase.h
DNA_node_types.h
GPU_material.hh
NOD_socket_declarations.hh
C
#define C
Definition
RandGen.cpp:29
data
BMesh const char void * data
Definition
bmesh_iterators_inline.hh:37
in
#define in
Definition
gpu_glsl_cpp_stubs.hh:949
out
#define out
Definition
gpu_glsl_cpp_stubs.hh:947
node_parser.h
node_shader_register.hh
sh_node_poll_default
bool sh_node_poll_default(const blender::bke::bNodeType *ntype, const bNodeTree *ntree, const char **r_disabled_hint)
Definition
node_shader_util.cc:30
ntreeShaderBeginExecTree_internal
bNodeTreeExec * ntreeShaderBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
Definition
node_shader_tree.cc:1275
line_style_shader_nodes_poll
bool line_style_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:72
node_shader_gpu_default_tex_coord
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
Definition
node_shader_util.cc:369
common_node_type_base
void common_node_type_base(blender::bke::bNodeType *ntype, std::string idname, std::optional< int16_t > legacy_type=std::nullopt)
Definition
node_shader_util.cc:63
node_shader_gpu_tex_mapping
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
Definition
node_shader_util.cc:377
node_data_from_gpu_stack
void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)
Definition
node_shader_util.cc:200
node_socket_not_white
bool node_socket_not_white(const GPUNodeStack &socket)
Definition
node_shader_util.cc:425
node_shader_gpu_bump_tex_coord
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
Definition
node_shader_util.cc:364
object_cycles_shader_nodes_poll
bool object_cycles_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:90
ntreeExecGPUNodes
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node, const int *depth_level=nullptr)
Definition
node_shader_util.cc:315
get_XYZ_to_RGB_for_gpu
void get_XYZ_to_RGB_for_gpu(XYZ_to_RGB *data)
Definition
node_shader_util.cc:407
object_shader_nodes_poll
bool object_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:84
object_eevee_shader_nodes_poll
bool object_eevee_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:99
node_socket_not_black
bool node_socket_not_black(const GPUNodeStack &socket)
Definition
node_shader_util.cc:429
sh_node_type_base
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, std::optional< int16_t > legacy_type=std::nullopt)
Definition
node_shader_util.cc:52
world_shader_nodes_poll
bool world_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:78
node_socket_not_zero
bool node_socket_not_zero(const GPUNodeStack &socket)
Definition
node_shader_util.cc:421
node_gpu_stack_from_data
void node_gpu_stack_from_data(GPUNodeStack *gs, int type, bNodeStack *ns)
Definition
node_shader_util.cc:150
ntreeShaderEndExecTree_internal
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec)
Definition
node_shader_tree.cc:1317
exec
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
Definition
node_texture_at.cc:31
GPUMaterial
Definition
gpu/intern/gpu_material.cc:60
GPUNodeLink
Definition
gpu_node_graph.hh:78
GPUNodeStack
Definition
GPU_material.hh:272
XYZ_to_RGB
Definition
node_shader_util.hh:60
XYZ_to_RGB::r
float r[3]
Definition
node_shader_util.hh:61
XYZ_to_RGB::b
float b[3]
Definition
node_shader_util.hh:61
XYZ_to_RGB::g
float g[3]
Definition
node_shader_util.hh:61
bContext
Definition
blenkernel/intern/context.cc:58
bNodeExecContext
Definition
node_util.hh:17
bNodeInstanceKey
Definition
DNA_node_types.h:647
bNodeStack
Definition
DNA_node_types.h:85
bNodeTreeExec
Definition
node_exec.hh:32
bNodeTree
Definition
DNA_node_types.h:752
bNode
Definition
DNA_node_types.h:415
blender::bke::bNodeType
Defines a node type.
Definition
BKE_node.hh:226
Generated on
for Blender by
doxygen
1.16.1