vec2

A 2D vector from two values.

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

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

Parameters

NameTypeNotes
xVal
yVal

Example

const offset = vec2(params.uniforms.shiftX, params.uniforms.shiftY)

See also

  • vec3 — A 3D vector from three values, often a color without alpha.
  • vec4 — A 4D vector, usually the final color with alpha.

Used by

ChromaFlow, Chrome, CompressionArtifacts, Crystal, FlowingGradient, Frost, Heatmap, Hologram, Irradiance, LiquidMetal, Marble, MeshGradient, Nebula, PixelSort, Plastic, ReactionDiffusion, Sparkle, Water