Drifting Air (ambientDrift)
Put living air in any scene with one component. Fireflies drifting over a lawn at night, cherry blossom petals tumbling past a stone lantern, warm sparks rising lazily from a lantern, snow, autumn leaves, dust motes glittering in a sunbeam. Every style takes the same fields, runs on the engine's GPU particle solver and is seeded, so every player sees the same particles.
This world's startup scene is a night garden: cherry trees in bloom, stone lanterns with warm light and sparks, fireflies and glowing spores over the moss, low mist, all on a worldClockKit day/night clock.
14 styles
- fireflies: yellow-green lights rising from the grass, wandering and blinking; bright points even 40 m away, by day or night
- cherryPetals: notched sakura petals tumbling and fluttering down, translucent against the sun
- autumnLeaves: red, orange, gold and brown leaves swinging down
- dustMotes: tiny specks glittering in light shafts
- pollen: soft yellow fluff floating on warm air
- embers: orange flickering sparks rising off a fire and burning out
- lanternSparks (new): warm golden sparks drifting up lazily from lanterns, braziers and campfires, slower and softer than embers
- snow: soft flakes falling and swaying
- mistWisps: low torn fog drifting over ground and water
- waterSpray: fine spray at a waterfall's foot with a rainbow
- ash: grey flakes falling, a few still smouldering
- glowSpores: bioluminescent teal and green motes
- drizzle: light rain streaks leaning with the wind
- sparkles: twinkling magic stars
Follows the time of day
Set followClock = "auto" and a field follows worldClockKit's WorldClock when the scene has one: fireflies, glowing spores and lantern sparks fade in at dusk, glow brighter as it darkens and fade out at dawn; dust motes, pollen and cherry petals do the opposite. worldClockKit is optional: with no clock, nothing changes.
Light on the web and tablets
quality = "auto" picks the low tier on phones, tablets and Android, medium in a desktop browser and high in the native app. Every style lists its particle count per tier.
Use it
entity.spawnSynced("Fireflies").component.add("Drift", { style = "fireflies", followClock = "auto" })
Fields: style, width/height/depth, density, fadeSeconds, windDirection, windStrength, mood (calm/normal/windy), tint, tintAmount, followCamera, quality, sizeScale, brightness, followClock, seed, playing. From code: require("ambientDrift.api").start(style, opts) with fadeTo, setStyleParams, stop for cutscenes and films. Guides: How to add fireflies, falling petals, snow, embers, dust and other drifting particles and Example: a night garden with fireflies, cherry petals and lantern sparks.
1.0.1 / 1.0.2
Fields now stand where their entity is (1.0.0 centred every field on the world origin, which hid fireflies and embers placed anywhere else), glowing styles are brighter and never shrink below a couple of pixels, new lanternSparks style, followClock and brightness; 1.0.2 keeps glow colours readable against bright skies.
Comments · 0
Open discussion, no rating attached. Ask questions, swap notes, follow threads.
Documented parts · 9
- airDrifteffect
- ambientDriftpackage
- apimodule
- clockmodule
- Driftcomponent
- driftCardshader
- field.procGraphprocgraph
- lanternSparks.procGraphprocgraph
- mainscene