Renderer · interface
HairModel
Hair: three lobes along the strand, which is the mesh's tangent, running from root to tip
(hairLobes.ts). A model map's red is the strand's specular, twice it scaling the reflected lobe
(0.5 is the lobe as drawn), its green turns each strand's tilt by up to half of it either way and
its blue is occlusion; directionOffset names a layer of it holding each strand's direction.
Explained in Hello world.
interface HairModelimport type { HairModel } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
kindreadonly | 'hair' | |
shiftreadonly | number | Radians the cuticle's scales tilt the strand's surface: positive moves the white highlight toward the root and the coloured one toward the tip. A card whose tangent runs tip to root takes it negative. |
scatterreadonly | number | 0 to 1: the light scattered through many strands, tinted by their colour. |
backlitreadonly | number | How strongly light from behind glows through: the transmitted lobe. |
directionOffsetreadonly | number | Where the model map holds each strand's direction: this many layers past the layer the texel's other channels are read at, so a model map of one layer with its directions in the next takes 1. The direction is in the surface's tangent frame, red along the tangent, green along the bitangent and blue out of the surface along its normal, each −1 to 1 packed as a normal map packs them, and the strand runs along it rather than along the tangent: a card's strands can lean out of its plane. 0, the default, is none. |