32 const char **r_disabled_hint)
35 *r_disabled_hint =
RPT_(
"Not a shader node tree");
43 const char **r_disabled_hint)
45 if (!
STR_ELEM(ntree->
idname,
"ShaderNodeTree",
"GeometryNodeTree")) {
46 *r_disabled_hint =
RPT_(
"Not a shader or geometry node tree");
54 const char **r_disabled_hint)
56 if (!
STR_ELEM(ntree->
idname,
"ShaderNodeTree",
"GeometryNodeTree",
"CompositorNodeTree")) {
57 *r_disabled_hint =
RPT_(
"Not a shader, geometry, or compositor node tree");
65 const std::optional<int16_t> legacy_type)
76 const std::optional<int16_t> legacy_type)
87 const std::optional<int16_t> legacy_type)
127 return STREQ(engine_type->
idname,
"BLENDER_EEVEE") ||
135 const float *from = ns->
vec;
142 *
in = (from[0] + from[1] + from[2]) / 3.0f;
174 memset(gs, 0,
sizeof(*gs));
255 switch (sub_activity) {
268 bNode *inactivenode =
nullptr, *activetexnode =
nullptr, *activegroup =
nullptr;
269 bool hasgroup =
false;
275 for (
bNode *node : ntree->all_nodes()) {
276 if (node->flag & sub_activity) {
277 activetexnode = node;
306 return activetexnode;
311 for (
bNode *node : ntree->all_nodes()) {
314 if (tnode && ((tnode->
flag & sub_activity) || !inactivenode)) {
340 const int *depth_level)
353 for (n = 0, nodeexec =
exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
354 node = nodeexec->
node;
356 if (depth_level && node->
runtime->tmp_flag != *depth_level) {
363 if ((output_node !=
nullptr) && (node == output_node)) {
368 do_it = node->
runtime->need_exec;
378 if (node->
typeinfo->gpu_fn(mat, node, &nodeexec->
data, gpuin, gpuout)) {
388 GPU_link(mat,
"differentiate_texco", *link, link);
412 GPUNodeLink *tmin, *tmax, *tmat0, *tmat1, *tmat2, *tmat3;
421 GPU_link(mat,
"mapping_mat4",
in[0].link, tmat0, tmat1, tmat2, tmat3, tmin, tmax, &
in[0].link);
424 GPU_link(mat,
"vector_normalize",
in[0].link, &
in[0].link);
445 return socket.
link || socket.
vec[0] > 1e-5f;
449 return socket.
link || socket.
vec[0] < 1.0f || socket.
vec[1] < 1.0f || socket.
vec[2] < 1.0f;
453 return socket.
link || socket.
vec[0] > 1e-5f || socket.
vec[1] > 1e-5f || socket.
vec[2] > 1e-5f;
SpaceNode * CTX_wm_space_node(const bContext *C)
RenderEngineType * CTX_data_engine_type(const bContext *C)
#define NODE_CLASS_OUTPUT
#define NODE_CLASS_TEXTURE
#define SH_NODE_TEX_IMAGE
#define SH_NODE_ATTRIBUTE
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v4(float r[4])
@ NODE_ACTIVE_PAINT_CANVAS
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeLink * GPU_uniform(const float *num)
blender::float3x3 IMB_colormanagement_get_xyz_to_scene_linear()
BMesh const char void * data
bNode * node_get_active(bNodeTree &ntree)
bNode * node_get_active_texture(bNodeTree &ntree)
void node_type_base(bNodeType &ntype, std::string idname, std::optional< int16_t > legacy_type=std::nullopt)
bNode * node_get_active_paint_canvas(bNodeTree &ntree)
bool node_supports_active_flag(const bNode &node, int sub_activity)
Does the given node supports the sub active flag.
void search_link_ops_for_basic_node(GatherLinkSearchOpParams ¶ms)
MatBase< float, 3, 3 > float3x3
color xyz_to_rgb(float x, float y, float z)
void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out)
bool line_style_shader_nodes_poll(const bContext *C)
void sh_geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *)
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
static bool common_poll_default(const blender::bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)
bool node_socket_not_white(const GPUNodeStack &socket)
bool object_cycles_shader_nodes_poll(const bContext *C)
static void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
void get_XYZ_to_RGB_for_gpu(XYZ_to_RGB *data)
bool object_shader_nodes_poll(const bContext *C)
bool object_eevee_shader_nodes_poll(const bContext *C)
static bool sh_geo_poll_default(const blender::bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
bool node_socket_not_black(const GPUNodeStack &socket)
bool world_shader_nodes_poll(const bContext *C)
static bNode * node_get_active(bNodeTree *ntree, int sub_activity)
bool node_socket_not_zero(const GPUNodeStack &socket)
static void gpu_stack_from_data_list(GPUNodeStack *gs, ListBase *sockets, bNodeStack **ns)
void common_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_gpu_stack_from_data(GPUNodeStack *gs, int type, bNodeStack *ns)
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node, const int *depth_level)
static void data_from_gpu_stack_list(ListBase *sockets, bNodeStack **ns, GPUNodeStack *gs)
bool sh_node_poll_default(const blender::bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
static void exec(void *data, int, bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
bool node_insert_link_default(blender::bke::NodeInsertLinkParams &)
bNodeTypeHandle * typeinfo
bNodeRuntimeHandle * runtime
bool(* insert_link)(NodeInsertLinkParams ¶ms)
bool(* poll)(const bNodeType *ntype, const bNodeTree *nodetree, const char **r_disabled_hint)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops