@needle-tools/gltf-build-pipeline 2.15.9-next.f565e02 → 2.15.9
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.
|
@@ -113,6 +113,7 @@ export class NeedlePmremContext {
|
|
|
113
113
|
const contentHash = createHash('md5').update(exrBytes).digest('hex');
|
|
114
114
|
const cacheKey = `pmrem-${contentHash}`;
|
|
115
115
|
// Get KTX2 bytes — deduplicated and optionally cached
|
|
116
|
+
const wasDeduplicated = this.processingPromises.has(cacheKey);
|
|
116
117
|
const ktx2Bytes = await this.getOrProcessExr(cacheKey, exrBytes, index, name, context.useCache);
|
|
117
118
|
// Remove EXT_texture_exr property since the texture is now KTX2
|
|
118
119
|
const exrProp = texture.getExtension('EXT_texture_exr');
|
|
@@ -143,14 +144,19 @@ export class NeedlePmremContext {
|
|
|
143
144
|
// Bundled: embed the KTX2 in the GLB
|
|
144
145
|
texture.setImage(new Uint8Array(ktx2Bytes));
|
|
145
146
|
}
|
|
146
|
-
// Report size
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
// Report size — skip info log for deduplicated textures to avoid confusion
|
|
148
|
+
if (wasDeduplicated) {
|
|
149
|
+
this.logger.debug(`NEEDLE_pmrem[${index}] ${name}: reused (identical content) → ${texture.getURI() || texture.getName() || name}`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const sizeStr = image.byteLength < 100 * 1024
|
|
153
|
+
? `${(image.byteLength / 1024).toFixed(0)} KB`
|
|
154
|
+
: `${(image.byteLength / (1024 * 1024)).toFixed(2)} MB`;
|
|
155
|
+
const dstSizestr = ktx2Bytes.length < 100 * 1024
|
|
156
|
+
? `${(ktx2Bytes.length / 1024).toFixed(0)} KB`
|
|
157
|
+
: `${(ktx2Bytes.length / (1024 * 1024)).toFixed(2)} MB`;
|
|
158
|
+
this.logger.info(`NEEDLE_pmrem[${index}] ${name}: ${sizeStr} EXR → ${dstSizestr} KTX2 (${texture.getURI() || texture.getName() || name})`);
|
|
159
|
+
}
|
|
154
160
|
this.convertedTextures.push(texture);
|
|
155
161
|
this.processed++;
|
|
156
162
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.15.9
|
|
1
|
+
export declare const version = "2.15.9";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.15.9
|
|
1
|
+
export const version = "2.15.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.15.9
|
|
3
|
+
"version": "2.15.9",
|
|
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",
|