splat3

One number copied into all three channels of a vec3.

splat3(x: Val): Expr

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

The usual way to blend two colors by a single amount with mix.

Parameters

NameTypeNotes
xVal

Example

const rgb = mix(darkRgb, lightRgb, splat3(brightness))

See also

  • mix — A blend from a to b by t, where 0 gives a and 1 gives b.
  • vec3 — A 3D vector from three values, often a color without alpha.

Used by

Aurora, CarbonFiber, Chrome, Crystal, FlowingGradient, Frost, Hologram, Holographic, Irradiance, Nebula, Obsidian, Plastic, Prism, ReactionDiffusion, Sparkle, StudioBackground, Water