Skip to content

DissolveEffect

Source: DissolveEffect.h

DissolveEffect

class DissolveEffect
src/light/effects/DissolveEffect.h:27

Inherits: EffectBase

Effect: two color fields trading places pixel by pixel, with no per-pixel state.

DissolveEffect card DissolveEffect controls

The order looks random but is computed rather than stored. Each pixel asks a hash of its own position for a threshold, and compares it against the progress.

Prior art: the classic dissolve, where the position-addressed form is the shader approach.

Public Attributes

uint8_t bpm = 12 : How fast one transition completes.

uint8_t spread = 60 : How long a pixel spends mid-flight, where 0 gives a hard edge.

bool eased = true : Ease the progress rather than sweeping it linearly, which reads as mechanical.

bool scatter = true : Dissolve in a scattered order, or wipe positionally when off.

Public Methods

virtual inline const char * tags() const override : Catalog tags: this effect is the power-function showcase.

virtual inline Dim dimensions() const override : Writes the z=0 slice, which extrude fills through a volume.

virtual inline void defineControls() override : Publish the transition's speed, its softness and its order.

virtual inline void tick() override : Compare each pixel's own threshold against the transition's progress.

More info

The point is what it does not need

A dissolve normally shuffles a list of pixel indices, which costs memory and must stay in step. Here there is no array, no shuffle and no per-pixel state. Two devices agree without exchanging anything, since the hash is a function of position.

That is the supersync property: a stream generator advances per call and drifts, and this cannot.

Cost is one hash and one compare a pixel, with nothing scaling beyond the pixel count.