Skip to content

LavaLampEffect

Source: LavaLampEffect.h

LavaLampEffect

class LavaLampEffect
src/light/effects/LavaLampEffect.h:14

Inherits: EffectBase

Lava-lamp effect: slow rising and merging palette blobs.

LavaLampEffect card LavaLampEffect controls

Three slow blobs whose summed field indexes the palette, so the lamp takes its colors. MetaballsEffect runs the same field fast and in HSV instead.

Public Attributes

uint8_t bpm = 8 : How fast they drift.

uint8_t radius = 36 : How large each blob's field reaches.

uint8_t intensity = 200 : How strongly the summed field reads, which is what merges the blobs.

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 drift, the blob size and the field's strength.

virtual inline void tick() override : Place each blob on its orbit, then index the palette by the summed field.

Public Static Attributes

constexpr uint8_t NUM_BLOBS = 3 : How many blobs share the lamp.

constexpr draw::BlobPath BLOB_PATHS = { {1, 0, 64}, {2, 80, 200}, {1, 160, 100}, } : The orbits that make this a lava lamp, at class scope since a static local is flagged.