You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`compressed`|`boolean`| Whether the mip level data is GPU-compressed. |
41
+
|`shape`|`'texture-level'`| Shape tag for normalized texture-level payloads. <imgsrc="https://img.shields.io/badge/From-v4.4-blue.svg?style=flat-square"alt="From-v4.4" /> |
42
+
|`format`|`number`| WebGL internal format enum for the decoded level. <imgsrc="https://img.shields.io/badge/From-v4.4-blue.svg?style=flat-square"alt="From-v4.4" /> |
43
+
|`textureFormat`|`TextureFormat`| WebGPU / luma.gl style format string for the data. <imgsrc="https://img.shields.io/badge/From-v4.4-blue.svg?style=flat-square"alt="From-v4.4" /> |
44
+
|`data`|`Uint8Array`| The bytes for this mip level. |
45
+
|`width`|`number`| Width of this mip level. |
46
+
|`height`|`number`| Height of this mip level. |
47
+
|`levelSize`|`number`| Size in bytes for this mip level, when available. |
48
+
|`hasAlpha`|`boolean`| Whether the transcoded texture contains alpha. |
49
+
50
+
`BasisLoader` returns `TextureLevel[][]`, preserving all images in a `.basis` or `.ktx2` asset.
See [`BasisLoader`](/docs/modules/textures/api-reference/basis-loader) and [`CompressedTextureLoader`](/docs/modules/textures/api-reference/compressed-texture-loader) for loader-specific options and return shapes.
|`basis.format`| String |`'auto'`| Set to one of the supported compressed texture formats. |
34
-
|`basis.containerFormat`| String |`'auto'`| BasisLoader can decode KTX2 container. `ktx2` - decode data as KTX2 container with basis texture in it, `basis` - decode data as unwrapped basis texture, `auto` - detect KTX2 format by magic string |
35
-
|`basis.module`| String |`'transcoder'`| Possible values: `transcoder` or `encoder`. Selects wasm module to decode the texture. `transcoder` is smaller but supports only `BasisFile`. `encoder` supports `BasisFile` and `KTX2File`. |
|`basis.format`|`'auto' \| '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' \| {alpha, noAlpha}`|`'auto'`| Select the transcode target format, or provide separate alpha and non-alpha targets using the same set of format names. |
36
+
|`basis.supportedTextureFormats`|`TextureFormat[]`| auto-detect | A list of compressed texture formats that the basis transcoder can select from when transcoding. |
37
+
|`basis.containerFormat`|`'auto' \| 'ktx2' \| 'basis'`|`'auto'`| Select whether the input should be interpreted as a KTX2 container, a raw Basis file, or auto-detected from the data. |
38
+
|`basis.module`|`'transcoder' \| 'encoder'`|`'transcoder'`| Select the wasm module used for decoding. `transcoder` supports `.basis`, while `encoder` supports both `.basis` and `.ktx2`. |
39
+
40
+
## Output
41
+
42
+
Each decoded mip level is returned as a `TextureLevel` with:
-`format`: the WebGL internal format enum <imgsrc="https://img.shields.io/badge/From-v4.4-blue.svg?style=flat-square"alt="From-v4.4" />
46
+
-`textureFormat`: the WebGPU texture format string corresponding to the format of the data in this texture level <imgsrc="https://img.shields.io/badge/From-v4.4-blue.svg?style=flat-square"alt="From-v4.4" />
47
+
48
+
When `basis.format` is `'auto'`, pass `basis.supportedTextureFormats` to select from a known set of target formats. If omitted, `BasisLoader` falls back to internal runtime capability detection.
@@ -40,4 +49,4 @@ Returns an array of image data objects representing mip levels.
40
49
41
50
## Basis loader
42
51
43
-
From v3.1 [BasisLoader](/docs/modules/textures/api-reference/basis-loader)supports decoding KTX2 format. Applying BasisLoader for KTX2 files can possibly give results when internal ktx parser can't parse an image for some reason.
52
+
Use [BasisLoader](/docs/modules/textures/api-reference/basis-loader) for KTX2 assets that need Basis transcoding.
Copy file name to clipboardExpand all lines: docs/upgrade-guide.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
## Upgrading to v4.4
4
4
5
+
**@loaders.gl/textures**
6
+
7
+
-`TextureLevel` now exposes `shape`, `format`, and `textureFormat`. Use `format` for WebGL APIs and `textureFormat` for WebGPU-style or luma.gl APIs.
8
+
-`BasisLoader` uses `basis.supportedTextureFormats` to control `'auto'` basis format selection, and can accept explicit `basis.format` targets.
9
+
-`@loaders.gl/textures` no longer exports `selectSupportedBasisFormat` or `getSupportedGPUTextureFormats`. Pass `basis.supportedTextureFormats` to `BasisLoader` instead of using exported auto-detection helpers.
10
+
5
11
**@loaders.gl/compression**
6
12
7
13
-`LZOCompression` was removed due to maintenance and licensing concerns with the underlying `lzo-wasm` library.
0 commit comments