Skip to content

Instantly share code, notes, and snippets.

@flordefuego
Created January 19, 2025 14:16
Show Gist options
  • Select an option

  • Save flordefuego/c35b4114cc2defbe77152e18aa17598b to your computer and use it in GitHub Desktop.

Select an option

Save flordefuego/c35b4114cc2defbe77152e18aa17598b to your computer and use it in GitHub Desktop.
let libs = ['https://unpkg.com/hydra-synth', 'includes/libs/hydra-synth.js',"https://cdn.jsdelivr.net/npm/[email protected]/dist/p5.asciify.min.js"]
// hydra canvas + init
let hc = document.createElement('canvas') // hydra canvas + custom size
hc.width = 640 // window.innerWidth // for full res
hc.height = 360 // window.innerHeight // for full res
let hydra = new Hydra({detectAudio: false,canvas: hc})
noize = noise // use noize() since noise() is taken by p5js
let pg // store hydra texture
// sandbox - start
voronoi(8,1)
.mult(osc(10,0.1,()=>Math.sin(time)*3).saturate(3).kaleid(200))
.modulate(o0,0.5)
.add(o0,0.8)
.scrollY(-0.01)
.scale(0.99)
.modulate(voronoi(8,1),0.008)
.luma(0.3)
.out()
speed = 0.1
// sandbox - stop
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL)
background(0)
pg = createGraphics(hc.width, hc.height)
}
function draw() {
// grab + apply hydra texture
pg.clear()
pg.drawingContext.drawImage(hc, 0, 0, pg.width, pg.height)
image(pg, -width / 2, -height / 2, width, height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment