2023-09-08 06:16:32 +00:00
|
|
|
layout (local_size_x = 10, local_size_y = 10, local_size_z = 1) in;
|
|
|
|
|
|
|
|
layout(rgba32f, binding = 0) uniform image2D imgOutput;
|
|
|
|
|
2023-09-08 08:00:26 +00:00
|
|
|
layout (binding = 1) buffer ssbo_data {
|
|
|
|
float t;
|
|
|
|
};
|
2023-09-08 06:16:32 +00:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 value = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
ivec2 texelCoord = ivec2(gl_GlobalInvocationID.xy);
|
|
|
|
|
|
|
|
float speed = 100;
|
|
|
|
// the width of the texture
|
|
|
|
float width = 1000;
|
|
|
|
|
|
|
|
value.x = mod(float(texelCoord.x) + t * speed, width) / (gl_NumWorkGroups.x * gl_WorkGroupSize.x);
|
|
|
|
value.y = float(texelCoord.y)/(gl_NumWorkGroups.y*gl_WorkGroupSize.y);
|
|
|
|
imageStore(imgOutput, texelCoord, value);
|
|
|
|
}
|