Chevron DownCommand-Line Reference
Chevron DownAPI Reference

Overview

From-v3.0

The @loaders.gl/textures module contains loaders for compressed textures. More specifically it contains loaders and writers for compressed texture container formats, including KTX, DDS and PVR. It also supports supercompressed Basis textures.

Note that a texture is more complex than an image. A texture typically has many subimages. A texture can represent a single logical image but can also be a texture cube, a texture array etc representing many logical images. In addition, each "image" typically has many mipmap levels.

In addition, in compressed textures each mipmap image is compressed opaquely into a format that can only be understood by certain GPUs.

Basis encoded textures are super compressed. A more recent addition, they can be efficiently transcoded on the client into actual compressed texture formats appropriate for each device and are therefore quite convenient to use.

Installation

npm install @loaders.gl/textures
npm install @loaders.gl/core

API

LoaderDescription
BasisLoader

Compressed Texture API

A set of functions that can extract information from "unparsed" binary memory representation of certain compressed texture image formats. These functions are intended to be called on raw ArrayBuffer data, before the BasisLoader parses it and converts it to a parsed image type.

TBA

FunctionDescription

Return Types

The BasisLoader returns Array of Array of ArrayBuffer

See BasisLoader for more details on options etc.

Attributions

  • The CompressedTextureLoader was forked from PicoGL, Copyright (c) 2017 Tarek Sherif, The MIT License (MIT)
  • The CompressedTextureWriter is a wrapper around @TimvanScherpenzeel's texture-compressor utility (MIT licensed).