30 const char **r_disabled_hint)
33 *r_disabled_hint =
RPT_(
"Not a shader node tree");
41 const char **r_disabled_hint)
43 if (!
STR_ELEM(ntree->
idname,
"ShaderNodeTree",
"GeometryNodeTree")) {
44 *r_disabled_hint =
RPT_(
"Not a shader or geometry node tree");
99 return STREQ(engine_type->
idname,
"BLENDER_EEVEE") ||
107 const float *from = ns->
vec;
114 *in = (from[0] + from[1] + from[2]) / 3.0f;
146 memset(gs, 0,
sizeof(*gs));
227 switch (sub_activity) {
240 bNode *inactivenode =
nullptr, *activetexnode =
nullptr, *activegroup =
nullptr;
241 bool hasgroup =
false;
247 for (
bNode *node : ntree->all_nodes()) {
248 if (node->flag & sub_activity) {
249 activetexnode =
node;
278 return activetexnode;
283 for (
bNode *node : ntree->all_nodes()) {
286 if (tnode && ((tnode->
flag & sub_activity) || !inactivenode)) {
322 for (n = 0, nodeexec =
exec->nodeexec; n <
exec->totnodes; n++, nodeexec++) {
323 node = nodeexec->
node;
325 if (depth_level && node->runtime->tmp_flag != *depth_level) {
332 if ((output_node !=
nullptr) && (node == output_node)) {
337 do_it = node->
runtime->need_exec;
338 node->runtime->need_exec = 0;
342 BLI_assert(!depth_level || node->runtime->tmp_flag >= 0);
343 if (node->typeinfo->gpu_fn) {
347 if (node->typeinfo->gpu_fn(mat, node, &nodeexec->
data, gpuin, gpuout)) {
357 GPU_link(mat,
"differentiate_texco", *link, link);
381 GPUNodeLink *tmin, *tmax, *tmat0, *tmat1, *tmat2, *tmat3;
390 GPU_link(mat,
"mapping_mat4", in[0].link, tmat0, tmat1, tmat2, tmat3, tmin, tmax, &in[0].link);
393 GPU_link(mat,
"vector_normalize", in[0].link, &in[0].link);
414 return socket.
link || socket.
vec[0] > 1e-5f;
418 return socket.
link || socket.
vec[0] < 1.0f || socket.
vec[1] < 1.0f || socket.
vec[2] < 1.0f;
422 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 SH_NODE_TEX_IMAGE
#define NODE_CLASS_TEXTURE
#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()
bNode * node_get_active_texture(bNodeTree *ntree)
bool node_supports_active_flag(const bNode *node, int sub_active)
Does the given node supports the sub active flag.
bNode * node_get_active_paint_canvas(bNodeTree *ntree)
bNode * node_get_active(bNodeTree *ntree)
void node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void search_link_ops_for_basic_node(GatherLinkSearchOpParams ¶ms)
color xyz_to_rgb(float x, float y, float z)
void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out)
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
bool line_style_shader_nodes_poll(const bContext *C)
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)
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)
void sh_fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
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)
bool node_socket_not_black(const GPUNodeStack &socket)
static bool sh_fn_poll_default(const blender::bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
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 node_gpu_stack_from_data(GPUNodeStack *gs, int type, bNodeStack *ns)
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node, 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(bNodeTree *, bNode *, bNodeLink *)
bNodeRuntimeHandle * runtime
bool(* poll)(const bNodeType *ntype, const bNodeTree *nodetree, const char **r_disabled_hint)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
bool(* insert_link)(bNodeTree *ntree, bNode *node, bNodeLink *link)