bruit_du_ciel.js 1.01 KB
a.setBins(4)
a.setSmooth(0.7)
a.setScale(6)
a.setCutoff(4)
a.show()
s0.initImage("/home/pln/Work/Hydra/Nuages/IMG_20240426_191322.jpg")
s1.initImage("/home/pln/Work/Hydra/Nuages/IMG_20240426_194213.jpg")
src(s1)
  .brightness(-0.4)
  .contrast(1.4)
  .out(o0)
src(o0)
    .modulate(src(o1).scale(() => 1 + 0.05 * Math.sin(a.fft[0])))
    .out(o1)
// Neige
noise(() => 20 * 20 * (a.fft[3] - 1.5 * a.fft[0]),() => 0.02)
    .scrollY(() => -time * 0.005)
    .thresh(() => 0.93 - 0.035 * Math.sin(a.fft[3]))
    .out(o2)
src(o1)
    .scroll(() => 0.2 + (time / 200 % 42), 0)
    .scale(() => 1.5 + 0.3 * (time % 30) + 0.3 * (time % 91))
    .add(o2)
     // Nuages
    .add(
      src(s1).brightness(0.2)
      .colorama(() => 0.85 - 1.2 * a.fft[2])
      // En mouvement
      .scale(() => 1.5 - 0.5 * a.fft[3])
      .rotate(() => (time * (0.1 + 0.001 * a.fft[0]) % 360))
      .luma(() => 0.98 - 0.25 * ((a.fft[1] + a.fft[2]) % 360)) // Only the brightest
      , 0.3)
    .contrast(1.2)
    .brightness(-0.05)
    .out(o3)
render(o3)