Skip to content

DistortionWaves2DEffect

Category: effect | Tags: 🔥🟦🐙

Two interfering sine waves mapped to hue. Ported from WLED's Distortion Waves effect. For each pixel at (x, y):

val = sin(x * freq_x * 2π/W + t) + sin(y * freq_y * 2π/H + t * 1.3)
hue = (val + 2.0) / 4.0 * 255

The phase offset of 1.3 between the x-wave and y-wave creates a slowly evolving interference pattern.

Controls

Control Type Range Default Description
freq_x slider 1-8 3 Number of full horizontal wave cycles across the panel width
freq_y slider 1-8 3 Number of full vertical wave cycles across the panel height
speed slider 0-100 50 Animation speed (0 = frozen)

Wiring

{
  "type": "DistortionWaves2DEffect",
  "inputs": { "layer": "<effects-layer-id>" }
}

Implementation notes

  • Saturation is fixed at 240 for a vivid but slightly desaturated look that matches the WLED original.
  • No heap allocation.

Health report

freq_x=3 freq_y=3 speed=50 checksum=12345

Tags

Emoji Meaning
🔥 Effect
🟦 2D+
🐙 WLED port