Modulation
Modulation is one of the most powerful techniques in Hydra. It uses the colors of one source to distort the geometry of another.
How modulation works
When modulating:
- The modulator’s red channel → offset along X
- The modulator’s green channel → offset along Y
- Bright areas are distorted more
modulate() — Basic modulation
source.modulate(texture, amount)
modulateScale() — Scale modulation
Changes the scale of different parts of the image.
modulateRotate() — Rotation modulation
Applies a different amount of rotation to different parts of the image.
modulateHue() — Hue modulation
modulateKaleid() — Kaleidoscope modulation
modulateRepeat() — Repetition modulation
modulatePixelate()
Complex examples
Layered modulation
Self-modulation (feedback)
Cross modulation
Combining with color
Modulation tips
- Start with small values (0.1-0.3)
- Use noise() as the modulator for organic distortions
- Combine with color effects
- Animate the intensity:
() => Math.sin(time) * 0.3