lambert

How much a light falls on a surface: 0 facing away, 1 facing it.

lambert(normal: Expr, light: Expr, opts: {wrap?: Expr | number} = {}): Expr

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

normal and light are unit vectors, both 2D or both 3D. wrap lets light reach around the shape: 0 is a hard terminator, 1 lights it all the way round.

Parameters

NameTypeNotes
normalExpr
lightExpr
opts{wrap?: Expr | number}Optional. Default {}.

Example

const diffuse = lambert(n, key.member('L'), {wrap: 0.3})

See also

  • keyLightAt — A key light from an angle: the light direction .L and the half vector .H for highlights.
  • pointLightFrom — A point light as seen from a point on the shape: the 3D light vector L, the 2D direction toLight and the distance.
  • dualLobeGlint — A highlight with a tight hot core and a wide dim halo.

Used by

Irradiance, Voxels