~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/nodes/shader/nodes/node_shader_squeeze.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        { -1, 0, "" }
46
46
};
47
47
 
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)
49
49
{
50
50
        float vec[3];
51
51
        
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]);
55
55
 
56
56
        out[0]->vec[0] = 1.0f / (1.0f + powf(M_E, -((vec[0] - vec[2]) * vec[1])));
57
57
}
58
58
 
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)
60
60
{
61
61
        return GPU_stack_link(mat, "squeeze", in, out);
62
62
}
63
63
 
64
 
void register_node_type_sh_squeeze(bNodeTreeType *ttype)
 
64
void register_node_type_sh_squeeze(void)
65
65
{
66
66
        static bNodeType ntype;
67
67
 
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);
75
74
 
76
 
        nodeRegisterType(ttype, &ntype);
 
75
        nodeRegisterType(&ntype);
77
76
}