reflect

The direction i bounced off a surface with unit normal n.

reflect(i: Val, n: Val): Expr

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

Parameters

NameTypeNotes
iVal
nVal

Example

const bounce = reflect(viewDir, normal)

See also

  • refract — The direction i bent through a surface with unit normal n.
  • normalize — The vector scaled to length 1.