xxxxxxxxxx
let fbos
let font
function preload() {
font = loadFont('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZhrib2Bg-4.ttf')
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL)
pixelDensity(1)
fbos = [1,2].map(() => createFramebuffer({ format: FLOAT }))
}
function draw() {
fbos.reverse()
fbos[0].draw(() => {
background(0)
tint(255, 220, 220, 230)
image(
fbos[1],
-width/2*1.01+noise(millis()*0.005)*2,
-height/2*1.04+noise(millis()*0.006)*2,
width*1.01,
height*1.01
)
tint(255)
clearDepth()
strokeWeight(width*0.01)
const pts = font.textToPoints('42', -width*0.2, width*0.15, width*0.3, { sampleFactor: random(0.02, 0.05) })
.filter(() => random() < map(noise(millis()*0.001), 0, 1, 0.2, 0.5))
const palette = [
['#EDCA42', 0],
['#FFFD92', 0.5],
['#6954EA', 1]
]
for (const pt of pts) {
stroke(paletteLerp(palette, map(pt.y, -width*0, width*0.16, 0, 1, true)))
fill(255)
circle(pt.x, pt.y, width*random(0.015, 0.025))
}
filter(BLUR, 5)
})
image(fbos[0], -width/2, -height/2)
}