gKit2 light
Loading...
Searching...
No Matches
vertex_compute.glsl
Go to the documentation of this file.
1
3
4#version 430
5
6#ifdef COMPUTE_SHADER
7
8layout(std430, binding= 1) readonly buffer vertexData
9{
10 vec3 data[];
11};
12
13layout(std430, binding= 0) writeonly buffer transformedData
14{
15 vec4 transformed[];
16};
17
18uniform mat4 mvpMatrix;
19
20layout(local_size_x= 256) in;
21void main( )
22{
23 // recupere l'indice du thread
24 const uint ID= gl_GlobalInvocationID.x;
25
26 // chaque thread transforme le sommet d'indice ID...
27 if(ID < data.length())
28 transformed[ID]= mvpMatrix * vec4(data[ID], 1);
29}
30#endif
31
vecteur generique, utilitaire.
Definition vec.h:169
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition vec.h:192