anisoSpecular
A highlight stretched along a grain, as on brushed metal or carbon fibre.
anisoSpecular(opts: {
normal: Expr
/** The 2D grain direction. */
tangent: Expr
/** A unit 3D light direction (see `lightVec3`). */
light: Expr
view: Expr
alphas: {along: Expr; across: Expr}
gain?: Expr | number
}): Expr
Import materials from shaders/std and use materials.anisoSpecular.
tangent is the 2D grain direction, light a unit 3D light vector, view the view ray and alphas the widths from wardAlphas. Pass gain or scale the result yourself.
Parameters
| Name | Type | Notes |
|---|---|---|
opts | `{ |
normal: Expr
/** The 2D grain direction. */
tangent: Expr
/** A unit 3D light direction (see `lightVec3`). */
light: Expr
view: Expr
alphas: {along: Expr; across: Expr}
gain?: Expr \| number
}` | |
Example
const spec = anisoSpecular({normal: n, tangent: brush.tangent, light: lightVec3(direction(u.lightAngle), -0.7), view, alphas: wardAlphas(rough, aniso), gain: u.specular})
See also
wardAlphas— Turns roughness and anisotropy sliders (0–1 each) into the two lobe widthsanisoSpeculartakes.lightVec3— A 3D light direction from adirection()vector and an elevation.sharpGlint— A highlight whose tightness follows a sharpness slider.dualLobeGlint— A highlight with a tight hot core and a wide dim halo.