Chevron Down
Table of Contents
Chevron DownAPI Reference

BasisLoader

The BasisLoader is experimental

A loader for Basis Universal "supercompressed" GPU textures. Extracts supercompressed textures from the basis container and efficiently "transpiles" them into the specified compressed texture format.

LoaderCharacteristic
File FormatBasis Universal
File Extension.basis
File TypeBinary
Data FormatArray of compressed image data objects
Supported APIsload, parse

Usage

import {BasisLoader} from '@loaders.gl/basis';
import {load} from '@loaders.gl/core';

const miplevels = await load(url, BasisLoader, options);
for (const compressedImage of miplevels) {
  ...
}

Options

OptionTypeDefaultDescription
basis.formatString'auto'Set to one of the supported compressed texture formats.

Compressed Texture Formats

The BasisLoader can transpile into the following compressed (and uncompressed) texture formats.

FormatDescription
etc1
etc2
bc1
bc3
bc4
bc5
bc7-m6-opaque-only
bc7-m5
pvrtc1-4-rgb
pvrtc1-4-rgba
astc-4x4
atc-rgb
atc-rgba-interpolated-alpha
rgba32
rgb565
bgr565
rgba4444