add
The sum of two values.
add(a: Val, b: Val): Expr
Import math from shaders/std and use math.add.
Works on numbers and on vectors of the same size.
Parameters
| Name | Type | Notes |
|---|---|---|
a | Val | |
b | Val |
Example
const lifted = add(mul(noise, 0.5), 0.5) // a −1..1 signal moved into 0..1
See also
Used by
Aurora, Blob, BrushedMetal, CarbonFiber, ChromaFlow, Chrome, CompressionArtifacts, Crystal, FlowingGradient, Frost, Goo, Heatmap, Hologram, Holographic, Irradiance, LiquidMetal, Marble, MeshGradient, Nebula, Obsidian, Plastic, Prism, ReactionDiffusion, Sparkle, StudioBackground, Voxels, Water, Waveform