~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: SHD_valToRgb.c 12931 2007-12-17 18:20:48Z theeth $
 
2
 * $Id: SHD_valToRgb.c 16366 2008-09-04 20:51:28Z blendix $
3
3
 *
4
4
 * ***** BEGIN GPL LICENSE BLOCK *****
5
5
 *
59
59
   node->storage= add_colorband(1);
60
60
}
61
61
 
 
62
static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
 
63
{
 
64
        float *array;
 
65
        int size;
 
66
 
 
67
        colorband_table_RGBA(node->storage, &array, &size);
 
68
        return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array));
 
69
}
 
70
 
62
71
bNodeType sh_node_valtorgb= {
63
72
        /* *next,*prev */       NULL, NULL,
64
73
        /* type code   */       SH_NODE_VALTORGB,
73
82
        /* initfunc    */       node_shader_init_valtorgb,
74
83
        /* freestoragefunc    */        node_free_standard_storage,
75
84
        /* copystoragefunc    */        node_copy_standard_storage,
76
 
        /* id          */       NULL
 
85
        /* id          */       NULL, NULL, NULL,
 
86
        /* gpufunc     */       gpu_shader_valtorgb
77
87
        
78
88
};
79
89
 
96
106
   out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f;
97
107
}
98
108
 
 
109
static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
 
110
{
 
111
        return GPU_stack_link(mat, "rgbtobw", in, out);
 
112
}
 
113
 
99
114
bNodeType sh_node_rgbtobw= {
100
115
        /* *next,*prev */       NULL, NULL,
101
116
        /* type code   */       SH_NODE_RGBTOBW,
110
125
        /* initfunc    */       NULL,
111
126
        /* freestoragefunc    */        NULL,
112
127
        /* copystoragefunc    */        NULL,
113
 
        /* id          */       NULL
 
128
        /* id          */       NULL, NULL, NULL,
 
129
        /* gpufunc     */       gpu_shader_rgbtobw
114
130
 
115
131
};
116
132