Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static void node_shader_exec_seprgb(void *UNUSED(data), int UNUSED(thread), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), bNodeStack **in, bNodeStack **out) | ||||
| float col[3]; | float col[3]; | ||||
| nodestack_get_vec(col, SOCK_VECTOR, in[0]); | nodestack_get_vec(col, SOCK_VECTOR, in[0]); | ||||
| out[0]->vec[0] = col[0]; | out[0]->vec[0] = col[0]; | ||||
| out[1]->vec[0] = col[1]; | out[1]->vec[0] = col[1]; | ||||
| out[2]->vec[0] = col[2]; | out[2]->vec[0] = col[2]; | ||||
| } | } | ||||
| static int gpu_shader_seprgb(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int gpu_shader_seprgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| return GPU_stack_link(mat, "separate_rgb", in, out); | return GPU_stack_link(mat, node, "separate_rgb", in, out); | ||||
| } | } | ||||
| void register_node_type_sh_seprgb(void) | void register_node_type_sh_seprgb(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0); | sh_node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0); | ||||
| node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | ||||
| Show All 25 Lines | static void node_shader_exec_combrgb(void *UNUSED(data), int UNUSED(thread), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), bNodeStack **in, bNodeStack **out) | ||||
| nodestack_get_vec(&g, SOCK_FLOAT, in[1]); | nodestack_get_vec(&g, SOCK_FLOAT, in[1]); | ||||
| nodestack_get_vec(&b, SOCK_FLOAT, in[2]); | nodestack_get_vec(&b, SOCK_FLOAT, in[2]); | ||||
| out[0]->vec[0] = r; | out[0]->vec[0] = r; | ||||
| out[0]->vec[1] = g; | out[0]->vec[1] = g; | ||||
| out[0]->vec[2] = b; | out[0]->vec[2] = b; | ||||
| } | } | ||||
| static int gpu_shader_combrgb(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int gpu_shader_combrgb(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| return GPU_stack_link(mat, "combine_rgb", in, out); | return GPU_stack_link(mat, node, "combine_rgb", in, out); | ||||
| } | } | ||||
| void register_node_type_sh_combrgb(void) | void register_node_type_sh_combrgb(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, 0); | sh_node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, 0); | ||||
| node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); | ||||
| node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out); | node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out); | ||||
| node_type_exec(&ntype, NULL, NULL, node_shader_exec_combrgb); | node_type_exec(&ntype, NULL, NULL, node_shader_exec_combrgb); | ||||
| node_type_gpu(&ntype, gpu_shader_combrgb); | node_type_gpu(&ntype, gpu_shader_combrgb); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||