24 #include "../node_shader_util.h"
28 {
SOCK_VECTOR,
N_(
"Vector"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f,
PROP_NONE}, {-1,
""}};
38 "NodeShaderVectTransform");
100 const char *vtransform =
"direction_transform_m4v3";
101 const char *ptransform =
"point_transform_m4v3";
102 const char *func_name = 0;
106 if (in[0].hasinput) {
107 inputlink = in[0].
link;
121 GPU_link(mat,
"invert_z", inputlink, &inputlink);
123 GPU_link(mat, func_name, inputlink, fromto, &out[0].link);
126 GPU_link(mat,
"invert_z", out[0].link, &out[0].link);
130 GPU_link(mat,
"set_rgb", inputlink, &out[0].link);
134 GPU_link(mat,
"vector_normalize", out[0].link, &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)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
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)
#define SHD_VECT_TRANSFORM_TYPE_NORMAL
#define SHD_VECT_TRANSFORM_TYPE_POINT
#define SHD_VECT_TRANSFORM_SPACE_OBJECT
#define SHD_VECT_TRANSFORM_SPACE_CAMERA
#define SHD_VECT_TRANSFORM_SPACE_WORLD
GPUNodeLink * GPU_builtin(eGPUBuiltin builtin)
GPUNodeLink * GPU_constant(const float *num)
@ GPU_INVERSE_OBJECT_MATRIX
@ GPU_INVERSE_VIEW_MATRIX
@ GPU_INVERSE_LOC_TO_VIEW_MATRIX
bool GPU_link(GPUMaterial *mat, const char *name,...)
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture SH_NODE_VECT_TRANSFORM
void *(* MEM_callocN)(size_t len, const char *str)
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.