20 #include "../node_shader_util.h"
25 {
SOCK_FLOAT,
N_(
"Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f},
26 {
SOCK_RGBA,
N_(
"Color"), 0.5f, 0.5f, 1.0f, 1.0f, 0.0f, 1.0f},
31 {
SOCK_VECTOR,
N_(
"Normal"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
60 strength = in[0].
link;
62 else if (
node->original) {
73 newnormal = in[1].
link;
75 else if (
node->original) {
84 const char *color_to_normal_fnc_name =
"color_to_normal_new_shading";
86 color_to_normal_fnc_name =
"color_to_blender_normal_new_shading";
89 GPU_link(mat, color_to_normal_fnc_name, newnormal, &newnormal);
112 GPU_link(mat,
"node_normal_map_mix", strength, newnormal, oldnormal, &out[0].link);
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
#define SH_NODE_NORMAL_MAP
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
#define NODE_CLASS_OP_VECTOR
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
void nodeRegisterType(struct bNodeType *ntype)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define SHD_SPACE_TANGENT
#define SHD_SPACE_BLENDER_OBJECT
#define SHD_SPACE_BLENDER_WORLD
GPUNodeLink * GPU_builtin(eGPUBuiltin builtin)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name)
GPUNodeLink * GPU_constant(const float *num)
GPUNodeLink * GPU_uniform(const float *num)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void *(* MEM_callocN)(size_t len, const char *str)
static int gpu_shader_normal_map(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
void register_node_type_sh_normal_map(void)
static bNodeSocketTemplate sh_node_normal_map_in[]
static void node_shader_init_normal_map(bNodeTree *UNUSED(ntree), bNode *node)
static bNodeSocketTemplate sh_node_normal_map_out[]
static void node_shader_exec_normal_map(void *UNUSED(data), int UNUSED(thread), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
struct GPUNodeLink * link
Compact definition of a node socket.