lightVec3
A 3D light direction from a direction() vector and an elevation.
lightVec3(dir: Expr, z: number, hint: string = 'L'): Expr
Import materials from shaders/std and use materials.lightVec3.
z is negative for a light on the viewer's side of the surface (−0.6 raking to −0.9 frontal). Use it where a word wants a unit light vector. keyLightAt also gives the half vector for highlights.
Parameters
| Name | Type | Notes |
|---|---|---|
dir | Expr | |
z | number | |
hint | string | Optional. Default 'L'. |
Example
const L = lightVec3(direction(u.lightAngle), -0.7)
See also
keyLightAt— A key light from an angle: the light direction.Land the half vector.Hfor highlights.anisoSpecular— A highlight stretched along a grain, as on brushed metal or carbon fibre.lambert— How much a light falls on a surface: 0 facing away, 1 facing it.