{"id":"firefly-meadow","version":"1.0.0","title":"Firefly Meadow","summary":"Fireflies blinking over a moonlit meadow of swaying grass, drifting into step once in the loop. Loops perfectly.","kind":"background","target":"three","collections":["backgrounds","hypnotic-loops"],"tags":["fireflies","meadow","night","moon","grass","summer","calm","magical","nature","synchrony","loop","background"],"loopable":true,"motion":"procedural","durationSeconds":12,"status":"published","media":{"poster":"https://aipixelwizard.com/media/firefly-meadow/1.0.0/poster.webp","preview":"https://aipixelwizard.com/media/firefly-meadow/1.0.0/preview.mp4","sample":"https://aipixelwizard.com/media/firefly-meadow/1.0.0/sample.mp4","sampleBytes":6706149,"sampleNote":"Pre-rendered with the default settings. Customised settings must be exported locally (npm run render)."},"urls":{"page":"https://aipixelwizard.com/visuals/firefly-meadow","manifest":"https://aipixelwizard.com/api/v1/visuals/firefly-meadow/versions/1.0.0","agentMd":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/agent.md","files":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/","demo":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/index.html"},"description":"A summer night in a meadow: tall grass swaying in a slow wind under a bright moon, misty hills behind, and fireflies drifting through the air. Each firefly flashes on its own rhythm; once in the loop they fall into step until the whole meadow blinks together, then drift apart again. Near fireflies are big soft discs, far ones pinpoints, the grass in front hides them and the grass near a flash catches its light. Choose the glow (yellow-green, amber, aqua or green and amber), how many fireflies, how often they flash, how far they synchronise, the wind, the height of the grass, the moonlight, the mist and the brightness of the fireflies.","role":"Background (WebGL, full frame): a calm, magical night scene for storytelling, wellness, nature and fantasy content.","useCases":["A calming backdrop for sleep, meditation and storytelling","A magical or fantasy night scene for a title or intro","A summer, camping or nature brand scene"],"synonyms":["lightning bugs","glow worms","firefly field","summer night","moonlit meadow","nature background","fairy lights","sleep background"],"digest":"b2ca4851b5a4b4c8cab8c983e83d58f9c8b4a57d1ab7fa789a4c5bb40ba83345","implementation":{"target":"three","runtime":"browser","language":"javascript","module":"esm","entry":"src/firefly-meadow.js","exports":[{"name":"createFireflyMeadow","signature":"createFireflyMeadow({ palette?, fireflies?, flashes?, sync?, wind?, grass?, moon?, mist?, glow?, seed?, aspect? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }","description":"The whole meadow: a sky, instanced grass and instanced fireflies in one scene. Render it with its camera, ideally through createBloomPass."},{"name":"createBloomPass","signature":"createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }","description":"A small bloom with filmic tone mapping: draws a scene to the canvas with its glow."},{"name":"PALETTES","signature":"PALETTES: { classic, amber, aqua, mixed }","description":"The glow of the fireflies."}],"reusable":["src/firefly-meadow.js"],"demo":"demo.js","harness":"index.html"},"dependencies":[{"id":"three","version":"0.185.1","scope":"source","reason":"Renderer, instanced grass and fireflies, and the bloom targets."},{"id":"apw-runtime","version":"1.0.0","scope":"demo","reason":"Demo harness."}],"uses":[],"usedBy":[],"params":[{"key":"palette","label":"Glow","type":"select","default":"classic","options":[{"value":"classic","label":"Yellow-green"},{"value":"amber","label":"Amber"},{"value":"aqua","label":"Aqua"},{"value":"mixed","label":"Green and amber"}]},{"key":"fireflies","label":"Fireflies","type":"integer","min":10,"max":200,"step":5,"default":90},{"key":"flashes","label":"Flashes per loop","type":"integer","min":3,"max":9,"step":1,"default":5},{"key":"sync","label":"Falling into step","help":"How far the fireflies synchronise in the middle of the loop.","type":"number","min":0,"max":1,"step":0.05,"default":0.8},{"key":"wind","label":"Wind","type":"number","min":0,"max":1.6,"step":0.05,"default":1},{"key":"grass","label":"Grass height","type":"number","min":0.6,"max":1.5,"step":0.05,"default":1},{"key":"moon","label":"Moonlight","type":"number","min":0.3,"max":1.6,"step":0.05,"default":1},{"key":"mist","label":"Mist","type":"number","min":0,"max":1.6,"step":0.05,"default":1},{"key":"glow","label":"Firefly brightness","type":"number","min":0.5,"max":1.6,"step":0.05,"default":1},{"key":"seed","label":"Seed","type":"integer","min":1,"max":999,"step":1,"default":8}],"presets":[{"id":"default","label":"Summer night","params":{}},{"id":"amber","label":"Amber evening","params":{"palette":"amber","fireflies":70,"moon":0.5,"mist":1.4,"wind":0.7,"seed":14}},{"id":"aqua","label":"Aqua glow","params":{"palette":"aqua","fireflies":130,"flashes":7,"sync":0.5,"seed":21}},{"id":"synchrony","label":"Synchrony","params":{"fireflies":190,"flashes":4,"sync":1,"glow":1.2,"moon":0.7,"seed":5}}],"output":{"width":1080,"height":1080,"fps":30,"durationSeconds":12,"posterSeconds":6,"alpha":false,"motion":"procedural","loop":{"seamless":true,"cycleSeconds":12,"method":"The grass is bent by waves that travel a whole number of cycles per loop; each firefly follows a Lissajous path of whole numbers of cycles and flashes a whole number of times per loop, with a phase offset that fades to zero at the loop's middle and returns; the stars twinkle in whole cycles and the camera sways in a sine of the loop, so the last frame meets the first."},"seed":{"param":"seed","behavior":"Seed places every blade of grass and every firefly, their paths, rhythms and the stars: same seed, same meadow."}},"composition":{"inputs":"Time within the loop; the glow, number and rhythm of the fireflies, how far they synchronise, wind, grass height, moonlight, mist.","outputs":"A full frame: a sky and hills drawn by a shader, 16,000 blades of grass and the fireflies as instanced geometry positioned in the vertex shader.","coordinates":"Perspective, 46° field of view; the camera stands 1 unit above the grass 4.2 from the origin; grass fills x ±2 to ±12, z +2.3 to -16; fireflies roam z +3 to -11 and up to 2.6 high.","lighting":"Self-lit fireflies; the grass is lit by a moon and, with an inverse-square falloff, by twelve of the fireflies.","timing":"update(time, loopSeconds) sets the loop time; every position and brightness is a closed-form function of it, so frames render in any order.","compatibleWith":["kinetic-title","number-reveal"],"notes":["A firefly flashes with phase = flashes × t + offset × (1 − s(t)), where s rises from 0 at the loop start to the Falling-into-step amount in the middle and falls back: the offsets are all gone when s = 1 and the meadow flashes as one.","The grass hides the fireflies behind it (the fireflies are depth-tested, not written to the depth buffer)."]},"reuse":["Sleep or meditation loop: Summer night.","Fantasy or children's story: Aqua glow behind a title.","A moment of wonder: Synchrony, with the title appearing at the flash in the middle of the loop."],"integration":{"newProject":"Create a WebGLRenderer, createFireflyMeadow({ aspect }) and createBloomPass(renderer, { width, height }); call meadow.setSize(width, height), then each frame meadow.update(time, loopSeconds) and bloom.render(meadow.scene, meadow.camera).","existingProject":"Copy src/firefly-meadow.js; render meadow.scene with meadow.camera into a render target (or through the bloom pass) as the backdrop of your scene."},"performance":{"notes":"Some 220,000 grass vertices (each lit by twelve fireflies) and up to 200 firefly quads, all computed in vertex shaders, plus a sky shader and a small bloom. About 15 ms a frame at 1080p on an integrated Intel GPU.","limits":"Up to 200 fireflies and 16,000 blades."},"limitations":["The grass is shaded blades with no texture or variation in colour beyond a little hue; flowers and insects are not drawn.","Only twelve of the fireflies light the grass."],"license":{"spdx":"MIT","notice":"Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.","thirdParty":[{"name":"three.js","version":"0.185.1","license":"MIT","url":"https://github.com/mrdoob/three.js"}]},"rights":{"approvedForPublicRelease":true},"provenance":"Adapted from the owner's threejs-sketches/nature-organic/firefly-meadow (with webgpu-firefly-sync, MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original scene: grass and fireflies solved in closed form in vertex shaders, flashes that fall into step once a loop, a moonlit sky with hills and mist, an exact loop and the frame/time contract.","changelog":[{"version":"1.0.0","date":"2026-10-05","notes":"Initial release."}],"verification":{"testedOn":"2026-10-06","inputs":{"firefly-meadow@1.0.0":"b2ca4851b5a4b4c8cab8c983e83d58f9c8b4a57d1ab7fa789a4c5bb40ba83345","three@0.185.1":"664ca387e5fab46ff2daaa6895e1d015426850891af5ea5082cbbcc3985b068c","apw-runtime@1.0.0":"5be859cdac74823ba0bcc32c6daf06688a871104d24db5d4ceaffffd84d7c40d"},"environment":"Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0","renderer":"WebGL 2 via SwiftShader (software)","width":1080,"height":1080,"fps":30,"frames":360,"renderSeconds":3327.6,"loopCheck":{"checked":true,"seamless":true,"maxDifference":0,"note":"Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255."},"determinism":{"checked":true,"identical":true},"errors":[],"media":{"poster":"/media/firefly-meadow/1.0.0/poster.webp","preview":"/media/firefly-meadow/1.0.0/preview.mp4","sample":"/media/firefly-meadow/1.0.0/sample.mp4","sampleBytes":6706149}},"files":[{"path":"LICENSE","size":1072,"sha256":"8a5f3a96f07e11522ec4bdd0a583356f99bad1245920f9709cee09b995a45153","contentType":"text/plain; charset=utf-8","url":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/LICENSE"},{"path":"asset.json","size":10129,"sha256":"74c693a0f62768e3be8a5e54fda738b93da42c9331b07576712c4f7b02f414d7","contentType":"application/json; charset=utf-8","url":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/asset.json"},{"path":"demo.js","size":1235,"sha256":"30c044749e025f29f9d5a26442cd02cd261c03a16275aa5bd8e1ed95fa81dafe","contentType":"text/javascript; charset=utf-8","url":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/demo.js"},{"path":"index.html","size":528,"sha256":"35da19274b5443acbb5ffb297a3a491045af91b8639de66e8a1fa124e7aaa2e4","contentType":"text/html; charset=utf-8","url":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/index.html"},{"path":"src/firefly-meadow.js","size":23448,"sha256":"cd64a2df4263d1b079557bd7fcf613672a7c35540bb821498c9b51a6c542b39e","contentType":"text/javascript; charset=utf-8","url":"https://aipixelwizard.com/registry/firefly-meadow/1.0.0/src/firefly-meadow.js"}],"warnings":[]}