fractal #1

Merged
Persson-dev merged 21 commits from fractal into main 2025-11-09 15:41:00 +00:00
Showing only changes of commit b54bb6a136 - Show all commits

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;
} }