Adds many functions related to visual arithmetics.
All operators in this extension are actually wrappers that let you operate by either a number (or array or function as with regular hydra) or a texture. This basically means you can both do osc().add(noise())
or osc().add(1)
and both will work as expected.
.div( divisor )
Divide a texture by some value or texture
single value | texture |
---|---|
.add( value ) |
.add( tex , amount ) |
.sub( value ) |
.sub( tex , amount ) |
.mult( value ) |
.mult( tex , amount ) |
These act the same as in regular Hydra, with the added functionality of working with regular values too.
.mod( x )
Calculates the modulo x
for the texture that calls it.
.min( x )
, .max( x )
Returns the minimum or maximum value when compared to the texture that calls it, accordingly.
.step( x )
Generates a step function by comparing x to the texture that calls it.
.amp( singleValue ) == .amplitude( singleValue )
, .offset( singleValue ) == .off( singleValue )
These are basically aliases for .mult()
and .add()
for single values.
.bipolar( amp = 1 )
Takes unipolar values (values ranged from 0 to 1) and turns them to bipolar (ranged from -1 to 1). The amp
argument let's you multiply the result by some value if needed.
.unipolar( amp = 1 )
Takes bipolar values (-1 to 1) and turns them to unipolar (0 to 1). The amp
argument let's you multiply the result by some value if needed.
.range( min = 0, max = 1 )
Allows you to change the range the range of unipolar values to one between min
and max
.
.birange( min = 0, max = 1 )
Allows you to change the range the range of bipolar values to one between min
and max
.
.clamp( min = 0, max = 1 )
clamp
will constrain values between a range from min
to max
.
This extension also adds many argument-less transforms. You can use them as such, for example: osc().abs()
.
Returns the absolute value.
Returns only the fractional part of a value.
Sign function, will return 1 for positive values and -1 for negative values.
The following are included: sin
, cos
, tan
, asin
, acos
, atan
The following are included: exp
, log
, exp2
, log2
, sqrt
, inversesqrt