Skip to content

Commit 9826d87

Browse files
committed
maybe working server? But idk uwu
1 parent d83aeb9 commit 9826d87

636 files changed

Lines changed: 22025 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Blobtory/Blobtory/.eggs/README.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.
2+
3+
This directory caches those eggs to prevent repeated downloads.
4+
5+
However, it is safe to delete this directory.
6+
128 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
README.md
2+
setup.py
3+
Blobtory.egg-info/PKG-INFO
4+
Blobtory.egg-info/SOURCES.txt
5+
Blobtory.egg-info/dependency_links.txt
6+
Blobtory.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Blobtory/Blobtory/Blobtory.exe

8.85 MB
Binary file not shown.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#version 430
2+
#extension GL_ARB_compute_variable_group_size : enable
3+
#define SIZE 512
4+
layout (local_size_x = SIZE, local_size_y = 1) in;
5+
6+
uniform int gridSize;
7+
uniform float radius;
8+
layout(rgba32f, binding = 0) uniform readonly image1D fromVertexes;
9+
layout(rgba32f, binding = 0) uniform writeonly image1D toVertexes;
10+
11+
vec3 spherize(vec3 cubeCord) {
12+
vec3 p = cubeCord * 2.0 / gridSize - vec3(1,1,1);
13+
vec3 p2 = vec3(p.x*p.x, p.y*p.y, p.z*p.z);
14+
return vec3(
15+
p.x * sqrt(1.0 - 0.5 * (p2.y + p2.z) + p2.y * p2.z / 3.0),
16+
p.y * sqrt(1.0 - 0.5 * (p2.z + p2.x) + p2.z * p2.x / 3.0),
17+
p.z * sqrt(1.0 - 0.5 * (p2.x + p2.y) + p2.x * p2.y / 3.0)
18+
)*radius;
19+
}
20+
21+
void main() {
22+
// Read the pixel from the first texture.
23+
vec4 pixel = imageLoad(fromVertexes, int(gl_GlobalInvocationID.x));
24+
// Swap the red and green channels.
25+
pixel = vec4(spherize(pixel.xyz), 1);
26+
27+
// Now write the modified pixel to the second texture.
28+
imageStore(toVertexes, int(gl_GlobalInvocationID.x), pixel);
29+
//toVertexes[gl_GlobalInvocationID.x] = spherize(fromVertexes[gl_GlobalInvocationID.x]);
30+
//imageStore(kage, ivec2(gl_GlobalInvocationID.x), vec3(1,1,0));
31+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#version 430
2+
3+
#pragma include "three_d.glsl"
4+
5+
// Description:
6+
// This is just a simple compute shader testing include, noise and buffers
7+
//
8+
// Author: Daniel Kierkegaard Andersen (dax@daxode.dk)
9+
// Version: 2020-09-22
10+
//
11+
// Copyright (c) 2020 Daniel Kierkegaard Andersen. All rights reserved.
12+
// https://github.com/Daxode/ComplexSoftwareProject
13+
14+
layout (local_size_x = 512, local_size_y = 1) in;
15+
16+
// Declare the texture inputs
17+
layout(rgba32f, binding=0) uniform readonly image2D fromTex;
18+
uniform writeonly image2D toTex;
19+
uniform vec3[] kage;
20+
uniform vec2 mouse;
21+
22+
uniform writeonly imageBuffer someimg;
23+
24+
void main() {
25+
// Acquire the coordinates to the texel we are to process.
26+
27+
ivec2 texelCoords = ivec2(gl_GlobalInvocationID.x / 512, gl_GlobalInvocationID.x % 512);
28+
//ivec2 texelCoords = ivec2(gl_GlobalInvocationID.xy);
29+
30+
// Read the pixel from the first texture.
31+
vec4 pixel = imageLoad(fromTex, texelCoords);
32+
33+
// Swap the red and green channels.
34+
// pixel.rg = vec2(gl_GlobalInvocationID.xy)*0.001;
35+
if (texelCoords.x < 256) {
36+
vec3 samplePoint = vec3(texelCoords, kage[1].x*1000);
37+
float noise = snoise(samplePoint*0.001*mouse.x)*100*mouse.y*100;
38+
float warpedNoise = snoise((samplePoint+vec3(noise, noise, noise))*0.01);
39+
warpedNoise = (warpedNoise+1)/2;
40+
pixel = vec4(vec3(warpedNoise, 0, 0), 1);
41+
} else {
42+
if (texelCoords.y < 256){
43+
pixel = vec4(kage[1], 1);
44+
}
45+
}
46+
//if (texelCoords == (mouse-1)*512) {
47+
// Now write the modified pixel to the second texture.
48+
imageStore(toTex, texelCoords, pixel);
49+
//}
50+
imageStore(someimg, texelCoords.x, vec4(texelCoords.xy, kage[1].x, 2));
51+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
//
2+
// Description : Array and textureless GLSL 2D/3D/4D simplex
3+
// noise functions.
4+
// Author : Ian McEwan, Ashima Arts.
5+
// Maintainer : ijm
6+
// Lastmod : 20110822 (ijm)
7+
// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
8+
// Distributed under the MIT License. See LICENSE file.
9+
// https://github.com/ashima/webgl-noise
10+
//
11+
12+
vec3 mod289(vec3 x) {
13+
return x - floor(x * (1.0 / 289.0)) * 289.0;
14+
}
15+
16+
vec4 mod289(vec4 x) {
17+
return x - floor(x * (1.0 / 289.0)) * 289.0;
18+
}
19+
20+
vec4 permute(vec4 x) {
21+
return mod289(((x*34.0)+1.0)*x);
22+
}
23+
24+
vec4 taylorInvSqrt(vec4 r)
25+
{
26+
return 1.79284291400159 - 0.85373472095314 * r;
27+
}
28+
29+
float snoise(vec3 v)
30+
{
31+
const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;
32+
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
33+
34+
// First corner
35+
vec3 i = floor(v + dot(v, C.yyy) );
36+
vec3 x0 = v - i + dot(i, C.xxx) ;
37+
38+
// Other corners
39+
vec3 g = step(x0.yzx, x0.xyz);
40+
vec3 l = 1.0 - g;
41+
vec3 i1 = min( g.xyz, l.zxy );
42+
vec3 i2 = max( g.xyz, l.zxy );
43+
44+
// x0 = x0 - 0.0 + 0.0 * C.xxx;
45+
// x1 = x0 - i1 + 1.0 * C.xxx;
46+
// x2 = x0 - i2 + 2.0 * C.xxx;
47+
// x3 = x0 - 1.0 + 3.0 * C.xxx;
48+
vec3 x1 = x0 - i1 + C.xxx;
49+
vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y
50+
vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y
51+
52+
// Permutations
53+
i = mod289(i);
54+
vec4 p = permute( permute( permute(
55+
i.z + vec4(0.0, i1.z, i2.z, 1.0 ))
56+
+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))
57+
+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));
58+
59+
// Gradients: 7x7 points over a square, mapped onto an octahedron.
60+
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
61+
float n_ = 0.142857142857; // 1.0/7.0
62+
vec3 ns = n_ * D.wyz - D.xzx;
63+
64+
vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)
65+
66+
vec4 x_ = floor(j * ns.z);
67+
vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)
68+
69+
vec4 x = x_ *ns.x + ns.yyyy;
70+
vec4 y = y_ *ns.x + ns.yyyy;
71+
vec4 h = 1.0 - abs(x) - abs(y);
72+
73+
vec4 b0 = vec4( x.xy, y.xy );
74+
vec4 b1 = vec4( x.zw, y.zw );
75+
76+
//vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
77+
//vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
78+
vec4 s0 = floor(b0)*2.0 + 1.0;
79+
vec4 s1 = floor(b1)*2.0 + 1.0;
80+
vec4 sh = -step(h, vec4(0.0));
81+
82+
vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
83+
vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
84+
85+
vec3 p0 = vec3(a0.xy,h.x);
86+
vec3 p1 = vec3(a0.zw,h.y);
87+
vec3 p2 = vec3(a1.xy,h.z);
88+
vec3 p3 = vec3(a1.zw,h.w);
89+
90+
//Normalise gradients
91+
vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
92+
p0 *= norm.x;
93+
p1 *= norm.y;
94+
p2 *= norm.z;
95+
p3 *= norm.w;
96+
97+
// Mix final noise value
98+
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
99+
m = m * m;
100+
return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
101+
dot(p2,x2), dot(p3,x3) ) );
102+
}
103+
104+
#pragma glslify: export(snoise)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#pragma once
2+
//
3+
// Description : Array and textureless GLSL 2D simplex noise function.
4+
// Author : Ian McEwan, Ashima Arts.
5+
// Maintainer : ijm
6+
// Lastmod : 20110822 (ijm)
7+
// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
8+
// Distributed under the MIT License. See LICENSE file.
9+
// https://github.com/ashima/webgl-noise
10+
//
11+
12+
vec3 mod289(vec3 x) {
13+
return x - floor(x * (1.0 / 289.0)) * 289.0;
14+
}
15+
16+
vec2 mod289(vec2 x) {
17+
return x - floor(x * (1.0 / 289.0)) * 289.0;
18+
}
19+
20+
vec3 permute(vec3 x) {
21+
return mod289(((x*34.0)+1.0)*x);
22+
}
23+
24+
float snoise(vec2 v)
25+
{
26+
const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0
27+
0.366025403784439, // 0.5*(sqrt(3.0)-1.0)
28+
-0.577350269189626, // -1.0 + 2.0 * C.x
29+
0.024390243902439); // 1.0 / 41.0
30+
// First corner
31+
vec2 i = floor(v + dot(v, C.yy) );
32+
vec2 x0 = v - i + dot(i, C.xx);
33+
34+
// Other corners
35+
vec2 i1;
36+
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
37+
//i1.y = 1.0 - i1.x;
38+
i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
39+
// x0 = x0 - 0.0 + 0.0 * C.xx ;
40+
// x1 = x0 - i1 + 1.0 * C.xx ;
41+
// x2 = x0 - 1.0 + 2.0 * C.xx ;
42+
vec4 x12 = x0.xyxy + C.xxzz;
43+
x12.xy -= i1;
44+
45+
// Permutations
46+
i = mod289(i); // Avoid truncation effects in permutation
47+
vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
48+
+ i.x + vec3(0.0, i1.x, 1.0 ));
49+
50+
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
51+
m = m*m ;
52+
m = m*m ;
53+
54+
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
55+
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
56+
57+
vec3 x = 2.0 * fract(p * C.www) - 1.0;
58+
vec3 h = abs(x) - 0.5;
59+
vec3 ox = floor(x + 0.5);
60+
vec3 a0 = x - ox;
61+
62+
// Normalise gradients implicitly by scaling m
63+
// Approximation of: m *= inversesqrt( a0*a0 + h*h );
64+
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );
65+
66+
// Compute final noise value at P
67+
vec3 g;
68+
g.x = a0.x * x0.x + h.x * x0.y;
69+
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
70+
return 130.0 * dot(m, g);
71+
}
72+
73+
#pragma glslify: export(snoise)

0 commit comments

Comments
 (0)