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 HairModel
import type { HairModel } from '@driftengine/core';

Properties

NameTypeDescription
kindreadonly'hair'
shiftreadonlynumberRadians 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.
scatterreadonlynumber0 to 1: the light scattered through many strands, tinted by their colour.
backlitreadonlynumberHow strongly light from behind glows through: the transmitted lobe.
directionOffsetreadonlynumberWhere 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.