diff --git a/Shaders/Compute.glsl b/Shaders/Compute.glsl index 7b41fe4..a94ab8d 100644 --- a/Shaders/Compute.glsl +++ b/Shaders/Compute.glsl @@ -20,11 +20,19 @@ void main() { const uint total = gl_NumWorkGroups.x * gl_WorkGroupSize.x; uint currentPoint = gl_GlobalInvocationID.x; uint index = uint(rand(o_Points[currentPoint] + currentPoint) * 69); - if (index % 3 == 0) { - o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(0, 0.36); - } else if (index % 3 == 1) { - o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(-0.5, -0.5); - } else { - o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(0.5, -0.5); + mat3 transformation; + switch (index % 3) { + case 0: + transformation = mat3(0.5, 0, 0, 0, 0.5, 0, 0, 0.36, 1); + break; + + case 1: + transformation = mat3(0.5, 0, 0, 0, 0.5, 0, -0.5, -0.5, 1); + break; + + case 2: + transformation = mat3(0.5, 0, 0, 0, 0.5, 0, 0.5, -0.5, 1); + break; } + o_Points[currentPoint] = (transformation * vec3(o_Points[currentPoint], 1.0)).xy; } \ No newline at end of file