Worker
Loader for compressed textures in the Crunch file format
| Loader | Characteristic |
|---|---|
| File Format | CRN |
| File Extension | .crn |
| File Type | Binary |
| Data Format | TextureLevel[] |
| Supported APIs | load, parse |
Usage​
import {CrunchWorkerLoader} from '@loaders.gl/textures';
import {load} from '@loaders.gl/core';
const mipLevels = await load(url, CrunchWorkerLoader);
for (const level of mipLevels) {
console.log(level.shape, level.format, level.textureFormat);
}
Data Format​
Returns TextureLevel[], one entry per mip level.
Each level includes:
shape: 'texture-level'compressedformattextureFormatwidthheightdatalevelSizewhen available
Options​
| Option | Type | Default | Description |
|---|---|---|---|
| N/A |
Module Overrides​
Use options.modules to override the Crunch runtime used by CrunchWorkerLoader.
modules.crunch: supply a preloaded Crunch decoder factory.'crunch.js': override the URL used for the Crunch decoder script.