Model loading · function

decodeBc

A whole surface of blocks into RGBA, eight bits a channel, width by height. A surface that is not a whole number of blocks is decoded block by block and cropped, which is what the format does: the blocks cover a padded rectangle and the texels past the declared size are padding.

Explained in Importing models.

function decodeBc(format: BcFormat, width: number, height: number, blocks: Uint8Array, out?: Uint8Array): Uint8Array
import { decodeBc } from '@driftengine/assets';

Parameters

ParameterTypeDescription
formatBcFormat
widthnumber
heightnumber
blocksUint8Array
out?Uint8Array