matrix multiplcation

This commit is contained in:
2025-11-09 11:19:22 +01:00
parent ba6a342c94
commit b54bb6a136

View File

@@ -20,11 +20,19 @@ void main() {
const uint total = gl_NumWorkGroups.x * gl_WorkGroupSize.x; const uint total = gl_NumWorkGroups.x * gl_WorkGroupSize.x;
uint currentPoint = gl_GlobalInvocationID.x; uint currentPoint = gl_GlobalInvocationID.x;
uint index = uint(rand(o_Points[currentPoint] + currentPoint) * 69); uint index = uint(rand(o_Points[currentPoint] + currentPoint) * 69);
if (index % 3 == 0) { mat3 transformation;
o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(0, 0.36); switch (index % 3) {
} else if (index % 3 == 1) { case 0:
o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(-0.5, -0.5); transformation = mat3(0.5, 0, 0, 0, 0.5, 0, 0, 0.36, 1);
} else { break;
o_Points[currentPoint] = o_Points[currentPoint] / 2 + vec2(0.5, -0.5);
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;
} }