keyLightAt

A key light from an angle: the light direction .L and the half vector .H for highlights.

keyLightAt(dir: Expr, elevation: number, hint: string = 'kl'): Expr

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

dir is a direction() vector (from frames). elevation is how far the light sits toward the viewer: −0.6 raking, −0.9 frontal. Read .L with member('L') for lambert and .H for a glint.

Parameters

NameTypeNotes
dirExpr
elevationnumber
hintstringOptional. Default 'kl'.

Example

const key = keyLightAt(direction(u.lightAngle), -0.7)

Tip. Elevation is negative in this engine. A positive value lights the surface from behind.

See also

  • keyLightXY — A key light from explicit x and y components, for a second or a crossed light.
  • lightVec3 — A 3D light direction from a direction() vector and an elevation.
  • lambert — How much a light falls on a surface: 0 facing away, 1 facing it.
  • dualLobeGlint — A highlight with a tight hot core and a wide dim halo.
  • sharpGlint — A highlight whose tightness follows a sharpness slider.

Used by

Frost, Goo, LiquidMetal, Nebula, Plastic, Water