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
| Name | Type | Notes |
|---|---|---|
normal | Expr | |
light | Expr | |
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.Land the half vector.Hfor highlights.pointLightFrom— A point light as seen from a point on the shape: the 3D light vectorL, the 2D directiontoLightand thedistance.dualLobeGlint— A highlight with a tight hot core and a wide dim halo.