mul

The product of two values.

mul(a: Val, b: Val): Expr

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

Multiply a color by a 0..1 mask to fade it, or a coordinate by a prop to scale it.

Parameters

NameTypeNotes
aVal
bVal

Example

const rgb = mul(params.uniforms.color.member('rgb'), coverage)

See also

  • div — The first value divided by the second.
  • add — The sum of two values.

Used by

Arc, Aurora, Blob, BrushedMetal, CarbonFiber, Chrome, Circle, CompressionArtifacts, Crystal, FlowingGradient, Frost, Goo, Heatmap, Hologram, Holographic, InkFlow, Irradiance, LiquidMetal, Marble, MeshGradient, Nebula, Obsidian, PixelThrow, Plastic, Prism, ReactionDiffusion, SmokeFill, Sparkle, StudioBackground, Surface3D, TimeTrail, Voxels, Water, Waveform