Modulators
Functions for describing modulations of sources.
- modulate
- modulateHue
- modulateKaleid
- modulatePixelate
- modulateRepeat
- modulateRepeatX
- modulateRepeatY
- modulateRotate
- modulateScale
- modulateScrollX
- modulateScrollY
modulate
.modulate( texture, amount )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
amount
:: float (default0.1
)
Modulate texture. More about modulation at: https://lumen-app.com/guide/modulation/
Example
// chocolate whirlpool
voronoi()
.color(0.9,0.25,0.15)
.rotate(({time})=>(time%360)/2)
.modulate(osc(25,0.1,0.5)
.kaleid(50)
.scale(({time})=>Math.sin(time*1)*0.5+1)
.modulate(noise(0.6,0.5)),
0.5)
.out(o0)
modulateHue
.modulateHue( color, amount )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
amount
:: float (default1.0
)
Changes coordinates based on hue of second input. Based on:https://www.shadertoy.com/view/XtcSWM
Example
modulateKaleid
.modulateKaleid( nSides )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
nSides
:: float (default4.0
)
See also: kaleid
.
Example
osc(9,-0.1,0.1)
.modulateKaleid(osc(11,0.5,0),50)
.scale(0.1,0.3)
.modulate(noise(5,0.1))
.mult(solid(1,1,0.3))
.out(o0)
modulatePixelate
.modulatePixelate( multiple, offset )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
multiple
:: float (default10.0
)offset
:: float (default3.0
)
See also: pixelate
Example
// what lies beneath
voronoi(10,1,5).brightness(()=>Math.random()*0.15)
.modulatePixelate(noise(25,0.5),100)
.out(o0)
modulateRepeat
.modulateRepeat( texture, repeatX, repeatY, offsetX, offsetY )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
repeatX
:: float (default3.0
)repeatY
:: float (default3.0
)offsetX
:: float (default0.5
)offsetY
:: float (default0.5
)
Example
// default
shape(4,0.9)
.mult(osc(3,0.5,1))
.modulateRepeat(osc(10), 3.0, 3.0, 0.5, 0.5)
.out(o0)
modulateRepeatX
.modulateRepeatX( texture, reps, offset )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
reps
:: float (default3.0
)offset
:: float (default0.5
)
Example
// straight lines illusion
shape(4,0.9)
.mult(osc(4,0.25,1))
.modulateRepeatX(osc(10), 5.0, ({time}) => Math.sin(time) * 5)
.scale(1,0.5,0.05)
.out(o0)
modulateRepeatY
.modulateRepeatY( texture, reps, offset )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
reps
:: float (default3.0
)offset
:: float (default0.5
)
Example
// morphing grid
shape(4,0.9)
.mult(osc(4,0.25,1))
.modulateRepeatY(osc(10), 5.0, ({time}) => Math.sin(time) * 5)
.scale(1,0.5,0.05)
.out(o0)
modulateRotate
.modulateRotate( texture, multiple, offset )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
multiple
:: float (default1.0
)offset
:: float (default0.0
)
See also: rotate
Example
// wormhole
voronoi(100,3,5)
.modulateRotate(osc(1,0.5,0).kaleid(50).scale(0.5),15,0)
.mult(osc(50,-0.1,8).kaleid(9))
.out(o0)
modulateScale
.modulateScale( multiple, offset )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
multiple
:: float (default1.0
)offset
:: float (default1.0
)
See also: scale
Example
// cosmic radiation
gradient(5).repeat(50,50).kaleid([3,5,7,9].fast(0.5))
.modulateScale(osc(4,-0.5,0).kaleid(50).scale(0.5),15,0)
.out(o0)
modulateScrollX
.modulateScrollX( multiple, scrollX, speed )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
scrollX
:: float (default0.5
)speed
:: float (default0.0
)
See also: scrollX
Example
// default
voronoi(25,0,0)
.modulateScrollX(osc(10),0.5,0)
.out(o0)
// different scroll and speed
voronoi(25,0,0)
.modulateScrollX(osc(10),0.5,0.25)
.out(o0)
modulateScrollY
.modulateScrollY( multiple, scrollX, speed )
texture
color
:: see colorvec4
src
:: seesrc
shape
:: seeshape
scrollY
:: float (default0.5
)speed
:: float (default0.0
)
See also: scrollY
Example
// default
voronoi(25,0,0)
.modulateScrollY(osc(10),0.5,0)
.out(o0)
// different scroll and speed
voronoi(25,0,0)
.modulateScrollY(osc(10),0.5,0.25)
.out(o0)