Skip to content

Commit

Permalink
add a bunch of sketches
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyatmax committed Jun 9, 2024
1 parent 9fe04b5 commit ea2ec48
Show file tree
Hide file tree
Showing 9 changed files with 11,208 additions and 19,371 deletions.
28,401 changes: 9,045 additions & 19,356 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"meyda": "^4.1.3",
"midi-file-parser": "^1.0.0",
"minimist": "^1.2.2",
"mouse-wheel": "^1.2.0",
"new-array": "^1.0.0",
"nice-color-palettes": "^2.0.0",
"normals": "^1.1.0",
Expand Down Expand Up @@ -117,7 +118,7 @@
"web-audio-player": "^1.3.2"
},
"devDependencies": {
"@webgpu/types": "^0.1.23",
"@webgpu/types": "^0.1.42",
"browserify": "^13.1.0",
"bundle-collapser": "^1.2.1",
"mkdirp": "^0.5.1",
Expand Down
28 changes: 14 additions & 14 deletions sketches/2019.10.08-18.33.46.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const camera = createRoamingCamera({
* | _,-" |
* (0, 1)"-------------(1, 1)
*/
const positionsBuffer = rico.createVertexBuffer(rico.gl.FLOAT, 2, new Float32Array([0, -1, 0, 1, 1, -1, 1, 1]))
const positionsBuffer = rico.createVertexBuffer(rico.gl.FLOAT, 2, new Float32Array([0, -1, 0, 1, 1, 1, 1, -1]))

function setup () {
instances = 0
Expand Down Expand Up @@ -136,7 +136,7 @@ function setup () {
normal1 = normalize(mix(normalize(a), normalize(b), 0.5));
widthMult1 = mix(length(a), length(b), 0.5);
}
vec3 offset1 = normal1 * position.y * lineWidth * pow(widthMult1, lineWidthPow);
vec3 p1 = offset1 + iStart;
Expand All @@ -152,12 +152,12 @@ function setup () {
normal2 = normalize(mix(normalize(a), normalize(b), 0.5));
widthMult2 = mix(length(a), length(b), 0.5);
}
vec3 offset2 = normal2 * position.y * lineWidth * pow(widthMult2, lineWidthPow);
vec3 p2 = offset2 + iEnd;
vec3 p = mix(p1, p2, position.x);
vAlpha = 0.8;
float mag = snoiseFractal((p + vec3(noiseOffset)) * noiseFreq * 2.0) * 0.5 + 0.5;
Expand All @@ -169,7 +169,7 @@ function setup () {
`, NOISE_GLSL),
fs: `#version 300 es
precision highp float;
in float vAlpha;
out vec4 fragColor;
Expand All @@ -183,7 +183,7 @@ function setup () {
.instanceAttributeBuffer(2, lineDataBuffer, { type: rico.gl.FLOAT, size: 3, stride, offset: 1 * stride })
.instanceAttributeBuffer(3, lineDataBuffer, { type: rico.gl.FLOAT, size: 3, stride, offset: 2 * stride })
.instanceAttributeBuffer(4, lineDataBuffer, { type: rico.gl.FLOAT, size: 3, stride, offset: 3 * stride }),
primitive: 'triangle strip',
primitive: 'triangle fan',
count: 4,
instanceCount: lineSegmentsCount,
blend: {
Expand Down Expand Up @@ -265,33 +265,33 @@ float snoise(vec3 p) {
vec3 s = floor(p + dot(p, vec3(F3)));
vec3 x = p - s + dot(s, vec3(G3));
vec3 e = step(vec3(0.0), x - x.yzx);
vec3 i1 = e*(1.0 - e.zxy);
vec3 i2 = 1.0 - e.zxy*(1.0 - e);
vec3 x1 = x - i1 + G3;
vec3 x2 = x - i2 + 2.0*G3;
vec3 x3 = x - 1.0 + 3.0*G3;
vec4 w, d;
w.x = dot(x, x);
w.y = dot(x1, x1);
w.z = dot(x2, x2);
w.w = dot(x3, x3);
w = max(0.6 - w, 0.0);
d.x = dot(random3(s), x);
d.y = dot(random3(s + i1), x1);
d.z = dot(random3(s + i2), x2);
d.w = dot(random3(s + 1.0), x3);
w *= w;
w *= w;
d *= w;
return dot(d, vec4(52.0));
}
Expand Down
Loading

0 comments on commit ea2ec48

Please sign in to comment.