Model loading · function

ddsToRgba

Decode a DDS surface's level 0 into RGBA.

Explained in Importing models.

function ddsToRgba(bytes: Uint8Array): DdsImage
import { ddsToRgba } from '@driftengine/assets';

Parameters

ParameterTypeDescription
bytesUint8Array

In depth

A surface whose dimensions are not multiples of four is decoded block by block and cropped, which is what the format itself does: the blocks cover a padded rectangle and the texels outside the declared size are padding rather than image.