pow

The first value raised to the power of the second.

pow(x: Val, y: Val): Expr

Import math from shaders/std and use math.pow.

Shapes a 0..1 value: powers above 1 push it toward 0, powers below 1 toward 1. Keep the base non-negative.

Parameters

NameTypeNotes
xVal
yVal

Example

const hardened = pow(coverage, params.uniforms.hardness)

See also

  • sqrt — The square root of a value.
  • exp — e raised to the value.

Used by

Aurora, CarbonFiber, Crystal, FlowingGradient, Frost, Goo, Heatmap, Hologram, Holographic, Irradiance, Nebula, Plastic, ReactionDiffusion, Voxels, Water