Skip to main content

Textures API · cube arrays

Load many cubemaps from one manifest.

TextureCubeArrayLoader reads a JSON manifest whose layers contain six cube faces. It keeps the face layout and optional mip chains explicit for environment, irradiance, and other layered texture data.

The cube-array path

Keep layers, faces, and mip levels addressable.

The manifest is the small piece of structure that a cube-array upload needs. Each layer names its six faces, and each face can point to one image, a mip chain, or a URL template.

Input

JSON manifest with one or more cubemap layers

Face layout

+X, -X, +Y, -Y, +Z, and -Z

Mip levels

Single paths, arrays, or inferred templates

Decode

ImageLoader by default, with Node polyfill support

Detailed guide

Cube-array manifest and options

The reference below documents manifest structure, face templates, mip-level discovery, and loader options.

From-v5.0

A loader for texture cube arrays described by a JSON manifest.

TextureCubeArrayLoader
File FormatJSON manifest
File Extension.json
File TypeText
Data FormatTexture
Supported APIsload, parse

Usage​

import {load} from '@loaders.gl/core';
import {TextureCubeArrayLoader} from '@loaders.gl/images/texture';

const imageCubeArray = await load(
'environment.image-texture-cube-array.json',
TextureCubeArrayLoader
);

Member faces are parsed with ImageLoader by default, returning native ImageBitmap in browsers and the installed Node.js ImageBitmap polyfill when @loaders.gl/core/polyfills is present.

Manifest​

{
"shape": "image-texture-cube-array",
"layers": [
{
"faces": {
"+X": "sky-right.png",
"-X": "sky-left.png",
"+Y": "sky-top.png",
"-Y": "sky-bottom.png",
"+Z": "sky-front.png",
"-Z": "sky-back.png"
}
},
{
"faces": {
"+X": "irr-right.png",
"-X": "irr-left.png",
"+Y": "irr-top.png",
"-Y": "irr-bottom.png",
"+Z": "irr-front.png",
"-Z": "irr-back.png"
}
}
]
}

Each layer is a cubemap manifest fragment. Each face entry can be either:

  • a single image path
  • an array of image paths representing mip levels
  • a template source object

Template source example:

{
"shape": "image-texture-cube-array",
"layers": [
{
"faces": {
"+X": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"},
"-X": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"},
"+Y": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"},
"-Y": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"},
"+Z": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"},
"-Z": {"mipLevels": "auto", "template": "cube-{index}-{face}-{lod}.png"}
}
}
]
}

Supported template placeholders are {lod}, {index}, {face}, {direction}, {axis}, and {sign}. Use \\{ and \\} to include literal braces in filenames.

Options​

OptionTypeDefaultDescription
core.baseUrlstring-Base URL used to resolve relative member paths when parsing an in-memory manifest.

Output​

Returns a Texture with:

  • shape: 'texture'
  • type: 'cube-array'
  • data: one cubemap per layer, with one mip chain per face