ambient-leaves
The one ambient effect that is not a sprite.
Motes, rain and bubbles are camera-facing dots — a billboard always turns its face to you, which
is exactly what you want for something round. A leaf is not round. Its whole read is that it
tumbles: it flashes broadside, thins to an invisible edge, flips, shows its back. A billboard
can never do that (it has no back to show), so leaves are real two-sided quads with per-particle
3-D rotation — a Babylon SolidParticleSystem, not a ParticleSystem.
Everything else is shared with b3d-ambient: the emitter box rides the camera so
the cost is fixed no matter how big the world is, the population is what the budget grants, and the
field DRAINS rather than being switched off. B3dAmbient owns all of that and drives this renderer;
this file owns only the tumble.
Wind is a placeholder here. Each leaf carries its own drift + sway + tumble, which reads fine in isolation but doesn't AGREE with the rain or the smoke. The shared
wind(x,y,z,t)field (TODO) is what makes them all blow the same way — when it lands, drift/sway come from it and this per-leaf randomness becomes just the flutter on top.
See it live
LeafField is the tumbling-quad renderer that b3d-ambient drives — set that
component up (its demo blows leaves through the scene) and the budget decides the population.
import { LeafField } from 'tosijs-3d'
// A LeafField rides the camera and renders whatever population the budget grants. b3d-ambient owns
// the budget + drain, so prefer <tosi-b3d-ambient> unless you're wiring your own ambient system.