hydra-synth / hydra

Livecoding networked visuals in the browser
https://hydra.ojack.xyz
GNU Affero General Public License v3.0
2.18k stars 267 forks source link

Is it possible to download the shader code generated by Hydra? #148

Closed animanoir closed 2 years ago

zachkrall commented 2 years ago

i'm having trouble finding the documentation but there's a .glsl() function that you can use instead of .out() to get shader code

shader = solid(0,0,1)
shader.out()
console.log(shader.glsl()[0].frag)

preview: https://hydra.ojack.xyz/?code=c2hhZGVyJTIwJTNEJTIwc29saWQoMCUyQzAlMkMxKSUwQXNoYWRlci5vdXQoKSUwQWNvbnNvbGUubG9nKHNoYWRlci5nbHNsKCklNUIwJTVELmZyYWcpJTBBJTBBJTJGJTJGJTIwb3BlbiUyMGNvbnNvbGUlMjBpbiUyMGJyb3dzZXIlMjB0byUyMHNlZSUyMGZyYWdtZW50JTIwc2hhZGVyJTIwY29kZQ==

animanoir commented 2 years ago

awesome! exactly what I needed. thanks!