The manifest path
Read the manifest. Resolve the members. Return one texture.
A composite texture can be a single image, an explicit list of mip levels, or a template-driven sequence. The loader turns each supported description into the same schema-level texture shape.
Input
JSON image-texture manifest
Resolve
Relative member URLs and optional base URL
Decode
Member images through ImageLoader
Output
Texture with ordered TextureLevel entries
A loader for image-based composite textures described by a JSON manifest.
Detailed guide
Manifest and texture output details
The reference below covers manifest forms, URL resolution, member decoding, mip levels, options, and normalized output fields.
| TextureLoader | |
|---|---|
| File Format | JSON manifest |
| File Extension | .json |
| File Type | Text |
| Data Format | Texture |
| Supported APIs | load, parse |
Usage
import {load} from '@loaders.gl/core';
import {TextureLoader} from '@loaders.gl/images/texture';
const image = await load('texture.image-texture.json', TextureLoader);
Member images are parsed with ImageLoader by default:
import {load} from '@loaders.gl/core';
import {TextureLoader} from '@loaders.gl/images/texture';
const texture = await load('texture.image-texture.json', TextureLoader);
Member images use the same runtime-dependent bitmap contract as ImageLoader: native ImageBitmap in browsers and the installed Node.js ImageBitmap polyfill when @loaders.gl/core/polyfills is present.
Manifest
Single image:
{
"shape": "image-texture",
"image": "texture.png"
}
Mipmapped image:
{
"shape": "image-texture",
"mipmaps": ["texture-0.png", "texture-1.png", "texture-2.png"]
}
Template-driven mipmapped image:
{
"shape": "image-texture",
"mipLevels": "auto",
"template": "texture-{lod}.png"
}
Template placeholders are validated strictly. Supported placeholders for TextureLoader are {lod} only.
Use \\{ and \\} to include literal braces in filenames.
Options
| Option | Type | Default | Description |
|---|---|---|---|
core.baseUrl | string | - | Base URL used to resolve relative member paths when parsing an in-memory manifest. |
Output
Returns a Texture with:
shape: 'texture'type: '2d'data: oneTextureLevelper mip level
For image-backed levels, TextureLevel.imageBitmap is populated when available and TextureLevel.data is an empty Uint8Array.