Skip to content

Commit

Permalink
pre-parse settings
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Apr 29, 2024
1 parent 7394bd9 commit 55495d8
Show file tree
Hide file tree
Showing 2,779 changed files with 36,106 additions and 2,778 deletions.
14 changes: 13 additions & 1 deletion art/22RaBcCzsbaXEzCh5/art.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@
"unlisted": true,
"username": "jeminshin2",
"avatarUrl": "https://avatars.githubusercontent.com/JeminShin2?s=200",
"settings": "{\"num\":10000,\"mode\":\"LINES\",\"sound\":\"\",\"lineSize\":\"NATIVE\",\"backgroundColor\":[0,0,0,1],\"shader\":\"// Jemin.Shin\\n// Exercise Making A Grid\\n// CS250 Spring 2022\\n\\nvoid main() {\\n float down = floor(sqrt(vertexCount));\\n float across = floor(vertexCount/down);\\n \\n float x = mod(vertexId, across);\\n float y = floor(vertexId/across);\\n \\n float u = x / (across - 1.);\\n float v = y / (across - 1.);\\n \\n float ux = u * 2. - 1.;\\n float vy = v * 2. - 1.;\\n \\n gl_Position = vec4(ux * sin(time), vy * cos(time), 0., 0.5);\\n \\n gl_PointSize = 10.0;\\n gl_PointSize *= 20./across;\\n gl_PointSize *= resolution.x / 400.;\\n \\n \\n v_color = vec4(1,0,0,1);\\n \\n}\"}",
"settings": {
"num": 10000,
"mode": "LINES",
"sound": "",
"lineSize": "NATIVE",
"backgroundColor": [
0,
0,
0,
1
],
"shader": "// Jemin.Shin\n// Exercise Making A Grid\n// CS250 Spring 2022\n\nvoid main() {\n float down = floor(sqrt(vertexCount));\n float across = floor(vertexCount/down);\n \n float x = mod(vertexId, across);\n float y = floor(vertexId/across);\n \n float u = x / (across - 1.);\n float v = y / (across - 1.);\n \n float ux = u * 2. - 1.;\n float vy = v * 2. - 1.;\n \n gl_Position = vec4(ux * sin(time), vy * cos(time), 0., 0.5);\n \n gl_PointSize = 10.0;\n gl_PointSize *= 20./across;\n gl_PointSize *= resolution.x / 400.;\n \n \n v_color = vec4(1,0,0,1);\n \n}"
},
"screenshotURL": "data/images/images-d2fsmpwp2mvlmqnit-thumbnail.jpg",
"hasSound": "",
"views": {
Expand Down
14 changes: 13 additions & 1 deletion art/23ezRZjpZK82TqNJr/art.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@
"unlisted": false,
"username": "gman",
"avatarUrl": "https://secure.gravatar.com/avatar/dcc0309895c3d6db087631813efaa9d1?default=retro&size=200",
"settings": "{\"num\":100000,\"mode\":\"TRIANGLES\",\"sound\":\"https://soundcloud.com/user-811313743/a-charlie-brown-christmas-skating\",\"lineSize\":\"NATIVE\",\"backgroundColor\":[0,0.5882352941176471,0.6901960784313725,1],\"shader\":\"/*\\n\\n _____, ____, ___, ___, __ _, \\n(-| | | (-|_, (-|_) (-|_) (-\\\\ | \\n _| | |_, _|__, _| \\\\_, _| \\\\_, \\\\| \\n( ( ( ( (__/ \\n ____ __ _, ___, ____, ____ ____, _____, ___, ____ \\n (-/ ` (-|__| (-|_) (-| (-(__`(-| (-| | | (-|_\\\\_,(-(__`\\n \\\\___, _| |_, _| \\\\_, _|__, ____) _| _| | |_, _| ) ____)\\n ( ( ( ( ( ( ( ( \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n*/\\n\\n#define PI radians(180.0)\\n\\nvec3 hsv2rgb(vec3 c) {\\n c = vec3(c.x, clamp(c.yz, 0.0, 1.0));\\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\\n}\\n\\n\\nmat4 rotY( float angle ) {\\n float s = sin( angle );\\n float c = cos( angle );\\n \\t\\n return mat4( \\n c, 0,-s, 0,\\n 0, 1, 0, 0,\\n s, 0, c, 0,\\n 0, 0, 0, 1); \\n}\\n\\n\\nmat4 rotZ( float angle ) {\\n float s = sin( angle );\\n float c = cos( angle );\\n \\t\\n return mat4( \\n c,-s, 0, 0, \\n s, c, 0, 0,\\n 0, 0, 1, 0,\\n 0, 0, 0, 1); \\n}\\n\\nmat4 trans(vec3 trans) {\\n return mat4(\\n 1, 0, 0, 0,\\n 0, 1, 0, 0,\\n 0, 0, 1, 0,\\n trans, 1);\\n}\\n\\nmat4 ident() {\\n return mat4(\\n 1, 0, 0, 0,\\n 0, 1, 0, 0,\\n 0, 0, 1, 0,\\n 0, 0, 0, 1);\\n}\\n\\nmat4 scale(vec3 s) {\\n return mat4(\\n s[0], 0, 0, 0,\\n 0, s[1], 0, 0,\\n 0, 0, s[2], 0,\\n 0, 0, 0, 1);\\n}\\n\\nmat4 uniformScale(float s) {\\n return mat4(\\n s, 0, 0, 0,\\n 0, s, 0, 0,\\n 0, 0, s, 0,\\n 0, 0, 0, 1);\\n}\\n\\nmat4 persp(float fov, float aspect, float zNear, float zFar) {\\n float f = tan(PI * 0.5 - 0.5 * fov);\\n float rangeInv = 1.0 / (zNear - zFar);\\n\\n return mat4(\\n f / aspect, 0, 0, 0,\\n 0, f, 0, 0,\\n 0, 0, (zNear + zFar) * rangeInv, -1,\\n 0, 0, zNear * zFar * rangeInv * 2., 0);\\n}\\n\\nmat4 trInv(mat4 m) {\\n mat3 i = mat3(\\n m[0][0], m[1][0], m[2][0], \\n m[0][1], m[1][1], m[2][1], \\n m[0][2], m[1][2], m[2][2]);\\n vec3 t = -i * m[3].xyz;\\n \\n return mat4(\\n i[0], t[0], \\n i[1], t[1],\\n i[2], t[2],\\n 0, 0, 0, 1);\\n}\\n\\nmat4 transpose(mat4 m) {\\n return mat4(\\n m[0][0], m[1][0], m[2][0], m[3][0], \\n m[0][1], m[1][1], m[2][1], m[3][1],\\n m[0][2], m[1][2], m[2][2], m[3][2],\\n m[0][3], m[1][3], m[2][3], m[3][3]);\\n}\\n\\nmat4 lookAt(vec3 eye, vec3 target, vec3 up) {\\n vec3 zAxis = normalize(eye - target);\\n vec3 xAxis = normalize(cross(up, zAxis));\\n vec3 yAxis = cross(zAxis, xAxis);\\n\\n return mat4(\\n xAxis, 0,\\n yAxis, 0,\\n zAxis, 0,\\n eye, 1);\\n}\\n\\nmat4 inverse(mat4 m) {\\n float\\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\\n\\n b00 = a00 * a11 - a01 * a10,\\n b01 = a00 * a12 - a02 * a10,\\n b02 = a00 * a13 - a03 * a10,\\n b03 = a01 * a12 - a02 * a11,\\n b04 = a01 * a13 - a03 * a11,\\n b05 = a02 * a13 - a03 * a12,\\n b06 = a20 * a31 - a21 * a30,\\n b07 = a20 * a32 - a22 * a30,\\n b08 = a20 * a33 - a23 * a30,\\n b09 = a21 * a32 - a22 * a31,\\n b10 = a21 * a33 - a23 * a31,\\n b11 = a22 * a33 - a23 * a32,\\n\\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\\n\\n return mat4(\\n a11 * b11 - a12 * b10 + a13 * b09,\\n a02 * b10 - a01 * b11 - a03 * b09,\\n a31 * b05 - a32 * b04 + a33 * b03,\\n a22 * b04 - a21 * b05 - a23 * b03,\\n a12 * b08 - a10 * b11 - a13 * b07,\\n a00 * b11 - a02 * b08 + a03 * b07,\\n a32 * b02 - a30 * b05 - a33 * b01,\\n a20 * b05 - a22 * b02 + a23 * b01,\\n a10 * b10 - a11 * b08 + a13 * b06,\\n a01 * b08 - a00 * b10 - a03 * b06,\\n a30 * b04 - a31 * b02 + a33 * b00,\\n a21 * b02 - a20 * b04 - a23 * b00,\\n a11 * b07 - a10 * b09 - a12 * b06,\\n a00 * b09 - a01 * b07 + a02 * b06,\\n a31 * b01 - a30 * b03 - a32 * b00,\\n a20 * b03 - a21 * b01 + a22 * b00) / det;\\n}\\n\\nmat4 cameraLookAt(vec3 eye, vec3 target, vec3 up) {\\n #if 1\\n return inverse(lookAt(eye, target, up));\\n #else\\n vec3 zAxis = normalize(target - eye);\\n vec3 xAxis = normalize(cross(up, zAxis));\\n vec3 yAxis = cross(zAxis, xAxis);\\n\\n return mat4(\\n xAxis, 0,\\n yAxis, 0,\\n zAxis, 0,\\n -dot(xAxis, eye), -dot(yAxis, eye), -dot(zAxis, eye), 1); \\n #endif\\n \\n}\\n// hash function from https://www.shadertoy.com/view/4djSRW\\nfloat hash(float p) {\\n\\tvec2 p2 = fract(vec2(p * 5.3983, p * 5.4427));\\n p2 += dot(p2.yx, p2.xy + vec2(21.5351, 14.3137));\\n\\treturn fract(p2.x * p2.y * 95.4337);\\n}\\n\\nfloat m1p1(float v) {\\n return v * 2. - 1.;\\n}\\n\\nfloat inv(float v) {\\n return 1. - v;\\n}\\n\\nvec3 getQPoint(const float id) {\\n float outId = mix(id, 8. - id, step(2.5, id));\\n float ux = floor(outId / 6.) + mod(outId, 2.);\\n float vy = mod(floor(outId / 2.) + floor(outId / 3.), 2.); \\n vec3 pos = vec3(ux, vy, 0); \\n return pos;\\n}\\n\\nvoid main() {\\n float vId = vertexId;\\n float numStems = 6.;\\n float quadsPerStem = 5.;\\n float pointsPerStem = quadsPerStem * 6.;\\n float pointsPerFlake = pointsPerStem * numStems;\\n float numFlakes = floor(vertexCount / pointsPerFlake);\\n float quadId = mod(floor(vId / 6.), quadsPerStem);\\n float stemId = floor(vId / pointsPerStem);\\n float flakeId = floor(vId / pointsPerFlake);\\n float stemV = stemId / numStems;\\n float flakeV = flakeId / numFlakes;\\n \\n vec3 p = getQPoint(mod(vId, 6.));\\n \\n vec3 camera = vec3(0, 0, 1);\\n vec3 target = vec3(0, 0, 0);\\n vec3 up = vec3(0, 1, 0);\\n \\n float z = hash(flakeId) * -10.;\\n\\n mat4 m = persp(radians(45.), resolution.x / resolution.y, 0.1, 20.);\\n m *= cameraLookAt(camera, target, up);\\n m *= trans(vec3(\\n (z + 1.5) * 1. * m1p1(hash(flakeId * 0.171)) + 0.05 * sin(time * mix(0.91, 0.2, hash(flakeId * 0.951))), \\n mix(1.5, -1.5, fract(hash(flakeId * .654) + time * mix(0.01, 0.03, hash(flakeId * 0.543)))), \\n z));\\n m *= uniformScale(mix(0.05, 0.1, hash(flakeId * 0.243)));\\n m *= rotZ(time * hash(flakeId));\\n m *= rotY(time * hash(flakeId));\\n m *= rotZ(stemV * PI * 2. + mix(1.5, -1.5, fract(time * mix(-0.3, 0.3, hash(flakeId * 0.843)))));\\n m *= scale(vec3(0.1, m1p1(hash(flakeId * 0.123 + quadId * 0.711 + p.x)) * 0.3, 1));\\n m *= trans(vec3(quadId, -0.5, 0));\\n gl_Position = m * vec4(p, 1);\\n \\n v_color = vec4(1);\\n v_color.a = mix(1.0, 0.0, hash(flakeId));\\n v_color = vec4(v_color.rgb * v_color.a, v_color.a);\\n}\"}",
"settings": {
"num": 100000,
"mode": "TRIANGLES",
"sound": "https://soundcloud.com/user-811313743/a-charlie-brown-christmas-skating",
"lineSize": "NATIVE",
"backgroundColor": [
0,
0.5882352941176471,
0.6901960784313725,
1
],
"shader": "/*\n\n _____, ____, ___, ___, __ _, \n(-| | | (-|_, (-|_) (-|_) (-\\ | \n _| | |_, _|__, _| \\_, _| \\_, \\| \n( ( ( ( (__/ \n ____ __ _, ___, ____, ____ ____, _____, ___, ____ \n (-/ ` (-|__| (-|_) (-| (-(__`(-| (-| | | (-|_\\_,(-(__`\n \\___, _| |_, _| \\_, _|__, ____) _| _| | |_, _| ) ____)\n ( ( ( ( ( ( ( ( \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n*/\n\n#define PI radians(180.0)\n\nvec3 hsv2rgb(vec3 c) {\n c = vec3(c.x, clamp(c.yz, 0.0, 1.0));\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\nmat4 rotY( float angle ) {\n float s = sin( angle );\n float c = cos( angle );\n \t\n return mat4( \n c, 0,-s, 0,\n 0, 1, 0, 0,\n s, 0, c, 0,\n 0, 0, 0, 1); \n}\n\n\nmat4 rotZ( float angle ) {\n float s = sin( angle );\n float c = cos( angle );\n \t\n return mat4( \n c,-s, 0, 0, \n s, c, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1); \n}\n\nmat4 trans(vec3 trans) {\n return mat4(\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n trans, 1);\n}\n\nmat4 ident() {\n return mat4(\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1);\n}\n\nmat4 scale(vec3 s) {\n return mat4(\n s[0], 0, 0, 0,\n 0, s[1], 0, 0,\n 0, 0, s[2], 0,\n 0, 0, 0, 1);\n}\n\nmat4 uniformScale(float s) {\n return mat4(\n s, 0, 0, 0,\n 0, s, 0, 0,\n 0, 0, s, 0,\n 0, 0, 0, 1);\n}\n\nmat4 persp(float fov, float aspect, float zNear, float zFar) {\n float f = tan(PI * 0.5 - 0.5 * fov);\n float rangeInv = 1.0 / (zNear - zFar);\n\n return mat4(\n f / aspect, 0, 0, 0,\n 0, f, 0, 0,\n 0, 0, (zNear + zFar) * rangeInv, -1,\n 0, 0, zNear * zFar * rangeInv * 2., 0);\n}\n\nmat4 trInv(mat4 m) {\n mat3 i = mat3(\n m[0][0], m[1][0], m[2][0], \n m[0][1], m[1][1], m[2][1], \n m[0][2], m[1][2], m[2][2]);\n vec3 t = -i * m[3].xyz;\n \n return mat4(\n i[0], t[0], \n i[1], t[1],\n i[2], t[2],\n 0, 0, 0, 1);\n}\n\nmat4 transpose(mat4 m) {\n return mat4(\n m[0][0], m[1][0], m[2][0], m[3][0], \n m[0][1], m[1][1], m[2][1], m[3][1],\n m[0][2], m[1][2], m[2][2], m[3][2],\n m[0][3], m[1][3], m[2][3], m[3][3]);\n}\n\nmat4 lookAt(vec3 eye, vec3 target, vec3 up) {\n vec3 zAxis = normalize(eye - target);\n vec3 xAxis = normalize(cross(up, zAxis));\n vec3 yAxis = cross(zAxis, xAxis);\n\n return mat4(\n xAxis, 0,\n yAxis, 0,\n zAxis, 0,\n eye, 1);\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nmat4 cameraLookAt(vec3 eye, vec3 target, vec3 up) {\n #if 1\n return inverse(lookAt(eye, target, up));\n #else\n vec3 zAxis = normalize(target - eye);\n vec3 xAxis = normalize(cross(up, zAxis));\n vec3 yAxis = cross(zAxis, xAxis);\n\n return mat4(\n xAxis, 0,\n yAxis, 0,\n zAxis, 0,\n -dot(xAxis, eye), -dot(yAxis, eye), -dot(zAxis, eye), 1); \n #endif\n \n}\n// hash function from https://www.shadertoy.com/view/4djSRW\nfloat hash(float p) {\n\tvec2 p2 = fract(vec2(p * 5.3983, p * 5.4427));\n p2 += dot(p2.yx, p2.xy + vec2(21.5351, 14.3137));\n\treturn fract(p2.x * p2.y * 95.4337);\n}\n\nfloat m1p1(float v) {\n return v * 2. - 1.;\n}\n\nfloat inv(float v) {\n return 1. - v;\n}\n\nvec3 getQPoint(const float id) {\n float outId = mix(id, 8. - id, step(2.5, id));\n float ux = floor(outId / 6.) + mod(outId, 2.);\n float vy = mod(floor(outId / 2.) + floor(outId / 3.), 2.); \n vec3 pos = vec3(ux, vy, 0); \n return pos;\n}\n\nvoid main() {\n float vId = vertexId;\n float numStems = 6.;\n float quadsPerStem = 5.;\n float pointsPerStem = quadsPerStem * 6.;\n float pointsPerFlake = pointsPerStem * numStems;\n float numFlakes = floor(vertexCount / pointsPerFlake);\n float quadId = mod(floor(vId / 6.), quadsPerStem);\n float stemId = floor(vId / pointsPerStem);\n float flakeId = floor(vId / pointsPerFlake);\n float stemV = stemId / numStems;\n float flakeV = flakeId / numFlakes;\n \n vec3 p = getQPoint(mod(vId, 6.));\n \n vec3 camera = vec3(0, 0, 1);\n vec3 target = vec3(0, 0, 0);\n vec3 up = vec3(0, 1, 0);\n \n float z = hash(flakeId) * -10.;\n\n mat4 m = persp(radians(45.), resolution.x / resolution.y, 0.1, 20.);\n m *= cameraLookAt(camera, target, up);\n m *= trans(vec3(\n (z + 1.5) * 1. * m1p1(hash(flakeId * 0.171)) + 0.05 * sin(time * mix(0.91, 0.2, hash(flakeId * 0.951))), \n mix(1.5, -1.5, fract(hash(flakeId * .654) + time * mix(0.01, 0.03, hash(flakeId * 0.543)))), \n z));\n m *= uniformScale(mix(0.05, 0.1, hash(flakeId * 0.243)));\n m *= rotZ(time * hash(flakeId));\n m *= rotY(time * hash(flakeId));\n m *= rotZ(stemV * PI * 2. + mix(1.5, -1.5, fract(time * mix(-0.3, 0.3, hash(flakeId * 0.843)))));\n m *= scale(vec3(0.1, m1p1(hash(flakeId * 0.123 + quadId * 0.711 + p.x)) * 0.3, 1));\n m *= trans(vec3(quadId, -0.5, 0));\n gl_Position = m * vec4(p, 1);\n \n v_color = vec4(1);\n v_color.a = mix(1.0, 0.0, hash(flakeId));\n v_color = vec4(v_color.rgb * v_color.a, v_color.a);\n}"
},
"screenshotURL": "data/images/images-w1f0zzufayogu5orv-thumbnail.jpg",
"hasSound": true,
"views": {
Expand Down
Loading

0 comments on commit 55495d8

Please sign in to comment.