Last active
May 14, 2019 18:24
-
-
Save JoshCheek/868a9492519b12dd10c81fc7deb5f3d6 to your computer and use it in GitHub Desktop.
hydra sketch with custom glsl (against hydra-synth dev branch)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
synth.setFunction('josh', { type: 'src', inputs: [], glsl: ` | |
float josh_circle(vec2 st, float cr, float cx, float cy) { | |
float dx = cx-st.x, dy = cy-st.y; | |
float z = cr*cr - dx*dx - dy*dy; | |
return (z < 0.) ? 0. : sqrt(z)/cr; | |
} | |
vec4 josh(vec2 st){ | |
float z = josh_circle(st, .35, .5, .5); | |
z = z-josh_circle(st, .25, .5, .5)+josh_circle(st, 0.2, 0.5, 0.5)*0.75; | |
for(int i = 0; i < 10; i+=1) { | |
float angle = 6.28 * float(i) / 10.; | |
z = max(z, josh_circle(st, .1, cos(angle)/3.+.5, sin(angle)/3.+0.5)/2.5); | |
} | |
return vec4(z, z, z, 1.); | |
}`}) | |
josh().contrast(1.5).out() | |
const π = Math.PI | |
osc(π,1/π,10) | |
.diff( | |
josh() | |
.rotate(0,3) | |
.repeat(4) | |
.contrast(1.5) | |
.rotate(0,0.5) | |
) | |
.mult( | |
josh() | |
.contrast(1.5) | |
.mult(voronoi(150,1),0.15) | |
.rotate(0,-.25) | |
.scrollX(0.1) | |
.rotate(0,-0.75) | |
) | |
.out() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment