DriftTexture · function
reduceNormalMip
Reduce a block of normals to one, writing both the direction and the roughness it implies.
Explained in DriftTexture.
function reduceNormalMip(src: Float32Array, width: number, height: number, outNormal: Float32Array, outRoughness: Float32Array, baseRoughness?: number): voidimport { reduceNormalMip } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
src | Float32Array | |
width | number | |
height | number | |
outNormal | Float32Array | |
outRoughness | Float32Array | |
baseRoughness? | number |
In depth
src holds width * height normals as xyz triples, already unbiased into -1..1.