Blend

Multiple outputs #

By default, hydra contains four separate virtual outputs that can each render different visuals, and can be mixed with each other to create more complex visuals. The variables o0, o1, o2, and o3 correspond to the different outputs.

To see all four of the outputs at once, use the render() function. This will divide the screen into four, showing each output in a different section of the screen.

Using a different variable inside the .out() function renders the chain to a different output. For example, .out(o1) will render a function chain to graphics buffer o1.

By default, only output o0 is rendered to the screen, while the render() command divides the screen in four. Show a specific output on the screen by adding it inside of render(), for example render(o2) to show buffer o2.

Trick: try to create different sketches and switch them in your live performance or even combine them.

Blending multiple visual sources together #

You can use blend functions to combine multiple visual sources. .blend() combines the colors from two sources to create a third source.

Try adding transformations to the above sources (such as osc(10).rotate(0, 0.1).out(o1)) to see how it affects the combined image. You can also specify the amount of blending by adding a separate parameter to .blend(), for example .blend(o1, 0.9).

There are multiple blend modes in hydra, similar to blend modes you might find in a graphics program such as photoshop or gimp. See the function reference for more possibilities.

Available blend funcitons #

add #

add( texture, amount = 1 )

Add textures. The texture parameter can be any kind of source, for example a color, src, or shape.

sub #

sub( texture, amount = 1 )

layer #

layer( texture )

Overlay texture based on alpha value. The texture parameter can be any kind of source, for example a color, src, or shape.

blend #

blend( texture, amount = 0.5 )

Blend textures. The texture parameter can be any kind of source, for example a color, src, or shape.

mult #

mult( texture, amount = 1 )

Multiply images and blend with the texture by amount. The texture parameter can be any kind of source, for example a color, src, or shape.

diff #

diff( texture )

Return difference of textures. The texture parameter can be any kind of source, for example a color, src, or shape.

mask #

mask( texture )