48
static void node_shader_exec_squeeze(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out)
48
static void node_shader_exec_squeeze(void *UNUSED(data), int UNUSED(thread), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), bNodeStack **in, bNodeStack **out)
52
52
nodestack_get_vec(vec, SOCK_FLOAT, in[0]);
53
nodestack_get_vec(vec+1, SOCK_FLOAT, in[1]);
54
nodestack_get_vec(vec+2, SOCK_FLOAT, in[2]);
53
nodestack_get_vec(vec + 1, SOCK_FLOAT, in[1]);
54
nodestack_get_vec(vec + 2, SOCK_FLOAT, in[2]);
56
56
out[0]->vec[0] = 1.0f / (1.0f + powf(M_E, -((vec[0] - vec[2]) * vec[1])));
59
static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
59
static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
61
61
return GPU_stack_link(mat, "squeeze", in, out);
64
void register_node_type_sh_squeeze(bNodeTreeType *ttype)
64
void register_node_type_sh_squeeze(void)
66
66
static bNodeType ntype;
68
node_type_base(ttype, &ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
68
sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, 0);
69
69
node_type_compatibility(&ntype, NODE_OLD_SHADING);
70
70
node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out);
71
node_type_size(&ntype, 120, 110, 160);
72
71
node_type_storage(&ntype, "node_squeeze", NULL, NULL);
73
node_type_exec(&ntype, node_shader_exec_squeeze);
72
node_type_exec(&ntype, NULL, NULL, node_shader_exec_squeeze);
74
73
node_type_gpu(&ntype, gpu_shader_squeeze);
76
nodeRegisterType(ttype, &ntype);
75
nodeRegisterType(&ntype);