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): void
import { reduceNormalMip } from '@driftengine/texture';

Parameters

ParameterTypeDescription
srcFloat32Array
widthnumber
heightnumber
outNormalFloat32Array
outRoughnessFloat32Array
baseRoughness?number

In depth

src holds width * height normals as xyz triples, already unbiased into -1..1.