Files
hydra/docs/funcs_operators.md
Jack Armitage fbde509fbc examples
2019-03-20 22:05:16 +00:00

1.9 KiB

Operators

Functions for performing operations on sources.

add

.add( texture, amount )

  • texture
  • amount :: float (default 0.5)

Add textures.

Example

shape().scale(0.5).add(shape(4),[0,0.25,0.5,0.75,1]).out()

osc(9,0.1,1).add(osc(13,0.5,5)).out()

blend

.blend( texture, amount )

  • texture
  • amount :: float (default 0.5)

Blend textures.

Example

shape().scale(0.5).blend(shape(4),[0,0.25,0.5,0.75,1]).out()

osc(9,0.1,1).blend(osc(13,0.5,5)).out()

diff

.diff( texture )

Return difference of textures.

Example

osc(9,0.1,1).diff(osc(13,0.5,5)).out()

osc(1,1,2)
  .diff(shape(6,1.1,0.01)
        .scale(({time})=>Math.sin(time)*0.05 + 0.9)
        .kaleid(15)
        .rotate(({time})=>time%360))
  .out()

layer

.layer( texture )

Overlay texture based on alpha value.

Example

solid(1,0,0,1).layer(shape(4).color(0,1,0,({time})=>Math.sin(time*2))).out()

mult

.mult( texture, amount )

  • texture
  • amount :: float (default 1.0)

Multiply images and blend with the texture by amount.

Example

osc(9,0.1,2).mult(osc(13,0.5,5)).out()