@needle-tools/gltf-build-pipeline 2.2.0-alpha.4 → 2.2.0-alpha.5
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
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
-
## [2.2.0-alpha.
|
|
7
|
+
## [2.2.0-alpha.5] - 2023-06-06
|
|
8
8
|
- add: CLI `--progressive` option to `transform` command (default is true)
|
|
9
9
|
- add: CLI `--compress` option to `transform` command (default is true)
|
|
10
10
|
- add: config `meshes: { lods: boolean }` option
|
|
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
12
12
|
- change: enable texture LODs by default
|
|
13
13
|
- fix: `--config` path can now point to a directory or a `needle.config.json` file as well
|
|
14
14
|
- fix: mesh LOD regression caused by change in gltf-transform `weld` behaviour
|
|
15
|
+
- fix: KTX SOFTWARE >= 4.3.0 is installed
|
|
15
16
|
|
|
16
17
|
## [2.1.0-alpha.6] - 2023-06-04
|
|
17
18
|
- fix: errors when invoking npm scripts caused by the cli program
|
|
@@ -39,8 +39,12 @@ export const needle_texture_transform = function (options) {
|
|
|
39
39
|
};
|
|
40
40
|
return createTransform("needle_texture_transform", async (document) => {
|
|
41
41
|
await webPContext.prepare(document);
|
|
42
|
-
if (context.noToktx !== true)
|
|
43
|
-
await toktxContext.prepare(document);
|
|
42
|
+
if (context.noToktx !== true) {
|
|
43
|
+
const validToktx = await toktxContext.prepare(document);
|
|
44
|
+
if (!validToktx) {
|
|
45
|
+
context.noToktx = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
44
48
|
try {
|
|
45
49
|
const logger = document.getLogger();
|
|
46
50
|
const textures = document.getRoot().listTextures();
|
|
@@ -168,7 +172,7 @@ async function processTexture(texture, index, document, logger, context) {
|
|
|
168
172
|
successFullyProcessed = await context.toktxContext.process(index, texture, options, context);
|
|
169
173
|
}
|
|
170
174
|
else {
|
|
171
|
-
console.log("Toktx not found: Skipping texture compression
|
|
175
|
+
console.log("Toktx not found: Skipping texture compression: " + originalMimeType);
|
|
172
176
|
}
|
|
173
177
|
}
|
|
174
178
|
if (context.useCache && successFullyProcessed && key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BufferUtils, FileUtils, ImageUtils, uuid } from "@gltf-transform/core";
|
|
2
2
|
import { listTextureSlots, getTextureChannelMask, fitPowerOfTwo, TextureResizeFilter } from "@gltf-transform/functions";
|
|
3
3
|
import { KHRTextureBasisu } from "@gltf-transform/extensions";
|
|
4
|
-
import { checkKTXSoftware, createParams, Mode } from "./toktx.js";
|
|
4
|
+
import { checkKTXSoftware, createParams, KTX_SOFTWARE_VERSION_MIN, Mode } from "./toktx.js";
|
|
5
5
|
import { existsSync, mkdirSync } from "fs";
|
|
6
6
|
import { formatBytes, spawn, waitExit } from './util.js';
|
|
7
7
|
import { ETC1S_DEFAULTS, UASTC_DEFAULTS } from "./toktx_types.js";
|
|
@@ -70,7 +70,7 @@ export class NeedleToktxContext {
|
|
|
70
70
|
const logger = document.getLogger();
|
|
71
71
|
this.version = await checkKTXSoftware(logger, this.env);
|
|
72
72
|
if (this.version === null) {
|
|
73
|
-
|
|
73
|
+
logger.warn(`WARN: toktx not found, skipping texture compression. Please install KTX-Software >= ${KTX_SOFTWARE_VERSION_MIN}`);
|
|
74
74
|
this._prepareFailed = true;
|
|
75
75
|
return false;
|
|
76
76
|
}
|
package/dist/transforms/toktx.js
CHANGED
|
@@ -10,8 +10,7 @@ import { TextureResizeFilter, getTextureColorSpace } from '@gltf-transform/funct
|
|
|
10
10
|
import { ETC1S_DEFAULTS, UASTC_DEFAULTS } from './toktx_types.js';
|
|
11
11
|
tmp.setGracefulCleanup();
|
|
12
12
|
const NUM_CPUS = os.cpus().length || 1; // microsoft/vscode#112122
|
|
13
|
-
const KTX_SOFTWARE_VERSION_MIN = '4.
|
|
14
|
-
const KTX_SOFTWARE_VERSION_ACTIVE = '4.1.0-rc1';
|
|
13
|
+
export const KTX_SOFTWARE_VERSION_MIN = '4.3.0';
|
|
15
14
|
export const Filter = {
|
|
16
15
|
BOX: 'box',
|
|
17
16
|
TENT: 'tent',
|
|
@@ -167,6 +166,7 @@ export async function checkKTXSoftware(logger, env) {
|
|
|
167
166
|
}
|
|
168
167
|
else if (semver.lt(semver.clean(version), KTX_SOFTWARE_VERSION_MIN)) {
|
|
169
168
|
logger.warn(`toktx: Expected KTX-Software >= v${KTX_SOFTWARE_VERSION_MIN}, found ${version}.`);
|
|
169
|
+
return null;
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
172
|
if (!didLogToktxVersion)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.2.0-alpha.
|
|
3
|
+
"version": "2.2.0-alpha.5",
|
|
4
4
|
"description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|