Blender
V4.3
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
9
#pragma once
10
11
#include <cfloat>
12
#include <cmath>
13
14
#include "
BKE_node.hh
"
15
16
#include "
DNA_node_types.h
"
17
18
#include "
GPU_material.hh
"
19
20
#include "
NOD_socket_declarations.hh
"
21
22
#include "
node_shader_register.hh
"
23
24
#ifdef WITH_MATERIALX
25
# include "
materialx/node_parser.h
"
26
#else
27
# define NODE_SHADER_MATERIALX_BEGIN \
28
blender::bke::NodeMaterialXFunction node_shader_materialx = nullptr;
29
# define NODE_SHADER_MATERIALX_END
30
#endif
31
32
struct
bContext
;
33
struct
bNodeExecContext
;
34
struct
bNodeTreeExec
;
35
struct
GPUNodeLink
;
36
struct
GPUNodeStack
;
37
struct
GPUMaterial
;
38
39
bool
sh_node_poll_default
(
const
blender::bke::bNodeType
*ntype,
40
const
bNodeTree
*ntree,
41
const
char
**r_disabled_hint);
42
void
sh_node_type_base
(
blender::bke::bNodeType
*ntype,
int
type,
const
char
*name,
short
nclass);
43
void
sh_fn_node_type_base
(
blender::bke::bNodeType
*ntype,
44
int
type,
45
const
char
*name,
46
short
nclass);
47
bool
line_style_shader_nodes_poll
(
const
bContext
*C);
48
bool
world_shader_nodes_poll
(
const
bContext
*C);
49
bool
object_shader_nodes_poll
(
const
bContext
*C);
50
bool
object_cycles_shader_nodes_poll
(
const
bContext
*C);
51
bool
object_eevee_shader_nodes_poll
(
const
bContext
*C);
52
53
/* ********* exec data struct, remains internal *********** */
54
55
struct
XYZ_to_RGB
/* Transposed #imbuf_xyz_to_rgb, passed as 3x vec3. */
56
{
57
float
r
[3],
g
[3],
b
[3];
58
};
59
60
void
node_gpu_stack_from_data
(
GPUNodeStack
*gs,
int
type,
bNodeStack
*ns);
61
void
node_data_from_gpu_stack
(
bNodeStack
*ns,
GPUNodeStack
*gs);
62
void
node_shader_gpu_bump_tex_coord
(
GPUMaterial
*mat,
bNode
*node,
GPUNodeLink
**link);
63
void
node_shader_gpu_default_tex_coord
(
GPUMaterial
*mat,
bNode
*node,
GPUNodeLink
**link);
64
void
node_shader_gpu_tex_mapping
(
GPUMaterial
*mat,
65
bNode
*node,
66
GPUNodeStack
*in,
67
GPUNodeStack
*out);
68
69
bNodeTreeExec
*
ntreeShaderBeginExecTree_internal
(
bNodeExecContext
*context,
70
bNodeTree
*ntree,
71
bNodeInstanceKey
parent_key);
72
void
ntreeShaderEndExecTree_internal
(
bNodeTreeExec
*
exec
);
73
74
/* If depth_level is not null, only nodes where `node->runtime->tmp_flag == depth_level` will be
75
* executed. This allows finer control over node execution order without modifying the tree
76
* topology. */
77
void
ntreeExecGPUNodes
(
bNodeTreeExec
*
exec
,
78
GPUMaterial
*mat,
79
bNode
*output_node,
80
int
*depth_level =
nullptr
);
81
82
void
get_XYZ_to_RGB_for_gpu
(
XYZ_to_RGB
*data);
83
84
bool
node_socket_not_zero
(
const
GPUNodeStack
&socket);
85
bool
node_socket_not_white
(
const
GPUNodeStack
&socket);
86
bool
node_socket_not_black
(
const
GPUNodeStack
&socket);
BKE_node.hh
DNA_node_types.h
GPU_material.hh
NOD_socket_declarations.hh
node_parser.h
node_shader_register.hh
sh_node_type_base
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Definition
node_shader_util.cc:50
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:28
ntreeShaderBeginExecTree_internal
bNodeTreeExec * ntreeShaderBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
Definition
node_shader_tree.cc:1253
line_style_shader_nodes_poll
bool line_style_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:66
node_shader_gpu_default_tex_coord
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
Definition
node_shader_util.cc:360
node_shader_gpu_tex_mapping
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
Definition
node_shader_util.cc:368
node_data_from_gpu_stack
void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)
Definition
node_shader_util.cc:194
node_socket_not_white
bool node_socket_not_white(const GPUNodeStack &socket)
Definition
node_shader_util.cc:416
node_shader_gpu_bump_tex_coord
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
Definition
node_shader_util.cc:355
object_cycles_shader_nodes_poll
bool object_cycles_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:84
sh_fn_node_type_base
void sh_fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Definition
node_shader_util.cc:59
get_XYZ_to_RGB_for_gpu
void get_XYZ_to_RGB_for_gpu(XYZ_to_RGB *data)
Definition
node_shader_util.cc:398
object_shader_nodes_poll
bool object_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:78
object_eevee_shader_nodes_poll
bool object_eevee_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:93
node_socket_not_black
bool node_socket_not_black(const GPUNodeStack &socket)
Definition
node_shader_util.cc:420
world_shader_nodes_poll
bool world_shader_nodes_poll(const bContext *C)
Definition
node_shader_util.cc:72
node_socket_not_zero
bool node_socket_not_zero(const GPUNodeStack &socket)
Definition
node_shader_util.cc:412
node_gpu_stack_from_data
void node_gpu_stack_from_data(GPUNodeStack *gs, int type, bNodeStack *ns)
Definition
node_shader_util.cc:144
ntreeExecGPUNodes
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node, int *depth_level=nullptr)
Definition
node_shader_util.cc:309
ntreeShaderEndExecTree_internal
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec)
Definition
node_shader_tree.cc:1298
exec
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
Definition
node_texture_at.cc:31
GPUMaterial
Definition
gpu_material.cc:71
GPUNodeLink
Definition
gpu_node_graph.hh:80
GPUNodeStack
Definition
GPU_material.hh:96
XYZ_to_RGB
Definition
node_shader_util.hh:56
XYZ_to_RGB::r
float r[3]
Definition
node_shader_util.hh:57
XYZ_to_RGB::b
float b[3]
Definition
node_shader_util.hh:57
XYZ_to_RGB::g
float g[3]
Definition
node_shader_util.hh:57
bContext
Definition
blenkernel/intern/context.cc:61
bNodeExecContext
Definition
node_util.hh:18
bNodeInstanceKey
Definition
DNA_node_types.h:561
bNodeStack
Definition
DNA_node_types.h:86
bNodeTreeExec
Definition
node_exec.hh:36
bNodeTree
Definition
DNA_node_types.h:675
bNode
Definition
DNA_node_types.h:357
blender::bke::bNodeType
Defines a node type.
Definition
BKE_node.hh:218
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0