MetaballsEffect
Source:
MetaballsEffect.h
MetaballsEffect¶
src/light/effects/MetaballsEffect.h:15Inherits:
EffectBase
Metaballs effect: smooth merging blobs via a scalar field.

Each ball contributes a field that falls off with distance, and the sum picks the color. Where two balls approach, their fields add and the blobs appear to merge. LavaLampEffect runs the same field slowly through a palette instead.
Public Attributes¶
uint8_t bpm = 30
: How fast the balls travel their orbits.
uint8_t radius = 28
: How far each ball's field reaches.
uint8_t count = 4
: How many balls share the field, each on its own path.
uint8_t hue_shift = 0
: Walks the whole field around the palette.
Public Methods¶
virtual inline const char * tags() const override
: Catalog tags: MoonLight origin, David Jupijn and Rising Step.
virtual inline Dim dimensions() const override
: Iterates y and x, which extrude fills through a volume.
virtual inline void defineControls() override
: Publish the orbit speed, the ball size and count, and the palette shift.
virtual inline void tick() override
: Place each ball on its orbit, then color every pixel by the summed field.
Public Static Attributes¶
constexpr uint8_t MAX_BALLS = 8
: The orbit table's size, and so the ball count's ceiling.
constexpr draw::BlobPath BLOB_PATHS = {
{1, 0, 64}, {2, 30, 94}, {3, 60, 124}, {1, 120, 184},
{2, 160, 16}, {3, 200, 210}, {1, 90, 150}, {2, 220, 40},
}
: This effect's own orbits, at class scope since a static local is flagged in a nonblocking function.