From ff76cf3cd668e24de0e4c1847f45fc6b06adb43f Mon Sep 17 00:00:00 2001 From: "Jonas_sorgenfrei@yahoo.de" Date: Wed, 8 Jun 2022 01:37:24 +0200 Subject: [PATCH] reader comment adjustment --- .../2022/5.computeshader_helloworld/computeShader.cs | 7 +++++-- ...ader_hello_world.cpp => compute_shader_hello_world.cpp} | 0 2 files changed, 5 insertions(+), 2 deletions(-) rename src/8.guest/2022/5.computeshader_helloworld/{computer_shader_hello_world.cpp => compute_shader_hello_world.cpp} (100%) diff --git a/src/8.guest/2022/5.computeshader_helloworld/computeShader.cs b/src/8.guest/2022/5.computeshader_helloworld/computeShader.cs index b4e3954..0c9621c 100644 --- a/src/8.guest/2022/5.computeshader_helloworld/computeShader.cs +++ b/src/8.guest/2022/5.computeshader_helloworld/computeShader.cs @@ -21,8 +21,11 @@ layout (location = 0) uniform float t; /** Time */ 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; + 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); } \ No newline at end of file diff --git a/src/8.guest/2022/5.computeshader_helloworld/computer_shader_hello_world.cpp b/src/8.guest/2022/5.computeshader_helloworld/compute_shader_hello_world.cpp similarity index 100% rename from src/8.guest/2022/5.computeshader_helloworld/computer_shader_hello_world.cpp rename to src/8.guest/2022/5.computeshader_helloworld/compute_shader_hello_world.cpp