@needle-tools/gltf-build-pipeline 1.4.1-beta.4 → 1.4.1-beta.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,10 +4,12 @@ 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
|
-
## [1.4.1-beta.
|
|
7
|
+
## [1.4.1-beta.5] - 2023-03-15
|
|
8
8
|
- add: auto LODs now calculate mesh density
|
|
9
|
-
- change: generate 6 LOD level
|
|
9
|
+
- change: generate 6 LOD level
|
|
10
|
+
- change: use ratio 0.5 of the previous LOD level
|
|
10
11
|
- change: bump gltf-transform to 3.10.1 to fix simplifier
|
|
12
|
+
- change: add sparse transform to progressive transform
|
|
11
13
|
|
|
12
14
|
## [1.4.1-beta.3] - 2023-03-14
|
|
13
15
|
- fix: wait for mesh simplifier to be ready
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BufferUtils, Document, NodeIO, PropertyType } from '@gltf-transform/core';
|
|
2
|
-
import { SIMPLIFY_DEFAULTS, WELD_DEFAULTS, listTextureSlots } from '@gltf-transform/functions';
|
|
2
|
+
import { SIMPLIFY_DEFAULTS, WELD_DEFAULTS, listTextureSlots, sparse } from '@gltf-transform/functions';
|
|
3
3
|
import { NEEDLE_PROGRESSIVE_EXTENSION_NAME, NEEDLE_progressive, generateGuid } from "../extensions/NEEDLE_progressive/index.js";
|
|
4
4
|
import { createOpaqueExtension, NEEDLE_compression_texture, NEEDLE_mesh_compression, NEEDLE_progressive_mesh_settings, NEEDLE_progressive_texture_settings, registerExtensions as registerDefaultExtensions } from '../extensions/index.js';
|
|
5
5
|
import path from 'path';
|
|
@@ -67,7 +67,7 @@ async function process(file, opts) {
|
|
|
67
67
|
}
|
|
68
68
|
//@ts-ignore
|
|
69
69
|
document.getLogger().verbosity = 0;
|
|
70
|
-
await document.transform(needle_asset(), make_progressive_textures(file, { size: [256, 256] }, opts), make_progressive_meshes(file, {}, opts));
|
|
70
|
+
await document.transform(needle_asset(), make_progressive_textures(file, { size: [256, 256] }, opts), make_progressive_meshes(file, {}, opts), sparse());
|
|
71
71
|
let filename = file;
|
|
72
72
|
if (opts.debug === true) {
|
|
73
73
|
// get extension
|
|
@@ -314,8 +314,8 @@ export function make_progressive_meshes(filePath, _options, opts) {
|
|
|
314
314
|
for (let l = 0; l < MAX_LODS; l++) {
|
|
315
315
|
const t = l / MAX_LODS;
|
|
316
316
|
const latest = LODS[LODS.length - 1];
|
|
317
|
-
const ratio = latest.ratio * .
|
|
318
|
-
const error = .
|
|
317
|
+
const ratio = latest.ratio * .5;
|
|
318
|
+
const error = .05 + t * .5;
|
|
319
319
|
LODS.push({
|
|
320
320
|
ratio: ratio,
|
|
321
321
|
error,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "1.4.1-beta.
|
|
3
|
+
"version": "1.4.1-beta.5",
|
|
4
4
|
"description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"type": "module",
|