@needle-tools/gltf-build-pipeline 2.15.8-next.3674f4f → 2.15.8
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.
|
@@ -146,7 +146,7 @@ export class NeedlePmremContext {
|
|
|
146
146
|
const dstSizestr = ktx2Bytes.length < 100 * 1024
|
|
147
147
|
? `${(ktx2Bytes.length / 1024).toFixed(0)} KB`
|
|
148
148
|
: `${(ktx2Bytes.length / (1024 * 1024)).toFixed(2)} MB`;
|
|
149
|
-
this.logger.info(`pmrem:texture[${index}] ${name}: ${sizeStr} EXR → ${dstSizestr} KTX2
|
|
149
|
+
this.logger.info(`pmrem:texture[${index}] ${name}: ${sizeStr} EXR → ${dstSizestr} KTX2`);
|
|
150
150
|
this.convertedTextures.push(texture);
|
|
151
151
|
this.processed++;
|
|
152
152
|
return true;
|
|
@@ -172,24 +172,16 @@ export class NeedlePmremContext {
|
|
|
172
172
|
return cached;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
// 1. Run PMREM on the EXR bytes
|
|
176
|
-
|
|
177
|
-
? `${(exrBytes.byteLength / 1024).toFixed(0)} KB`
|
|
178
|
-
: `${(exrBytes.byteLength / (1024 * 1024)).toFixed(2)} MB`;
|
|
179
|
-
this.logger.info(`pmrem:texture[${index}] ${name}: Running PMREM WASM (${inputSize} EXR) — this may take a while...`);
|
|
180
|
-
// Yield to allow log to flush before blocking WASM call
|
|
181
|
-
await new Promise(r => setTimeout(r, 0));
|
|
182
|
-
const t0 = Date.now();
|
|
175
|
+
// 1. Run PMREM on the EXR bytes
|
|
176
|
+
this.logger.info(`pmrem:texture[${index}] ${name}: Running PMREM...`);
|
|
183
177
|
const pmremExrBytes = this.wasmModule.pmrem_exr(exrBytes);
|
|
184
|
-
const elapsed = ((Date.now() - t0) / 1000).toFixed(1);
|
|
185
|
-
this.logger.info(`pmrem:texture[${index}] ${name}: PMREM done in ${elapsed}s (${(pmremExrBytes.byteLength / 1024 / 1024).toFixed(1)} MB)`);
|
|
186
178
|
// 2. Write PMREM EXR to temp file
|
|
187
179
|
const id = uuid();
|
|
188
180
|
const tempExr = join(this.tmpDir, `${id}.pmrem.exr`);
|
|
189
181
|
const tempKtx2 = join(this.tmpDir, `${id}.ktx2`);
|
|
190
182
|
writeFileSync(tempExr, Buffer.from(pmremExrBytes));
|
|
191
183
|
// 3. Encode to KTX2 HDR via basisu
|
|
192
|
-
this.logger.
|
|
184
|
+
this.logger.debug(`pmrem:texture[${index}] ${name}: Encoding KTX2 HDR...`);
|
|
193
185
|
const variant = 'hdr4x4'; // 6x6 needs an update in Needle
|
|
194
186
|
await encodeKTX2WithBasisu(this.basisuExe, tempExr, tempKtx2, variant, true);
|
|
195
187
|
if (!existsSync(tempKtx2)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.15.8
|
|
1
|
+
export declare const version = "2.15.8";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.15.8
|
|
1
|
+
export const version = "2.15.8";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.15.8
|
|
3
|
+
"version": "2.15.8",
|
|
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",
|