Time expressions and animations
Any numeric parameter, or any component of a color, vec2, or vec3 parameter, can use an expression. The variable t is elapsed time
in seconds. A graph that uses t is animated.
Expression syntax
| Expression | Meaning |
|---|---|
1.25 | Number |
t | Elapsed time in seconds |
-x | Negation |
a + b | Addition |
a - b | Subtraction |
a * b | Multiplication |
a / b | Division |
(expression) | Grouping |
Functions
| Function | Result |
|---|---|
sin(x) | Sine of x in radians |
cos(x) | Cosine of x in radians |
abs(x) | Absolute value |
mod(a, b) | Euclidean remainder of a / b |
step(edge, x) | 0 below the edge, otherwise 1 |
log2(x) | Base-2 logarithm |
floor(x) | Round down |
ceil(x) | Round up |
min(a, b) | Smaller value |
max(a, b) | Larger value |
pow(base, exponent) | base raised to exponent |
sqrt(x) | Square root |
Example
The circle's Offset X value is t / 5. Offset wraps in UV space, so it completes one
cycle every five seconds.