hydra-synth / hydra

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

Export as WebGL? #214

Closed johnnyshankman closed 1 year ago

johnnyshankman commented 1 year ago

I presume since this is webGL under the hood we should be able to export our art as a fragment shader (or series of frag shaders). Can this be done somehow now, and if not can we put in a feature request for it? Interested in optimizing my code.

johnnyshankman commented 1 year ago

Oh wait I see there's a glsl command that pairs into regl. Is there some guide somewhere for taking the properties of the object and using it in vanilla JS + webgl?

micuat commented 1 year ago

you can always use hydra-synth as a module https://github.com/hydra-synth/hydra-synth/#to-include-in-a-webpage-bundled-version

exporting is not a trivial issue because you need to take into account a few things like feedback (cross reference between buffers), uniforms (time, functions, arrays) and it's not as easy as exporting a frag shader. Please reopen if this is not what you are looking for!