Skip to content

Commit

Permalink
Add speed
Browse files Browse the repository at this point in the history
  • Loading branch information
jqueraltmo committed Jun 20, 2023
1 parent 18580b4 commit 997f923
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hydra-gradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@
name: "b1",
default: 1,
},
{
type: "float",
name: "speed",
default: 0,
},
],
glsl:
`return vec4(mix(r0,r1,_st.x), mix(g0,g1,_st.x), mix(b0,b1,_st.x), 1.0);`
` float r = mix(r0,r1,sin(_st.x+time*speed));
float g = mix(g0,g1,sin(_st.x+time*speed));
float b = mix(b0,b1,sin(_st.x+time*speed));
return vec4(r, g, b, 1.0);`
},
].forEach((x) => _hydra.synth.setFunction(x));

0 comments on commit 997f923

Please sign in to comment.