Model loading · interface

EncodedMaterial

Explained in Importing models.

interface EncodedMaterial
import type { EncodedMaterial } from '@driftengine/assets';

Properties

NameTypeDescription
latentreadonlyUint8Array
latentWidthreadonlynumber
latentHeightreadonlynumber
componentsreadonlynumber
weightsreadonlyFloat32Array
shapereadonlyNetworkShape
graphreadonlyDecodeGraph
mipsreadonlyreadonly { width: number; height: number; data: Uint8Array; }[]
mipRoughnessreadonlyFloat32Array | nullThe roughness a variance-preserving mip reduction handed back, or null.
More

Non-null exactly when a channel's semantic says mipping it must preserve the normal distribution. A normal map averaged naively loses the disagreement between neighbouring normals, and the surface reads as polished at distance — the roughness is where that disagreement goes instead of being thrown away.