render = bnb({
w, h,
numFrames: 120,
fps: 20,
record: true,
video: 'mp4',
preload: (s, g) => {
g.pg = s.createGraphics(w, h)
},
draw: (s, t, g) => {
const cosT = s.cos(t * s.TAU) * s.sin(t * s.TAU) * .3
const sinT = s.sin(t * s.TAU) * .6
s.background(palette[0])
s.strokeCap(s.SQUARE)
s.drawingContext.shadowBlur = 5
s.drawingContext.shadowColor = 'rgba(22, 22, 22, .5)'
s.drawingContext.shadowOffsetX = -3
s.drawingContext.shadowOffSetY = 3
s.push()
const sw = 1
s.strokeWeight(sw)
const prng = new PRNG(prngSeed)
for(let y = 0; y < h; y += stepY) {
g.pg.clear()
g.pg.stroke(palette[prng.rand(1, palette.length-1)])
const step = .5
for(let x = 0; x < w; x += step) {
const u = PVector(x, y)
u.addY(simplex.noise4D(u.x / 200, u.y, cosT, sinT) * 150)
const v = PVector(x, y + stepY - 1)
v.addY(simplex.noise4D(v.x / 200, v.y, cosT, sinT) * 150)
if(u.y < v.y) g.pg.line(u.x, u.y, v.x, v.y)
}
s.image(g.pg, 0, 0)
}
s.pop()
}
})