Skip to content

Commit e4fed85

Browse files
authored
Merge pull request #118 from CreativeCodeBerlin/remaining-shadertoy-sketches
retrieved remaining sketches
2 parents af85e08 + 5063b12 commit e4fed85

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

assets/projects.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default [
2828
"scale": "1.75",
2929
},
3030
{
31-
"url": "https://hamoid.com/static/code/shadertoy/shadertoy-tfVXz1.html",
31+
"url": "https://creativecode.berlin/shadertoys/?shader=tfVXz1",
3232
"author": "aBe",
3333
"author_url": "https://hamoid.com",
3434
"color": "black",
@@ -42,7 +42,7 @@ export default [
4242
"scale": "1",
4343
},
4444
{
45-
"url": "https://www.shadertoy.com/embed/3slGRH?gui=false&t=10&paused=false&muted=true",
45+
"url": "https://creativecode.berlin/shadertoys/?shader=3slGRH",
4646
"author": "Kazik",
4747
"author_url": "https://xemantic.com/",
4848
"color": "black",
@@ -70,7 +70,7 @@ export default [
7070
"scale": "1"
7171
},
7272
{
73-
"url": "https://www.shadertoy.com/embed/lX3XWl?gui=false&paused=false&muted=true",
73+
"url": "https://creativecode.berlin/shadertoys/?shader=lX3XWl",
7474
"author": "Matthias Meissen",
7575
"author_url": "https://www.instagram.com/matthiasmeissen/",
7676
"color": "black",

public/shadertoys/3slGRH.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"ver":"0.1","info":{"id":"3slGRH","date":"1545045566","viewed":3331,"name":"alien shield","username":"morisil","description":"Quite accidental creation, but I like the achieved pseudo 3d illusion.","likes":29,"published":3,"flags":0,"usePreview":0,"tags":[]},"renderpass":[{"inputs":[],"outputs":[{"id":"4dfGRr","channel":0}],"code":"#define SCALE 50.0\n\/\/ rotation speed, might be negative to spin counter-clockwise\n#define ROTATION_SPEED -1.0\n\n#define INTENSITY_PULSE_SPEED 1.3\n\nfloat getColorComponent(float dist, float angle, float scaleIncrement) {\n return sin(\n (dist * SCALE)\n + angle\n + (cos(dist * SCALE))\n - (iTime * ROTATION_SPEED)\n )\n - dist * (2.3 + sin(iTime * INTENSITY_PULSE_SPEED))\n + 0.3;\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = (fragCoord -.5 * iResolution.xy) \/ iResolution.y;\n float dist = length(uv),\n angle = atan(uv.x, uv.y);\n fragColor = vec4(\n getColorComponent(dist, angle, 0.0),\n getColorComponent(dist * 0.99, angle - 0.05, 1.0),\n getColorComponent(dist * 0.98, angle - 0.1, 2.0),\n 1.0\n );\n}\n\n","name":"Image","description":"","type":"image"}]}]

public/shadertoys/lX3XWl.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"ver":"0.1","info":{"id":"lX3XWl","date":"1719761380","viewed":439,"name":"mm-gl-01-240630","username":"matthiasmeissen","description":"This is my first shader that I am sharing here.","likes":4,"published":1,"flags":0,"usePreview":0,"tags":[]},"renderpass":[{"inputs":[],"outputs":[{"id":"4dfGRr","channel":0}],"code":"vec2 rotate(vec2 p, float a)\n{\n\tmat2 m = mat2(cos(a), -sin(a), sin(a), cos(a));\n\treturn p * m;\n}\n\nfloat line(vec2 p, float t) \n{\n\tvec2 p1 = rotate(p, t * 0.2);\n\tfloat d1 = length(vec2(sin(p1.x * 4.0) * sin(p1.y * 4.0 + t), p1.y * 0.2));\n \n float d2 = length(vec2(sin(p1.x * 4.0) * sin(p1.y * p.y + t * 0.2), p1.y * 0.2));\n\treturn d1 - d2;\n}\n\n\/\/ https:\/\/iquilezles.org\/articles\/palettes\/\nvec3 palette( float t ) \n{\n vec3 a = vec3(0.5, 0.5, 0.5);\n vec3 b = vec3(0.5, 0.5, 0.5);\n vec3 c = vec3(1.0, 1.0, 1.0);\n vec3 d = vec3(0.0,0.10,0.20);\n\n return a + b*cos( 6.28318*(c*t+d) );\n}\n\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord )\n{ \n vec2 p = (2.0 * fragCoord - iResolution.xy) \/ iResolution.y;\n vec2 mouse = iMouse.xy\/iResolution.xy + 0.5;\n \n \/\/ Size based on Mouse.x\n\tp = mix(p * 0.1, p * 0.8, mouse.x);\n\t\n\t\/\/ Circular pattern based on mouse.x\n\tvec2 pc = vec2(length(p), mix(distance(p.x, p.y), p.x * p.y * 0.4, mouse.x));\n\t\n\tpc = mix(pc, vec2(length(sin(pc)), tan(pc.y \/ pc.x)), 0.4);\n\t\n\t\/\/ Lines based on mouse.y\n\tvec2 p1 = mix(p, tan(pc * 10.0 + iTime), mouse.y * 0.04);\n\t\n\tvec2 t = vec2(line(p1 \/ pc, iTime), line(pc, iTime * 2.0));\n float t1 = t.x \/ t.y;\n t1 = t1 \/ length(p * 8.0);\n float t2 = step(mod(pc.x, abs(sin(iTime * 0.8))) + 0.2, t1);\n t1 = smoothstep(0.1 * p1.y, abs(sin(iTime * 0.04 * p1.y)) + 0.4, t1);\n\n vec3 col = palette(t1 + 0.4);\n\n fragColor = vec4(col,1.0);\n}","name":"Image","description":"","type":"image"}]}]

public/shadertoys/tfVXz1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"ver":"0.1","info":{"id":"tfVXz1","date":"1749827724","viewed":230,"name":"Varying sharpness","username":"hamoid","description":"Experiment using complex numbers. Based on https:\/\/hturan.com\/writing\/complex-numbers-glsl","likes":2,"published":3,"flags":0,"usePreview":0,"tags":[]},"renderpass":[{"inputs":[],"outputs":[{"id":"4dfGRr","channel":0}],"code":"#define PI 3.1415926535897932384626433832795\n\n#define cx_mul(a, b) vec2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x)\n#define cx_div(a, b) vec2(((a.x*b.x + a.y*b.y)\/(b.x*b.x + b.y*b.y)),((a.y*b.x - a.x*b.y)\/(b.x*b.x + b.y*b.y)))\n#define cx_sin(a) vec2(sin(a.x) * cosh(a.y), cos(a.x) * sinh(a.y))\n#define cx_cos(a) vec2(cos(a.x) * cosh(a.y), -sin(a.x) * sinh(a.y))\n\nvec2 cx_tan(vec2 a) {return cx_div(cx_sin(a), cx_cos(a)); }\nvec2 cx_log(vec2 a) {\n float rpart = sqrt((a.x*a.x)+(a.y*a.y));\n float ipart = atan(a.y,a.x);\n if (ipart > PI) ipart=ipart-(2.0*PI);\n return vec2(log(rpart),ipart);\n}\n\nvec2 as_polar(vec2 z) {\n return vec2(length(z), atan(z.y, z.x));\n}\nvec2 cx_pow(vec2 v, float p) {\n vec2 z = as_polar(v);\n return pow(z.x, p) * vec2(cos(z.y * p), sin(z.y * p));\n}\n\nfloat im(vec2 z) {\n return ((atan(z.y, z.x) \/ PI) + 1.0) * 0.5;\n}\n\nvec3 pal( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) {\n return a + b*cos(2.*PI*(c*t+d));\n}\n\nvoid mainImage( out vec4 fragColor, in vec2 fragCoord ) { \n float t = iTime * 0.1;\n \/\/ Define our points\n vec2 p[8];\n for(int i=0; i<8; i++) {\n p[i] = vec2(cos(float(i) * 0.1 + t), sin(float(i) * 2.3 + t));\n }\n \n \/\/ Set up our imaginary plane\n vec2 uv = (fragCoord.xy - 0.5 * iResolution.xy) \/ min(iResolution.y, iResolution.x);\n vec2 z = uv * 4.;\n\n \/\/ Calculate the sum of our first polynomial\n vec2 polyA = p[0]\n + cx_mul(p[1], z)\n + cx_mul(p[2], cx_pow(z, 2.0))\n + cx_mul(p[3], cx_pow(z, 3.0));\n\n \/\/ Calculate the sum of our second polynomial\n vec2 polyB = p[4]\n + cx_mul(p[5], z)\n + cx_mul(p[6], cx_pow(z, 2.0))\n + cx_mul(p[7], cx_pow(z, 3.0));\n\n \/\/ Calculate the ratio of our complex polynomials\n vec2 result = cx_div(polyA, polyB);\n\n float imaginary = cx_log(result).y;\n float col = (imaginary \/ PI);\n fragColor = vec4(pal(col, vec3(.52,.45,.21),vec3(.40,.40,.31),vec3(.26,.30,.75),vec3(.15,.4,.2)), 1.0);\n}","name":"Image","description":"","type":"image"}]}]

0 commit comments

Comments
 (0)