mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
28 lines
921 B
C#
28 lines
921 B
C#
#version 430 core
|
|
|
|
layout (local_size_x = 10, local_size_y = 10, local_size_z = 1) in;
|
|
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// uniforms
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
|
|
layout(rgba32f, binding = 0) uniform image2D imgOutput;
|
|
|
|
layout (location = 0) uniform float t; /** Time */
|
|
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// functions
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
|
|
void main() {
|
|
vec4 value = vec4(0.0, 0.0, 0.0, 1.0);
|
|
ivec2 texelCoord = ivec2(gl_GlobalInvocationID.xy);
|
|
float speed = 0.5;
|
|
value.x = float(int((float(texelCoord.x)/(gl_NumWorkGroups.x*gl_WorkGroupSize.x)+t*speed)*100)%100)/100;
|
|
value.y = float(texelCoord.y)/(gl_NumWorkGroups.y*gl_WorkGroupSize.y);
|
|
imageStore(imgOutput, texelCoord, value);
|
|
} |