@threenative/assets 0.3.12 → 0.3.14
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/dist/apply-worker.js +20982 -20827
- package/dist/index.d.ts +78 -1
- package/dist/index.js +26934 -25963
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Document, Material } from '@gltf-transform/core';
|
|
2
|
+
import { ITerrainState, bakeWorldPackage } from '@threenative/terrain';
|
|
2
3
|
|
|
3
4
|
interface IImageQualityFloor {
|
|
4
5
|
readonly ssim: number;
|
|
@@ -41,6 +42,13 @@ type TextureMaxSize = number | Readonly<Record<string, number>>;
|
|
|
41
42
|
interface IModelTexturesOptions {
|
|
42
43
|
/** Internal target-selected raw ASTC output. */
|
|
43
44
|
readonly astc?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Internal: every runtime of this target decodes WebP (the web: browsers and the owned Wasm
|
|
47
|
+
* engine), so an authored WebP is a source the cook may keep, and a KTX2 must undercut its bytes
|
|
48
|
+
* to replace it, as it must a JPEG or PNG. PRD-867: without it, Midway's 300 KB WebP
|
|
49
|
+
* metallic-roughness and normal maps became 4 MB UASTC files.
|
|
50
|
+
*/
|
|
51
|
+
readonly webp?: boolean;
|
|
44
52
|
readonly floor?: Partial<IImageQualityFloor>;
|
|
45
53
|
/** Internal reporting switch; selection still measures and enforces the floor. */
|
|
46
54
|
readonly measureQuality?: boolean;
|
|
@@ -324,6 +332,8 @@ interface IModelLodOptions {
|
|
|
324
332
|
readonly preset?: LodPreset;
|
|
325
333
|
readonly runtime?: IModelLodRuntimeOptions;
|
|
326
334
|
}
|
|
335
|
+
/** Thin MASK card sets into a standalone mesh; opaque parts and every vertex attribute survive. */
|
|
336
|
+
declare function thinFoliageCards(document: Document, keepRatio: number): number;
|
|
327
337
|
|
|
328
338
|
/**
|
|
329
339
|
* The five bands a clip's content is judged in, contiguous and gapless up to Nyquist.
|
|
@@ -1190,12 +1200,14 @@ interface IBakeReceipt {
|
|
|
1190
1200
|
readonly outputs: readonly IBakeReceiptOutput[];
|
|
1191
1201
|
readonly pipelineVersion: number;
|
|
1192
1202
|
}
|
|
1203
|
+
|
|
1193
1204
|
/**
|
|
1194
1205
|
* Resolves three's Basis transcoder through the project's own `three` install so a path that
|
|
1195
1206
|
* moved between three versions fails the build here, as a named error, instead of 404ing at
|
|
1196
1207
|
* runtime inside the KTX2 loader.
|
|
1197
1208
|
*/
|
|
1198
1209
|
declare function resolveBasisTranscoder(cwd: string): IBasisTranscoder;
|
|
1210
|
+
|
|
1199
1211
|
declare function compileAssets(options?: IAssetCompileOptions): Promise<IAssetCompileResult>;
|
|
1200
1212
|
|
|
1201
1213
|
/**
|
|
@@ -1529,4 +1541,69 @@ declare function censusDocument(model: string, document: Document, pageSize?: nu
|
|
|
1529
1541
|
/** Totals across a set of models, so a scene's census is one line rather than twenty-nine. */
|
|
1530
1542
|
declare function totalCensus(entries: readonly IContentCensus[]): Omit<IContentCensus, "model">;
|
|
1531
1543
|
|
|
1532
|
-
|
|
1544
|
+
/** The world.json contract, taken from the shared baker rather than restated here. */
|
|
1545
|
+
type IWorldPackageManifest = ReturnType<typeof bakeWorldPackage>["manifest"];
|
|
1546
|
+
/** One streamed species entry, taken from the shared baker's own option type. */
|
|
1547
|
+
type IWorldPackageAsset = NonNullable<IWorldPackageManifest["assets"][string]>;
|
|
1548
|
+
interface ISpeciesLODSpec {
|
|
1549
|
+
readonly glb?: string | Uint8Array;
|
|
1550
|
+
readonly distance: number;
|
|
1551
|
+
}
|
|
1552
|
+
interface ISpeciesSpec {
|
|
1553
|
+
readonly glb: string | Uint8Array;
|
|
1554
|
+
readonly bounds?: {
|
|
1555
|
+
readonly min: readonly [number, number, number];
|
|
1556
|
+
readonly max: readonly [number, number, number];
|
|
1557
|
+
};
|
|
1558
|
+
readonly lods?: readonly ISpeciesLODSpec[];
|
|
1559
|
+
readonly maxDistance?: number;
|
|
1560
|
+
}
|
|
1561
|
+
interface ICookTerrainWorldMaterialLayer {
|
|
1562
|
+
readonly id: string;
|
|
1563
|
+
readonly diff?: string | Uint8Array;
|
|
1564
|
+
readonly nrm?: string | Uint8Array;
|
|
1565
|
+
readonly orm?: string | Uint8Array;
|
|
1566
|
+
readonly h?: string | Uint8Array;
|
|
1567
|
+
readonly diffBytes?: Uint8Array;
|
|
1568
|
+
readonly nrmBytes?: Uint8Array;
|
|
1569
|
+
readonly ormBytes?: Uint8Array;
|
|
1570
|
+
readonly hBytes?: Uint8Array;
|
|
1571
|
+
readonly diffMimeType?: string;
|
|
1572
|
+
readonly nrmMimeType?: string;
|
|
1573
|
+
}
|
|
1574
|
+
interface ICookTerrainWorldOptions {
|
|
1575
|
+
readonly state: ITerrainState;
|
|
1576
|
+
readonly species: Readonly<Record<string, ISpeciesSpec>>;
|
|
1577
|
+
readonly out: string;
|
|
1578
|
+
readonly materials?: {
|
|
1579
|
+
readonly layers?: readonly ICookTerrainWorldMaterialLayer[];
|
|
1580
|
+
readonly texturesDir?: string;
|
|
1581
|
+
};
|
|
1582
|
+
readonly cellSize?: number;
|
|
1583
|
+
readonly extraLayers?: Readonly<Record<string, string>>;
|
|
1584
|
+
}
|
|
1585
|
+
interface ICookTerrainWorldResult {
|
|
1586
|
+
readonly worldGlb: Uint8Array;
|
|
1587
|
+
readonly manifest: IWorldPackageManifest;
|
|
1588
|
+
/** Reuse the validated binary package instead of baking it again for companion files. */
|
|
1589
|
+
readonly worldPackage?: ReturnType<typeof bakeWorldPackage>;
|
|
1590
|
+
readonly placementCounts: Readonly<Record<string, number>>;
|
|
1591
|
+
/** Every node in the document, across the default and every alternate-LOD scene. */
|
|
1592
|
+
readonly nodeCount: number;
|
|
1593
|
+
/**
|
|
1594
|
+
* Instancing nodes in the default `TerrainWorld` scene only, so an existing consumer keeps
|
|
1595
|
+
* reading one node per species. Alternate LODs live in their own named scenes and are not
|
|
1596
|
+
* counted here; walk `getRoot().listScenes()` for the authoritative all-scene census.
|
|
1597
|
+
*/
|
|
1598
|
+
readonly instancedMeshCount: number;
|
|
1599
|
+
}
|
|
1600
|
+
/** A portable editor scene with embedded data URIs, already frozen by the game. */
|
|
1601
|
+
interface IPreparedTerrainWorldOptions {
|
|
1602
|
+
readonly preparedWorld: Record<string, unknown>;
|
|
1603
|
+
}
|
|
1604
|
+
declare function cookTerrainWorld(options: IPreparedTerrainWorldOptions): Promise<{
|
|
1605
|
+
worldGlb: Uint8Array;
|
|
1606
|
+
}>;
|
|
1607
|
+
declare function cookTerrainWorld(options: ICookTerrainWorldOptions): Promise<ICookTerrainWorldResult>;
|
|
1608
|
+
|
|
1609
|
+
export { type AssetFindingGrade, type AssetKind, type AtlasExclusionReason, type AudioBand, type AudioConditioning, type AudioNormalisation, type IAssetCompileOptions, type IAssetCompileResult, type IAssetFinding, type IAssetHealthEntry, type IAssetHealthInput, type IAssetHealthReport, type IAssetPass, type IAssetPassOutput, type IAssetSourceConfig, type IAssetTargets, type IAssetWatchHandle, type IAssetWatchOptions, type IAssetWatchSummary, type IAtlasExclusion, type IAtlasOptions, type IAtlasPage, type IAtlasPlacement, type IAtlasResult, type IAtlasSource, type IAudioConfig, type IAudioLoopOptions, type IAudioOverride, type IAudioPassOptions, type IAudioRow, type IAudioSpectrumExpectation, type IBakeReceipt, type IBakeReceiptOutput, type IBasisTranscoder, type IContentCensus, type ICookTerrainWorldMaterialLayer, type ICookTerrainWorldOptions, type ICookTerrainWorldResult, type IDedupeCensus, type IEmbeddedTextureRow, type IEmbeddedTextureSummary, type ILightmapPassOptions, type IMaterialBucket, type IMaterialState, type IModelCompactInstanceOptions, type IModelCompactOptions, type IModelCompactSummary, type IModelPassOptions, type IModelPassesOptions, type IModelProtectedNode, type IModelQuantizeOptions, type IModelSimplifyOptions, type IModelSimplifySummary, type IModelSizeRow, type IModelStats, type IModelTextureBinding, type IModelTextureBindings, type IModelTextureOverride, type IModelTexturesOptions, type IModelsConfig, type IPassCostAssetRow, type IPassCostRow, type IPngInfo, type IPreparedTerrainWorldOptions, type IResolvedCompactOptions, type ISimplifyRow, type ISpeciesLODSpec, type ISpeciesSpec, type ITextureOverride, type ITexturePassOptions, type ITextureSizeRow, type ITextureStats, type ITexturesConfig, type IWorldPackageAsset, type IWorldPackageManifest, type PassCostStatus, type TModelProtectedRule, type TextureCodec, WRAP_CLAMP_TO_EDGE, WRAP_MIRRORED_REPEAT, WRAP_REPEAT, atlasManifest, audioPass, censusDocument, compileAssets, cookTerrainWorld, dedupeMaterials, formatAudioSizes, formatHealthReport, formatModelSizes, formatPassCosts, formatTextureSizes, lightmapPass, materialSignature, materialStateOf, modelPass, packAtlas, parseAudioConfig, parsePng, resolveBasisTranscoder, resolveSourceTexel, rewriteUvs, runHealthReport, texturePass, thinFoliageCards, totalCensus, uvsTile, watchAssets, withAtlasTextures, wrapTiles };
|