mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: remove draco
This commit is contained in:
1 parent
970d93e7e0
commit
48dd9bec2a
3 files changed
+2
-29
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { toUniqueId } from '@blitzkit/core';
|
||||
import { NodeIO } from '@gltf-transform/core';
|
||||
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
|
||||
import draco3d from 'draco3dgltf';
|
||||
import { readdir } from 'fs/promises';
|
||||
import { extractModel } from '../core/blitz/extractModel';
|
||||
import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
|
||||
@@ -15,12 +14,7 @@ import { TankParameters } from './tankIcons';
|
||||
export async function tankModels() {
|
||||
console.log('Building tank models...');
|
||||
|
||||
const nodeIO = new NodeIO()
|
||||
.registerExtensions(ALL_EXTENSIONS)
|
||||
.registerDependencies({
|
||||
'draco3d.decoder': await draco3d.createDecoderModule(),
|
||||
'draco3d.encoder': await draco3d.createEncoderModule(),
|
||||
});
|
||||
const nodeIO = new NodeIO().registerExtensions(ALL_EXTENSIONS);
|
||||
const nations = await readdir(`${DATA}/XML/item_defs/vehicles`).then(
|
||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||
);
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
VertexAttribute,
|
||||
} from '@blitzkit/core';
|
||||
import { Document, Material, Node, Scene } from '@gltf-transform/core';
|
||||
import { KHRDracoMeshCompression } from '@gltf-transform/extensions';
|
||||
import { dedup, prune } from '@gltf-transform/functions';
|
||||
import { times } from 'lodash-es';
|
||||
import { dirname } from 'path';
|
||||
@@ -294,15 +293,5 @@ export async function extractModel(data: string, path: string) {
|
||||
|
||||
await document.transform(prune({ keepAttributes: true }), dedup());
|
||||
|
||||
document
|
||||
.createExtension(KHRDracoMeshCompression)
|
||||
.setRequired(true)
|
||||
.setEncoderOptions({
|
||||
method: KHRDracoMeshCompression.EncoderMethod.EDGEBREAKER,
|
||||
encodeSpeed: 0,
|
||||
decodeSpeed: 0,
|
||||
quantizationVolume: 'scene',
|
||||
});
|
||||
|
||||
return document;
|
||||
}
|
||||
Reference in new issue
Block a user