@needle-tools/gltf-build-pipeline 2.16.0-next.fc19d36 → 3.0.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +41 -2
- package/dist/cli/index.js +4154 -232
- package/package.json +9 -14
- package/tools/pmrem/pkg/pmrem_wasm.d.ts +25 -0
- package/tools/pmrem/pkg/pmrem_wasm.js +110 -0
- package/tools/pmrem/pkg/pmrem_wasm_bg.wasm +0 -0
- package/dist/cache/cache.d.ts +0 -58
- package/dist/cache/cache.js +0 -330
- package/dist/cache/index.d.ts +0 -2
- package/dist/cache/index.js +0 -2
- package/dist/cache/job-cache.d.ts +0 -26
- package/dist/cache/job-cache.js +0 -84
- package/dist/cli/index.d.ts +0 -2
- package/dist/config/index.d.ts +0 -53
- package/dist/config/index.js +0 -156
- package/dist/constants.d.ts +0 -7
- package/dist/constants.js +0 -7
- package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.d.ts +0 -24
- package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.js +0 -54
- package/dist/extensions/NEEDLE_compression_texture/index.d.ts +0 -1
- package/dist/extensions/NEEDLE_compression_texture/index.js +0 -1
- package/dist/extensions/NEEDLE_lightmaps/index.d.ts +0 -39
- package/dist/extensions/NEEDLE_lightmaps/index.js +0 -257
- package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.d.ts +0 -27
- package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.js +0 -88
- package/dist/extensions/NEEDLE_mesh_compression/index.d.ts +0 -1
- package/dist/extensions/NEEDLE_mesh_compression/index.js +0 -1
- package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.d.ts +0 -27
- package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.js +0 -1048
- package/dist/extensions/NEEDLE_opaque/index.d.ts +0 -3
- package/dist/extensions/NEEDLE_opaque/index.js +0 -30
- package/dist/extensions/NEEDLE_pmrem/index.d.ts +0 -21
- package/dist/extensions/NEEDLE_pmrem/index.js +0 -95
- package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.d.ts +0 -48
- package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.js +0 -69
- package/dist/extensions/NEEDLE_progressive/index.d.ts +0 -1
- package/dist/extensions/NEEDLE_progressive/index.js +0 -1
- package/dist/extensions/NEEDLE_progressive_mesh_settings/index.d.ts +0 -23
- package/dist/extensions/NEEDLE_progressive_mesh_settings/index.js +0 -41
- package/dist/extensions/NEEDLE_progressive_texture_settings/index.d.ts +0 -25
- package/dist/extensions/NEEDLE_progressive_texture_settings/index.js +0 -38
- package/dist/extensions/index.d.ts +0 -15
- package/dist/extensions/index.js +0 -34
- package/dist/extensions/utils.d.ts +0 -9
- package/dist/extensions/utils.js +0 -79
- package/dist/functions/weld.3.d.ts +0 -76
- package/dist/functions/weld.3.js +0 -414
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/scripts/index.d.ts +0 -2
- package/dist/scripts/index.js +0 -2
- package/dist/scripts/pack-gltf.d.ts +0 -17
- package/dist/scripts/pack-gltf.js +0 -152
- package/dist/scripts/stats.d.ts +0 -5
- package/dist/scripts/stats.js +0 -20
- package/dist/transforms/index.d.ts +0 -9
- package/dist/transforms/index.js +0 -9
- package/dist/transforms/needle_animation_transform.d.ts +0 -2
- package/dist/transforms/needle_animation_transform.js +0 -5
- package/dist/transforms/needle_asset.d.ts +0 -3
- package/dist/transforms/needle_asset.js +0 -50
- package/dist/transforms/needle_common.d.ts +0 -17
- package/dist/transforms/needle_common.js +0 -1
- package/dist/transforms/needle_mesh_transform.d.ts +0 -15
- package/dist/transforms/needle_mesh_transform.js +0 -223
- package/dist/transforms/needle_pmrem.d.ts +0 -21
- package/dist/transforms/needle_pmrem.js +0 -238
- package/dist/transforms/needle_progressive.d.ts +0 -45
- package/dist/transforms/needle_progressive.js +0 -1101
- package/dist/transforms/needle_texture_transform.d.ts +0 -15
- package/dist/transforms/needle_texture_transform.js +0 -267
- package/dist/transforms/needle_toktx.d.ts +0 -26
- package/dist/transforms/needle_toktx.js +0 -250
- package/dist/transforms/needle_webp.d.ts +0 -15
- package/dist/transforms/needle_webp.js +0 -53
- package/dist/transforms/toktx.d.ts +0 -52
- package/dist/transforms/toktx.js +0 -221
- package/dist/transforms/toktx_types.d.ts +0 -78
- package/dist/transforms/toktx_types.js +0 -62
- package/dist/transforms/util.d.ts +0 -21
- package/dist/transforms/util.js +0 -90
- package/dist/utils/analytics.d.ts +0 -24
- package/dist/utils/analytics.js +0 -128
- package/dist/utils/compression_utils.d.ts +0 -2
- package/dist/utils/compression_utils.js +0 -6
- package/dist/utils/fileutils.d.ts +0 -22
- package/dist/utils/fileutils.js +0 -195
- package/dist/utils/guid.d.ts +0 -1
- package/dist/utils/guid.js +0 -5
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -10
- package/dist/utils/merge.d.ts +0 -12
- package/dist/utils/merge.js +0 -31
- package/dist/utils/mesh.d.ts +0 -13
- package/dist/utils/mesh.js +0 -124
- package/dist/utils/nodeio.d.ts +0 -11
- package/dist/utils/nodeio.js +0 -116
- package/dist/utils/stats.d.ts +0 -70
- package/dist/utils/stats.js +0 -265
- package/dist/utils/test-assert.d.ts +0 -8
- package/dist/utils/test-assert.js +0 -18
- package/dist/utils/texture.d.ts +0 -5
- package/dist/utils/texture.js +0 -14
- package/dist/utils/validate.d.ts +0 -6
- package/dist/utils/validate.js +0 -17
- package/dist/utils/version.d.ts +0 -1
- package/dist/utils/version.gen.d.ts +0 -1
- package/dist/utils/version.gen.js +0 -1
- package/dist/utils/version.js +0 -4
- package/scripts/clear-caches.mjs +0 -4
- package/scripts/defaults.mjs +0 -12
- package/scripts/fileutils.mjs +0 -6
- package/scripts/index.mjs +0 -41
- package/scripts/limit-caches.mjs +0 -4
- package/scripts/make-progressive.mjs +0 -16
- package/scripts/pack-gltf.mjs +0 -107
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [3.0.0-alpha] - 2026-05-26
|
|
8
|
+
|
|
9
|
+
### Breaking
|
|
10
|
+
- CLI now requires JWT authentication via `--auth-token`
|
|
11
|
+
- The package ships as a CLI-only right now
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Job cache**: file-level cache that skips an entire transform when the same input + config was already processed
|
|
15
|
+
- **Audio compression**: external audio references are re-encoded to Opus/OGG; supported input formats are WAV, FLAC, and AIFF (lossy formats pass through unchanged)
|
|
16
|
+
- **PMREM standalone CLI command**: `needle-gltf pmrem <input>` converts EXR and Radiance HDR files to PMREM KTX2
|
|
17
|
+
- **Multiple file inputs**: `transform` now accepts comma-separated paths (e.g. `needle-gltf transform a.glb,b.glb out/`)
|
|
18
|
+
- Auth surfaces clean "token expired" message when the JWT `exp` claim is past
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- Cache restore now also restores external files (KTX2, PMREM) alongside the main GLB
|
|
22
|
+
- PMREM NaN generation that caused artifacts in certain EXR files
|
|
23
|
+
- xxHash WASM init race condition, now resolved with `ensureHashReady` gate
|
|
24
|
+
- LOD file detection no longer matches against directory names
|
|
25
|
+
- toktx: probes `ktx` binary to match what the compression step actually runs
|
|
26
|
+
- `getConfig` now returns a fresh copy instead of a shared mutable reference
|
|
27
|
+
- `stats` tolerates undefined errors/warnings in `addFrom`
|
|
28
|
+
- Material-only GLBs are no longer incorrectly pruned
|
|
29
|
+
- `createOpaqueExtension` return type fixed, downstream casts removed
|
|
30
|
+
- `stats` command exits with code 0
|
|
31
|
+
|
|
7
32
|
## [2.15.0] - 2026-03-20
|
|
8
33
|
- add: EXR environment map compression (PMREM / FASTHDR) for Needle Engine, supporting both Unity and Blender exports
|
|
9
34
|
- fix: cache hashing stability (circular reference handling)
|
package/README.md
CHANGED
|
@@ -14,10 +14,10 @@ Includes support for generating LOD quality level for textures and meshes. Use w
|
|
|
14
14
|
In general all files that have been processed by this package are valid glTF/GLB files.
|
|
15
15
|
The glTF Build Pipeline package is meant to be used as a last step before delivery.
|
|
16
16
|
That means:
|
|
17
|
-
- files are meant to be loaded
|
|
17
|
+
- files are meant to be loaded by [Needle Engine](https://needle.tools) (and other three.js based runtimes)
|
|
18
18
|
- files are not to be opened in Blender again to be further edited
|
|
19
19
|
|
|
20
|
-
To load progressively enhanced glTF files in
|
|
20
|
+
To load progressively enhanced glTF files in Needle Engine or another three.js based runtime, see examples at [@needle-tools/gltf-progressive](https://www.npmjs.com/package/@needle-tools/gltf-progressive)
|
|
21
21
|
|
|
22
22
|
### Installation
|
|
23
23
|
|
|
@@ -26,6 +26,45 @@ To load progressively enhanced glTF files in any three.js based engine see examp
|
|
|
26
26
|
### Commands
|
|
27
27
|
- `help` - use help to view options
|
|
28
28
|
|
|
29
|
+
### Platform support
|
|
30
|
+
|
|
31
|
+
The bundled `basisu` encoder (used for HDR / EXR → KTX2 HDR) supports:
|
|
32
|
+
|
|
33
|
+
| OS | Arch | Status |
|
|
34
|
+
|---------|-----------------------|--------|
|
|
35
|
+
| Linux | x64 | Supported |
|
|
36
|
+
| Linux | arm64 | Not supported |
|
|
37
|
+
| macOS | arm64 (Apple Silicon) | Supported |
|
|
38
|
+
| macOS | x64 (Intel) | Not supported |
|
|
39
|
+
| Windows | x64 | Supported |
|
|
40
|
+
|
|
41
|
+
### Configuration
|
|
42
|
+
|
|
43
|
+
The pipeline reads an optional `needle.config.json` from the working directory (or any parent directory). Configure pipeline behaviour under the `gltf` key:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"gltf": {
|
|
48
|
+
"usecase": "product",
|
|
49
|
+
"textures": { "lods": true },
|
|
50
|
+
"meshes": { "lods": true },
|
|
51
|
+
"audio": { "enabled": true, "bitrate": 64 },
|
|
52
|
+
"exr": { "enabled": true }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The `gltf` value may also be a string shorthand for `usecase` — `"gltf": "product"` is equivalent to `"gltf": { "usecase": "product" }`.
|
|
58
|
+
|
|
59
|
+
| Key | Type | Default | Description |
|
|
60
|
+
|-----|------|---------|-------------|
|
|
61
|
+
| `usecase` | `"default" \| "product" \| "world"` | `"default"` | High-level optimisation profile. |
|
|
62
|
+
| `textures.lods` | `boolean` | `true` | Generate progressive texture LODs. |
|
|
63
|
+
| `meshes.lods` | `boolean` | `true` | Generate progressive mesh LODs. |
|
|
64
|
+
| `audio.enabled` | `boolean` | `true` | Compress externally referenced lossless audio files (`.wav`, `.flac`, `.aiff`/`.aif`) to Opus in an `.ogg` container, rewriting the URIs in the glTF. Lossy formats (`.mp3`, `.ogg`, `.m4a`, `.aac`) pass through unchanged to avoid compounding compression artifacts. Requires `ffmpeg` with `libopus` on `PATH`; when missing the build logs a warning and leaves the audio files untouched. |
|
|
65
|
+
| `audio.bitrate` | `number` (kbps) | `128` | Opus encoding bitrate. 96 is near-transparent for most music; 128 matches YouTube's music tier and is the safe "won't sound bad" default. Drop to 48–64 for known mono/UI-only assets. |
|
|
66
|
+
| `exr.enabled` | `boolean` | `true` | Convert EXR textures to KTX2 HDR via PMREM. When `false`, EXR textures (bundled and externally referenced) are left as-is so a downstream step can handle them. |
|
|
67
|
+
|
|
29
68
|
# Contact
|
|
30
69
|
|
|
31
70
|
For licensing questions please contact us.
|