tiltNormal

Tilts a normal along and across a direction, for brushed or woven relief.

tiltNormal(
  n: Expr,
  frame: DirectionFrame,
  slopes: {along?: Expr; across?: Expr},
  hint: string = 'n',
): Expr

Import materials from shaders/std and use materials.tiltNormal.

frame is a directionFrame (from frames). along and across are slope amounts; a few tenths is a visible relief.

Parameters

NameTypeNotes
nExpr
frameDirectionFrame
slopes{along?: Expr; across?: Expr}
hintstringOptional. Default 'n'.

Example

const n = tiltNormal(nGeo, brush, {across: reliefAcross, along: reliefAlong})

See also

  • nudgeNormal — Tilts a normal by a slope in x and y, turning a height field into relief.
  • tiltAlong — Tilts a normal along one 2D direction by a slope amount.
  • grainNoise — One octave of smooth signed noise along and across a direction, for grain.

Used by

BrushedMetal