chore: initial commit
This commit is contained in:
commit
9e4f531bd4
25 files changed
+4232
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#version 460
|
||||
|
||||
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||
layout(set = 0, binding = 0) buffer Data {
|
||||
uint data[];
|
||||
} buf;
|
||||
|
||||
void main() {
|
||||
uint idx = gl_GlobalInvocationID.x;
|
||||
buf.data[idx] *= 12;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#version 460
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
layout(set = 0, binding = 0, rgba8) uniform writeonly image2D img;
|
||||
|
||||
void main() {
|
||||
// Some normalized xy coord, plus 0.5, which gets the center of a pixel. Then it is
|
||||
// normalized to the size of the image.
|
||||
vec2 norm_coords = (gl_GlobalInvocationID.xy + vec2(0.5)) / vec2(imageSize(img));
|
||||
// Need to look this up - not sure what this is.
|
||||
// C is in the set when it is diverging when iterated from z = 0.
|
||||
vec2 c = (norm_coords - vec2(0.5)) * 2.0 - vec2(1.0, 0.0);
|
||||
vec2 z = vec2(0.0);
|
||||
|
||||
float i;
|
||||
for (i = 0.0; i < 1.0; i += 0.005) {
|
||||
z = vec2(
|
||||
(z.x * z.x) - (z.y * z.y) + c.x,
|
||||
(z.y * z.x) + (z.x * z.y) + c.y
|
||||
);
|
||||
|
||||
if (length(z) > 4.0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vec4 to_write = vec4(vec3(i), 1.0);
|
||||
imageStore(img, ivec2(gl_GlobalInvocationID.xy), to_write);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#version 460
|
||||
|
||||
layout(location = 0) out vec4 f_color;
|
||||
|
||||
void main() {
|
||||
f_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#version 460
|
||||
|
||||
layout(location = 0) in vec2 position;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(position, 0.0, 1.0);
|
||||
}
|
||||
Reference in new issue
Block a user