gKit2 light
compute_image.glsl
Go to the documentation of this file.
1 
3 
4 #version 430
5 
6 #ifdef COMPUTE_SHADER
7 
8 layout(binding= 0, rgba32f) readonly uniform image2D a;
9 layout(binding= 1, rgba32f) writeonly uniform image2D b;
10 
11 layout(local_size_x= 8, local_size_y= 8) in;
12 void main( )
13 {
14  vec4 pixel= imageLoad(a, ivec2(gl_GlobalInvocationID.xy));
15  pixel= pixel / vec4(2, 2, 2, 1); // ne modifie pas alpha...
16 
17  imageStore(b, ivec2(gl_GlobalInvocationID.xy), pixel);
18 }
19 
20 #endif
vecteur generique 4d, ou 3d homogene, utilitaire.
Definition: vec.h:168