Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL400/ComputeCS.glsl @ 12206

Last change on this file since 12206 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

File size: 538 bytes
Line 
1#version 430
2
3layout(binding = 0, rgba8) coherent uniform image2D image_data;
4
5uniform float roll;
6
7layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
8
9// source/ details: http://wili.cc/blog/opengl-cs.html
10void main()
11{
12    ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
13
14    float localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0);
15    float globalCoef = sin(float(gl_WorkGroupID.x+gl_WorkGroupID.y)*0.1 + roll)*0.5;
16    imageStore(image_data, storePos, vec4(vec2(1.0-globalCoef*localCoef),1.0,1.0));
17}
Note: See TracBrowser for help on using the repository browser.