33 *r_disabled_hint =
"Not a shader node tree";
41 const char **r_disabled_hint)
44 *r_disabled_hint =
"Not a shader or geometry node tree";
51 struct bNodeType *ntype,
int type,
const char *name,
short nclass,
short flag)
109 memset(gs, 0,
sizeof(*gs));
166 for (sock = sockets->
first, i = 0; sock; sock = sock->
next, i++) {
178 for (sock = sockets->
first, i = 0; sock; sock = sock->
next, i++) {
187 bool hasgroup =
false;
195 activetexnode =
node;
224 return activetexnode;
255 for (n = 0, nodeexec =
exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
261 if ((output_node !=
NULL) && (
node == output_node)) {
270 if (
node->typeinfo->gpu_fn) {
274 if (
node->typeinfo->gpu_fn(mat,
node, &nodeexec->
data, gpuin, gpuout)) {
284 if (
node->branch_tag == 1) {
286 GPU_link(mat,
"dfdx_v3", *link, link);
288 else if (
node->branch_tag == 2) {
290 GPU_link(mat,
"dfdy_v3", *link, link);
317 static float max[3] = {FLT_MAX, FLT_MAX, FLT_MAX};
318 static float min[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
319 GPUNodeLink *tmin, *tmax, *tmat0, *tmat1, *tmat2, *tmat3;
328 GPU_link(mat,
"mapping_mat4", in[0].link, tmat0, tmat1, tmat2, tmat3, tmin, tmax, &in[0].link);
331 GPU_link(mat,
"vector_normalize", in[0].link, &in[0].link);
#define NODE_CLASS_OUTPUT
void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
#define NODE_CLASS_TEXTURE
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])
#define NODE_ACTIVE_TEXTURE
#define TEXMAP_TYPE_NORMAL
#define TEXMAP_UNIT_MATRIX
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
GPUNodeLink * GPU_builtin(eGPUBuiltin builtin)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name)
GPUNodeLink * GPU_uniform(const float *num)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out)
bNode * nodeGetActiveTexture(bNodeTree *ntree)
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *UNUSED(out))
bool sh_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
static bool sh_fn_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node)
void sh_fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
static void gpu_stack_from_data_list(GPUNodeStack *gs, ListBase *sockets, bNodeStack **ns)
static void data_from_gpu_stack_list(ListBase *sockets, bNodeStack **ns, GPUNodeStack *gs)
void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
void node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link)
void node_update_internal_links_default(bNodeTree *ntree, bNode *node)
struct GPUNodeLink * link
struct bNodeSocket * next
bool(* poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint)
void(* update_internal_links)(struct bNodeTree *, struct bNode *node)
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)