@threenative/assets 0.3.12 → 0.3.13

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/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;
@@ -324,6 +325,8 @@ interface IModelLodOptions {
324
325
  readonly preset?: LodPreset;
325
326
  readonly runtime?: IModelLodRuntimeOptions;
326
327
  }
328
+ /** Thin MASK card sets into a standalone mesh; opaque parts and every vertex attribute survive. */
329
+ declare function thinFoliageCards(document: Document, keepRatio: number): number;
327
330
 
328
331
  /**
329
332
  * The five bands a clip's content is judged in, contiguous and gapless up to Nyquist.
@@ -1190,12 +1193,14 @@ interface IBakeReceipt {
1190
1193
  readonly outputs: readonly IBakeReceiptOutput[];
1191
1194
  readonly pipelineVersion: number;
1192
1195
  }
1196
+
1193
1197
  /**
1194
1198
  * Resolves three's Basis transcoder through the project's own `three` install so a path that
1195
1199
  * moved between three versions fails the build here, as a named error, instead of 404ing at
1196
1200
  * runtime inside the KTX2 loader.
1197
1201
  */
1198
1202
  declare function resolveBasisTranscoder(cwd: string): IBasisTranscoder;
1203
+
1199
1204
  declare function compileAssets(options?: IAssetCompileOptions): Promise<IAssetCompileResult>;
1200
1205
 
1201
1206
  /**
@@ -1529,4 +1534,69 @@ declare function censusDocument(model: string, document: Document, pageSize?: nu
1529
1534
  /** Totals across a set of models, so a scene's census is one line rather than twenty-nine. */
1530
1535
  declare function totalCensus(entries: readonly IContentCensus[]): Omit<IContentCensus, "model">;
1531
1536
 
1532
- 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 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 IResolvedCompactOptions, type ISimplifyRow, type ITextureOverride, type ITexturePassOptions, type ITextureSizeRow, type ITextureStats, type ITexturesConfig, type PassCostStatus, type TModelProtectedRule, type TextureCodec, WRAP_CLAMP_TO_EDGE, WRAP_MIRRORED_REPEAT, WRAP_REPEAT, atlasManifest, audioPass, censusDocument, compileAssets, dedupeMaterials, formatAudioSizes, formatHealthReport, formatModelSizes, formatPassCosts, formatTextureSizes, lightmapPass, materialSignature, materialStateOf, modelPass, packAtlas, parseAudioConfig, parsePng, resolveBasisTranscoder, resolveSourceTexel, rewriteUvs, runHealthReport, texturePass, totalCensus, uvsTile, watchAssets, withAtlasTextures, wrapTiles };
1537
+ /** The world.json contract, taken from the shared baker rather than restated here. */
1538
+ type IWorldPackageManifest = ReturnType<typeof bakeWorldPackage>["manifest"];
1539
+ /** One streamed species entry, taken from the shared baker's own option type. */
1540
+ type IWorldPackageAsset = NonNullable<IWorldPackageManifest["assets"][string]>;
1541
+ interface ISpeciesLODSpec {
1542
+ readonly glb?: string | Uint8Array;
1543
+ readonly distance: number;
1544
+ }
1545
+ interface ISpeciesSpec {
1546
+ readonly glb: string | Uint8Array;
1547
+ readonly bounds?: {
1548
+ readonly min: readonly [number, number, number];
1549
+ readonly max: readonly [number, number, number];
1550
+ };
1551
+ readonly lods?: readonly ISpeciesLODSpec[];
1552
+ readonly maxDistance?: number;
1553
+ }
1554
+ interface ICookTerrainWorldMaterialLayer {
1555
+ readonly id: string;
1556
+ readonly diff?: string | Uint8Array;
1557
+ readonly nrm?: string | Uint8Array;
1558
+ readonly orm?: string | Uint8Array;
1559
+ readonly h?: string | Uint8Array;
1560
+ readonly diffBytes?: Uint8Array;
1561
+ readonly nrmBytes?: Uint8Array;
1562
+ readonly ormBytes?: Uint8Array;
1563
+ readonly hBytes?: Uint8Array;
1564
+ readonly diffMimeType?: string;
1565
+ readonly nrmMimeType?: string;
1566
+ }
1567
+ interface ICookTerrainWorldOptions {
1568
+ readonly state: ITerrainState;
1569
+ readonly species: Readonly<Record<string, ISpeciesSpec>>;
1570
+ readonly out: string;
1571
+ readonly materials?: {
1572
+ readonly layers?: readonly ICookTerrainWorldMaterialLayer[];
1573
+ readonly texturesDir?: string;
1574
+ };
1575
+ readonly cellSize?: number;
1576
+ readonly extraLayers?: Readonly<Record<string, string>>;
1577
+ }
1578
+ interface ICookTerrainWorldResult {
1579
+ readonly worldGlb: Uint8Array;
1580
+ readonly manifest: IWorldPackageManifest;
1581
+ /** Reuse the validated binary package instead of baking it again for companion files. */
1582
+ readonly worldPackage?: ReturnType<typeof bakeWorldPackage>;
1583
+ readonly placementCounts: Readonly<Record<string, number>>;
1584
+ /** Every node in the document, across the default and every alternate-LOD scene. */
1585
+ readonly nodeCount: number;
1586
+ /**
1587
+ * Instancing nodes in the default `TerrainWorld` scene only, so an existing consumer keeps
1588
+ * reading one node per species. Alternate LODs live in their own named scenes and are not
1589
+ * counted here; walk `getRoot().listScenes()` for the authoritative all-scene census.
1590
+ */
1591
+ readonly instancedMeshCount: number;
1592
+ }
1593
+ /** A portable editor scene with embedded data URIs, already frozen by the game. */
1594
+ interface IPreparedTerrainWorldOptions {
1595
+ readonly preparedWorld: Record<string, unknown>;
1596
+ }
1597
+ declare function cookTerrainWorld(options: IPreparedTerrainWorldOptions): Promise<{
1598
+ worldGlb: Uint8Array;
1599
+ }>;
1600
+ declare function cookTerrainWorld(options: ICookTerrainWorldOptions): Promise<ICookTerrainWorldResult>;
1601
+
1602
+ 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 };