@galacean/engine-loader 1.3.1 → 1.3.2

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.
Files changed (136) hide show
  1. package/dist/main.js.map +1 -1
  2. package/dist/module.js.map +1 -1
  3. package/package.json +4 -4
  4. package/types/draco/src/DRACOWorker.d.ts +23 -0
  5. package/types/draco/src/KHR_draco_mesh_compression.d.ts +9 -0
  6. package/types/draco/src/decoder.d.ts +18 -0
  7. package/types/gltf/GLTFParser.d.ts +9 -0
  8. package/types/gltf/GLTFPipeline.d.ts +23 -0
  9. package/types/gltf/GLTFUtil.d.ts +53 -0
  10. package/types/gltf/Schema.d.ts +814 -0
  11. package/types/gltf/extensions/ExtensionParser.d.ts +8 -0
  12. package/types/gltf/extensions/KHR_draco_mesh_compression.d.ts +1 -0
  13. package/types/gltf/extensions/Schema.d.ts +142 -0
  14. package/types/gltf/extensions/test.d.ts +0 -0
  15. package/types/gltf/parser/AnimationParser.d.ts +7 -0
  16. package/types/gltf/parser/BufferParser.d.ts +7 -0
  17. package/types/gltf/parser/EntityParser.d.ts +9 -0
  18. package/types/gltf/parser/MaterialParser.d.ts +8 -0
  19. package/types/gltf/parser/MeshParser.d.ts +13 -0
  20. package/types/gltf/parser/Parser.d.ts +21 -0
  21. package/types/gltf/parser/ParserContext.d.ts +46 -0
  22. package/types/gltf/parser/SceneParser.d.ts +11 -0
  23. package/types/gltf/parser/SkinParser.d.ts +6 -0
  24. package/types/gltf/parser/TextureParser.d.ts +8 -0
  25. package/types/gltf/parser/Validator.d.ts +5 -0
  26. package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +13 -0
  27. package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +33 -0
  28. package/types/ktx2/KTX2Parser.d.ts +4 -0
  29. package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +17 -0
  30. package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +34 -0
  31. package/types/ktx2/TargetFormat.d.ts +8 -0
  32. package/types/ktx2/TranscodeResult.d.ts +10 -0
  33. package/types/ktx2/constants.d.ts +7 -0
  34. package/types/ktx2/zstddec.d.ts +62 -0
  35. package/types/loader/src/AnimationClipLoader.d.ts +1 -0
  36. package/types/loader/src/AnimatorControllerLoader.d.ts +1 -0
  37. package/types/loader/src/BufferLoader.d.ts +1 -0
  38. package/types/loader/src/EnvLoader.d.ts +1 -0
  39. package/types/loader/src/FontLoader.d.ts +1 -0
  40. package/types/loader/src/GLTFContentRestorer.d.ts +92 -0
  41. package/types/loader/src/GLTFLoader.d.ts +22 -0
  42. package/types/loader/src/HDRLoader.d.ts +1 -0
  43. package/types/loader/src/JSONLoader.d.ts +1 -0
  44. package/types/loader/src/KTXCubeLoader.d.ts +1 -0
  45. package/types/loader/src/KTXLoader.d.ts +4 -0
  46. package/types/loader/src/MaterialLoader.d.ts +1 -0
  47. package/types/loader/src/MeshLoader.d.ts +1 -0
  48. package/types/loader/src/ProjectLoader.d.ts +1 -0
  49. package/types/loader/src/SceneLoader.d.ts +1 -0
  50. package/types/loader/src/SourceFontLoader.d.ts +1 -0
  51. package/types/loader/src/SpriteAtlasLoader.d.ts +1 -0
  52. package/types/loader/src/SpriteLoader.d.ts +1 -0
  53. package/types/loader/src/TextLoader.d.ts +1 -0
  54. package/types/loader/src/Texture2DContentRestorer.d.ts +11 -0
  55. package/types/loader/src/Texture2DLoader.d.ts +18 -0
  56. package/types/loader/src/TextureCubeContentRestorer.d.ts +11 -0
  57. package/types/loader/src/TextureCubeLoader.d.ts +1 -0
  58. package/types/loader/src/compressed-texture/KhronosTextureContainer.d.ts +20 -0
  59. package/types/loader/src/compressed-texture/index.d.ts +3 -0
  60. package/types/loader/src/compressed-texture/type.d.ts +87 -0
  61. package/types/loader/src/gltf/GLTFResource.d.ts +65 -0
  62. package/types/loader/src/gltf/GLTFSchema.d.ts +822 -0
  63. package/types/loader/src/gltf/GLTFUtils.d.ts +49 -0
  64. package/types/loader/src/gltf/extensions/EXT_meshopt_compression.d.ts +13 -0
  65. package/types/loader/src/gltf/extensions/GALACEAN_animation_event.d.ts +1 -0
  66. package/types/loader/src/gltf/extensions/GALACEAN_materials_remap.d.ts +1 -0
  67. package/types/loader/src/gltf/extensions/GLTFExtensionParser.d.ts +46 -0
  68. package/types/loader/src/gltf/extensions/GLTFExtensionSchema.d.ts +157 -0
  69. package/types/loader/src/gltf/extensions/KHR_lights_punctual.d.ts +1 -0
  70. package/types/loader/src/gltf/extensions/KHR_materials_anisotropy.d.ts +1 -0
  71. package/types/loader/src/gltf/extensions/KHR_materials_clearcoat.d.ts +1 -0
  72. package/types/loader/src/gltf/extensions/KHR_materials_ior.d.ts +1 -0
  73. package/types/loader/src/gltf/extensions/KHR_materials_pbrSpecularGlossiness.d.ts +1 -0
  74. package/types/loader/src/gltf/extensions/KHR_materials_sheen.d.ts +0 -0
  75. package/types/loader/src/gltf/extensions/KHR_materials_transmission.d.ts +0 -0
  76. package/types/loader/src/gltf/extensions/KHR_materials_unlit.d.ts +1 -0
  77. package/types/loader/src/gltf/extensions/KHR_materials_variants.d.ts +6 -0
  78. package/types/loader/src/gltf/extensions/KHR_materials_volume.d.ts +0 -0
  79. package/types/loader/src/gltf/extensions/KHR_mesh_quantization.d.ts +1 -0
  80. package/types/loader/src/gltf/extensions/KHR_texture_basisu.d.ts +1 -0
  81. package/types/loader/src/gltf/extensions/KHR_texture_transform.d.ts +1 -0
  82. package/types/loader/src/gltf/extensions/MeshoptDecoder.d.ts +8 -0
  83. package/types/loader/src/gltf/extensions/index.d.ts +19 -0
  84. package/types/loader/src/gltf/index.d.ts +5 -0
  85. package/types/loader/src/gltf/parser/GLTFAnimationParser.d.ts +12 -0
  86. package/types/loader/src/gltf/parser/GLTFBufferParser.d.ts +6 -0
  87. package/types/loader/src/gltf/parser/GLTFBufferViewParser.d.ts +5 -0
  88. package/types/loader/src/gltf/parser/GLTFEntityParser.d.ts +6 -0
  89. package/types/loader/src/gltf/parser/GLTFMaterialParser.d.ts +18 -0
  90. package/types/loader/src/gltf/parser/GLTFMeshParser.d.ts +19 -0
  91. package/types/loader/src/gltf/parser/GLTFParser.d.ts +57 -0
  92. package/types/loader/src/gltf/parser/GLTFParserContext.d.ts +70 -0
  93. package/types/loader/src/gltf/parser/GLTFSceneParser.d.ts +11 -0
  94. package/types/loader/src/gltf/parser/GLTFSchemaParser.d.ts +7 -0
  95. package/types/loader/src/gltf/parser/GLTFSkinParser.d.ts +7 -0
  96. package/types/loader/src/gltf/parser/GLTFTextureParser.d.ts +12 -0
  97. package/types/loader/src/gltf/parser/GLTFValidator.d.ts +5 -0
  98. package/types/loader/src/gltf/parser/index.d.ts +13 -0
  99. package/types/loader/src/index.d.ts +28 -0
  100. package/types/loader/src/ktx2/KTX2Container.d.ts +72 -0
  101. package/types/loader/src/ktx2/KTX2Loader.d.ts +65 -0
  102. package/types/loader/src/ktx2/KTX2TargetFormat.d.ts +21 -0
  103. package/types/loader/src/ktx2/WorkerPool.d.ts +32 -0
  104. package/types/loader/src/ktx2/transcoder/AbstractTranscoder.d.ts +55 -0
  105. package/types/loader/src/ktx2/transcoder/BinomialLLCTranscoder.d.ts +8 -0
  106. package/types/loader/src/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +6 -0
  107. package/types/loader/src/ktx2/transcoder/KhronosTranscoder.d.ts +13 -0
  108. package/types/loader/src/ktx2/transcoder/KhronosWorkerCode.d.ts +1 -0
  109. package/types/loader/src/resource-deserialize/index.d.ts +18 -0
  110. package/types/loader/src/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +19 -0
  111. package/types/loader/src/resource-deserialize/resources/animationClip/ComponentMap.d.ts +2 -0
  112. package/types/loader/src/resource-deserialize/resources/mesh/MeshDecoder.d.ts +9 -0
  113. package/types/loader/src/resource-deserialize/resources/mesh/type.d.ts +31 -0
  114. package/types/loader/src/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
  115. package/types/loader/src/resource-deserialize/resources/parser/ReflectionParser.d.ts +18 -0
  116. package/types/loader/src/resource-deserialize/resources/scene/EditorTextureLoader.d.ts +4 -0
  117. package/types/loader/src/resource-deserialize/resources/scene/MeshLoader.d.ts +4 -0
  118. package/types/loader/src/resource-deserialize/resources/scene/SceneParser.d.ts +29 -0
  119. package/types/loader/src/resource-deserialize/resources/scene/SceneParserContext.d.ts +15 -0
  120. package/types/loader/src/resource-deserialize/resources/schema/BasicSchema.d.ts +66 -0
  121. package/types/loader/src/resource-deserialize/resources/schema/MaterialSchema.d.ts +91 -0
  122. package/types/loader/src/resource-deserialize/resources/schema/ProjectSchema.d.ts +9 -0
  123. package/types/loader/src/resource-deserialize/resources/schema/SceneSchema.d.ts +43 -0
  124. package/types/loader/src/resource-deserialize/resources/schema/index.d.ts +4 -0
  125. package/types/loader/src/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +5 -0
  126. package/types/loader/src/resource-deserialize/utils/BufferReader.d.ts +28 -0
  127. package/types/loader/src/resource-deserialize/utils/Decorator.d.ts +11 -0
  128. package/types/loader/src/resource-deserialize/utils/FileHeader.d.ts +9 -0
  129. package/types/loader/src/resource-deserialize/utils/Utils.d.ts +5 -0
  130. package/types/prefab/PrefabParserContext.d.ts +6 -0
  131. package/types/prefab/index.d.ts +3 -0
  132. package/types/resource-deserialize/resources/animationClip/ComponentMap.d.ts +2 -0
  133. package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
  134. package/types/resource-deserialize/resources/parser/PrefabParserContext.d.ts +5 -0
  135. package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +70 -0
  136. package/types/resource-deserialize/resources/prefab/ReflectionParser.d.ts +14 -0
@@ -0,0 +1,8 @@
1
+ import { EngineObject } from "@galacean/engine-core";
2
+ import { ParserContext } from "../parser/ParserContext";
3
+ import { ExtensionSchema } from "./Schema";
4
+ export declare abstract class ExtensionParser {
5
+ initialize(): void;
6
+ parseEngineResource(schema: ExtensionSchema, parseResource: EngineObject, context: ParserContext, ...extra: any[]): void | Promise<void>;
7
+ createEngineResource(schema: ExtensionSchema, context: ParserContext, ...extra: any[]): EngineObject | Promise<EngineObject>;
8
+ }
@@ -0,0 +1,142 @@
1
+ import { IMaterialNormalTextureInfo, ITextureInfo } from "../Schema";
2
+ /**
3
+ * Interfaces from the KHR_lights_punctual extension
4
+ */
5
+ export interface IKHRLightsPunctual_LightNode {
6
+ light: number;
7
+ }
8
+ export interface IKHRLightsPunctual_Light {
9
+ type: "directional" | "point" | "spot";
10
+ color?: number[];
11
+ intensity?: number;
12
+ range?: number;
13
+ spot?: {
14
+ innerConeAngle?: number;
15
+ outerConeAngle?: number;
16
+ };
17
+ }
18
+ export interface IKHRLightsPunctual {
19
+ lights: IKHRLightsPunctual_Light[];
20
+ }
21
+ /**
22
+ * Interfaces from the KHR_draco_mesh_compression extension
23
+ */
24
+ export interface IKHRDracoMeshCompression {
25
+ bufferView: number;
26
+ attributes: {
27
+ [name: string]: number;
28
+ };
29
+ }
30
+ /**
31
+ * Interfaces from the KHR_materials_clearcoat extension
32
+ */
33
+ export interface IKHRMaterialsClearcoat {
34
+ clearcoatFactor: number;
35
+ clearcoatTexture: ITextureInfo;
36
+ clearcoatRoughnessFactor: number;
37
+ clearcoatRoughnessTexture: ITextureInfo;
38
+ clearcoatNormalTexture: IMaterialNormalTextureInfo;
39
+ }
40
+ /**
41
+ * Interfaces from the KHR_materials_ior extension
42
+ */
43
+ export interface IKHRMaterialsIor {
44
+ ior: number;
45
+ }
46
+ /**
47
+ * Interfaces from the KHR_materials_unlit extension
48
+ */
49
+ export interface IKHRMaterialsUnlit {
50
+ }
51
+ /**
52
+ * Interfaces from the KHR_materials_pbrSpecularGlossiness extension
53
+ */
54
+ export interface IKHRMaterialsPbrSpecularGlossiness {
55
+ diffuseFactor: number[];
56
+ diffuseTexture: ITextureInfo;
57
+ specularFactor: number[];
58
+ glossinessFactor: number;
59
+ specularGlossinessTexture: ITextureInfo;
60
+ }
61
+ /**
62
+ * Interfaces from the KHR_materials_sheen extension
63
+ */
64
+ export interface IKHRMaterialsSheen {
65
+ sheenColorFactor?: number[];
66
+ sheenColorTexture?: ITextureInfo;
67
+ sheenRoughnessFactor?: number;
68
+ sheenRoughnessTexture?: ITextureInfo;
69
+ }
70
+ /**
71
+ * Interfaces from the KHR_materials_specular extension
72
+ */
73
+ export interface IKHRMaterialsSpecular {
74
+ specularFactor: number;
75
+ specularColorFactor: number[];
76
+ specularTexture: ITextureInfo;
77
+ }
78
+ /**
79
+ * Interfaces from the KHR_materials_transmission extension
80
+ */
81
+ export interface IKHRMaterialsTransmission {
82
+ transmissionFactor?: number;
83
+ transmissionTexture?: ITextureInfo;
84
+ }
85
+ /**
86
+ * Interfaces from the KHR_materials_translucency extension
87
+ */
88
+ export interface IKHRMaterialsTranslucency {
89
+ translucencyFactor?: number;
90
+ translucencyTexture?: ITextureInfo;
91
+ }
92
+ /**
93
+ * Interfaces from the KHR_materials_variants extension
94
+ */
95
+ export interface IKHRMaterialVariants_Mapping {
96
+ mappings: Array<{
97
+ variants: number[];
98
+ material: number;
99
+ }>;
100
+ extensions?: any;
101
+ extras?: any;
102
+ }
103
+ export interface IKHRMaterialVariants_Variant {
104
+ name: string;
105
+ extensions?: any;
106
+ extras?: any;
107
+ }
108
+ export interface IKHRMaterialVariants_Variants {
109
+ variants: Array<IKHRMaterialVariants_Variant>;
110
+ }
111
+ /**
112
+ * Interfaces from the KHR_texture_basisu extension
113
+ */
114
+ export interface IKHRTextureBasisU {
115
+ source: number;
116
+ }
117
+ /**
118
+ * Interfaces from the KHR_texture_transform extension
119
+ */
120
+ export interface IKHRTextureTransform {
121
+ offset?: number[];
122
+ rotation?: number;
123
+ scale?: number[];
124
+ texCoord?: number;
125
+ }
126
+ /**
127
+ * Interfaces from the KHR_xmp extension
128
+ */
129
+ export interface IKHRXmp {
130
+ packets: Array<{
131
+ [key: string]: unknown;
132
+ }>;
133
+ }
134
+ export interface IKHRXmp_Node {
135
+ packet: number;
136
+ }
137
+ export interface IGalaceanMaterialRemap {
138
+ refId: string;
139
+ key?: string;
140
+ isClone?: boolean;
141
+ }
142
+ export type ExtensionSchema = IKHRLightsPunctual_Light | IKHRDracoMeshCompression | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsPbrSpecularGlossiness | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node;
File without changes
@@ -0,0 +1,7 @@
1
+ import { AnimationClip, AssetPromise } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class AnimationParser extends Parser {
5
+ parse(context: ParserContext): AssetPromise<AnimationClip[]>;
6
+ private _addCurve;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { AssetPromise } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class BufferParser extends Parser {
5
+ parse(context: ParserContext): AssetPromise<void>;
6
+ private _isGLB;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Parser } from "./Parser";
2
+ import { ParserContext } from "./ParserContext";
3
+ export declare class EntityParser extends Parser {
4
+ /** @internal */
5
+ static _defaultName: String;
6
+ parse(context: ParserContext): void;
7
+ private _buildEntityTree;
8
+ private _createSceneRoots;
9
+ }
@@ -0,0 +1,8 @@
1
+ import { AssetPromise, Material } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class MaterialParser extends Parser {
5
+ /** @internal */
6
+ static _parseTextureTransform(material: Material, extensions: any, context: ParserContext): void;
7
+ parse(context: ParserContext): AssetPromise<Material[]>;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { AssetPromise, ModelMesh } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class MeshParser extends Parser {
5
+ private static _tempVector3;
6
+ parse(context: ParserContext): AssetPromise<ModelMesh[][]>;
7
+ private _parseMeshFromGLTFPrimitive;
8
+ private _createBlendShape;
9
+ /**
10
+ * @deprecated
11
+ */
12
+ private _parseMeshFromGLTFPrimitiveDraco;
13
+ }
@@ -0,0 +1,21 @@
1
+ import { AnimationClip, AssetPromise, EngineObject, Material, Mesh } from "@galacean/engine-core";
2
+ import { ExtensionParser } from "../extensions/ExtensionParser";
3
+ import { ExtensionSchema } from "../extensions/Schema";
4
+ import { ParserContext } from "./ParserContext";
5
+ export declare abstract class Parser {
6
+ private static _extensionParsers;
7
+ static parseEngineResource(extensionName: string, extensionSchema: ExtensionSchema, parseResource: EngineObject, context: ParserContext, ...extra: any[]): void;
8
+ static createEngineResource<T extends EngineObject>(extensionName: string, extensionSchema: ExtensionSchema, context: ParserContext, ...extra: any[]): T | Promise<T>;
9
+ static hasExtensionParser(extensionName: string): boolean;
10
+ static initialize(extensionName: string): void;
11
+ /**
12
+ * @internal
13
+ */
14
+ static _addExtensionParser(extensionName: string, extensionParser: ExtensionParser): void;
15
+ abstract parse(context: ParserContext): AssetPromise<any> | void | Material | AnimationClip | Mesh;
16
+ }
17
+ /**
18
+ * Declare ExtensionParser's decorator.
19
+ * @param extensionName - Extension name
20
+ */
21
+ export declare function registerExtension(extensionName: string): (parser: new () => ExtensionParser) => void;
@@ -0,0 +1,46 @@
1
+ import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
2
+ import { GLTFResource } from "../GLTFResource";
3
+ import { IGLTF } from "../Schema";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare class ParserContext {
8
+ gltf: IGLTF;
9
+ buffers: ArrayBuffer[];
10
+ glTFResource: GLTFResource;
11
+ keepMeshData: boolean;
12
+ hasSkinned: boolean;
13
+ /** chain asset promise */
14
+ chainPromises: AssetPromise<any>[];
15
+ accessorBufferCache: Record<string, BufferInfo>;
16
+ texturesPromiseInfo: PromiseInfo<Texture2D[]>;
17
+ materialsPromiseInfo: PromiseInfo<Material[]>;
18
+ meshesPromiseInfo: PromiseInfo<ModelMesh[][]>;
19
+ animationClipsPromiseInfo: PromiseInfo<AnimationClip[]>;
20
+ defaultSceneRootPromiseInfo: PromiseInfo<Entity>;
21
+ masterPromiseInfo: PromiseInfo<GLTFResource>;
22
+ promiseMap: Record<string, AssetPromise<any>>;
23
+ constructor(url: string);
24
+ private _initPromiseInfo;
25
+ }
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare class BufferInfo {
30
+ data: TypedArray;
31
+ interleaved: boolean;
32
+ stride: number;
33
+ vertexBuffer: Buffer;
34
+ vertexBindingInfos: Record<number, number>;
35
+ constructor(data: TypedArray, interleaved: boolean, stride: number);
36
+ }
37
+ /**
38
+ * @internal
39
+ */
40
+ export declare class PromiseInfo<T> {
41
+ promise: AssetPromise<T>;
42
+ resolve: (value?: T | PromiseLike<T>) => void;
43
+ reject: (reason?: any) => void;
44
+ setProgress: (progress: number) => void;
45
+ onCancel: (callback: () => void) => void;
46
+ }
@@ -0,0 +1,11 @@
1
+ import { AssetPromise, Entity } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class SceneParser extends Parser {
5
+ private static _defaultMaterial;
6
+ private static _getDefaultMaterial;
7
+ parse(context: ParserContext): AssetPromise<Entity>;
8
+ private _createCamera;
9
+ private _createRenderer;
10
+ private _createAnimator;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { Parser } from "./Parser";
2
+ import { ParserContext } from "./ParserContext";
3
+ export declare class SkinParser extends Parser {
4
+ parse(context: ParserContext): void;
5
+ private _findSkeletonRootBone;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { AssetPromise, Texture2D } from "@galacean/engine-core";
2
+ import { Parser } from "./Parser";
3
+ import { ParserContext } from "./ParserContext";
4
+ export declare class TextureParser extends Parser {
5
+ private static _wrapMap;
6
+ parse(context: ParserContext): AssetPromise<Texture2D[]>;
7
+ private _parseSampler;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { Parser } from "./Parser";
2
+ import { ParserContext } from "./ParserContext";
3
+ export declare class Validator extends Parser {
4
+ parse(context: ParserContext): void;
5
+ }
@@ -0,0 +1,13 @@
1
+ import { KTX2TargetFormat } from "../KTX2TargetFormat";
2
+ import { TranscodeResult } from "../TranscodeResult";
3
+ /** @internal */
4
+ export declare class BinomialLLCTranscoder {
5
+ readonly workerLimit: number;
6
+ static MessageId: number;
7
+ private _transcodeWorkerPool;
8
+ private _initPromise;
9
+ constructor(workerLimit: number);
10
+ init(): Promise<any>;
11
+ transcode(buffer: ArrayBuffer, format: KTX2TargetFormat): Promise<TranscodeResult>;
12
+ destroy(): void;
13
+ }
@@ -0,0 +1,33 @@
1
+ type MessageType = "init" | "transcode";
2
+ export interface IBaseMessage {
3
+ type: MessageType;
4
+ }
5
+ export interface IInitMessage extends IBaseMessage {
6
+ type: "init";
7
+ transcoderWasm: ArrayBuffer;
8
+ }
9
+ export interface ITranscodeMessage extends IBaseMessage {
10
+ type: "transcode";
11
+ format: number;
12
+ buffer: ArrayBuffer;
13
+ }
14
+ export type IMessage = IInitMessage | ITranscodeMessage;
15
+ export type TranscodeResult = {
16
+ width: number;
17
+ height: number;
18
+ hasAlpha: boolean;
19
+ format: number;
20
+ faces: Array<{
21
+ data: Uint8Array;
22
+ width: number;
23
+ height: number;
24
+ }>[];
25
+ faceCount: number;
26
+ };
27
+ export type TranscodeResponse = {
28
+ id: number;
29
+ type: "transcoded";
30
+ } & TranscodeResult;
31
+ /** @internal */
32
+ export declare function TranscodeWorkerCode(): void;
33
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare enum ColorModel {
2
+ ETC1S = 163,
3
+ UASTC = 166
4
+ }
@@ -0,0 +1,17 @@
1
+ import { KTX2Container } from "../KTX2Container";
2
+ import { KTX2TargetFormat } from "../KTX2TargetFormat";
3
+ import { TranscodeResult } from "./TranscoderWorkerCode";
4
+ /** @internal */
5
+ export declare class KhronosTranscoder {
6
+ readonly workerLimit: number;
7
+ readonly type: KTX2TargetFormat;
8
+ static transcoderMap: {
9
+ 0: string;
10
+ };
11
+ private _transcodeWorkerPool;
12
+ private _initPromise;
13
+ constructor(workerLimit: number, type: KTX2TargetFormat);
14
+ init(): Promise<any>;
15
+ transcode(ktx2Container: KTX2Container): Promise<TranscodeResult>;
16
+ destroy(): void;
17
+ }
@@ -0,0 +1,34 @@
1
+ export interface EncodedData {
2
+ buffer: Uint8Array;
3
+ levelWidth: number;
4
+ levelHeight: number;
5
+ uncompressedByteLength: number;
6
+ }
7
+ type MessageType = "init" | "transcode";
8
+ export interface IBaseMessage {
9
+ type: MessageType;
10
+ }
11
+ export interface IInitMessage extends IBaseMessage {
12
+ type: "init";
13
+ transcoderWasm: ArrayBuffer;
14
+ }
15
+ export interface ITranscodeMessage extends IBaseMessage {
16
+ type: "transcode";
17
+ format: number;
18
+ needZstd: boolean;
19
+ data: EncodedData[][];
20
+ }
21
+ export type IMessage = IInitMessage | ITranscodeMessage;
22
+ export type TranscodeResult = {
23
+ data: Array<{
24
+ data: Uint8Array;
25
+ width: number;
26
+ height: number;
27
+ }>;
28
+ };
29
+ export type TranscodeResponse = {
30
+ id: number;
31
+ type: "transcoded";
32
+ } & TranscodeResult;
33
+ export declare function TranscodeWorkerCode(): void;
34
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare enum TargetFormat {
2
+ ASTC = 0,
3
+ BC7 = 1,
4
+ DXT = 2,
5
+ PVRTC = 3,
6
+ ETC = 4,
7
+ RGBA8 = 5
8
+ }
@@ -0,0 +1,10 @@
1
+ export interface TranscodeResult {
2
+ width: number;
3
+ height: number;
4
+ hasAlpha: boolean;
5
+ mipmaps: Array<{
6
+ data: Uint8Array;
7
+ width: number;
8
+ height: number;
9
+ }>;
10
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum SupercompressionScheme {
2
+ None = 0,
3
+ BasisLZ = 1,
4
+ Zstd = 2,
5
+ ZLib = 3
6
+ }
7
+ export declare const KHR_DF_SAMPLE_DATATYPE_SIGNED = 64;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * From https://github.com/donmccurdy/zstddec by Don McCurdy
3
+ */
4
+ interface DecoderExports {
5
+ memory: Uint8Array;
6
+ ZSTD_findDecompressedSize: (compressedPtr: number, compressedSize: number) => number;
7
+ ZSTD_decompress: (uncompressedPtr: number, uncompressedSize: number, compressedPtr: number, compressedSize: number) => number;
8
+ malloc: (ptr: number) => number;
9
+ free: (ptr: number) => void;
10
+ }
11
+ /**
12
+ * ZSTD (Zstandard) decoder.
13
+ */
14
+ export declare class ZSTDDecoder {
15
+ static heap: Uint8Array;
16
+ static IMPORT_OBJECT: {
17
+ env: {
18
+ emscripten_notify_memory_growth: () => void;
19
+ };
20
+ };
21
+ static instance: {
22
+ exports: DecoderExports;
23
+ };
24
+ static WasmModuleURL: string;
25
+ _initPromise: Promise<any>;
26
+ init(): Promise<void>;
27
+ _init(result: WebAssembly.WebAssemblyInstantiatedSource): void;
28
+ decode(array: Uint8Array, uncompressedSize?: number): Uint8Array;
29
+ }
30
+ export {};
31
+ /**
32
+ * BSD License
33
+ *
34
+ * For Zstandard software
35
+ *
36
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. All rights reserved.
37
+ *
38
+ * Redistribution and use in source and binary forms, with or without modification,
39
+ * are permitted provided that the following conditions are met:
40
+ *
41
+ * * Redistributions of source code must retain the above copyright notice, this
42
+ * list of conditions and the following disclaimer.
43
+ *
44
+ * * Redistributions in binary form must reproduce the above copyright notice,
45
+ * this list of conditions and the following disclaimer in the documentation
46
+ * and/or other materials provided with the distribution.
47
+ *
48
+ * * Neither the name Facebook nor the names of its contributors may be used to
49
+ * endorse or promote products derived from this software without specific
50
+ * prior written permission.
51
+ *
52
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
53
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
55
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
56
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
57
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
58
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
59
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,92 @@
1
+ import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
2
+ import { RequestConfig } from "@galacean/engine-core/types/asset/request";
3
+ import { Vector2 } from "@galacean/engine-math";
4
+ import { GLTFResource } from "./gltf/GLTFResource";
5
+ import type { IBufferView } from "./gltf/GLTFSchema";
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare class GLTFContentRestorer extends ContentRestorer<GLTFResource> {
10
+ isGLB: boolean;
11
+ bufferRequests: BufferRequestInfo[];
12
+ glbBufferSlices: Vector2[];
13
+ bufferTextures: BufferTextureRestoreInfo[];
14
+ meshes: ModelMeshRestoreInfo[];
15
+ restoreContent(): AssetPromise<GLTFResource>;
16
+ private _getBufferData;
17
+ }
18
+ /**
19
+ * @internal
20
+ */
21
+ export declare class BufferRequestInfo {
22
+ url: string;
23
+ config: RequestConfig;
24
+ constructor(url: string, config: RequestConfig);
25
+ }
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare class BufferTextureRestoreInfo {
30
+ texture: Texture2D;
31
+ bufferView: IBufferView;
32
+ mimeType: string;
33
+ constructor(texture: Texture2D, bufferView: IBufferView, mimeType: string);
34
+ }
35
+ /**
36
+ * @internal
37
+ */
38
+ export declare class ModelMeshRestoreInfo {
39
+ mesh: ModelMesh;
40
+ vertexBuffers: BufferRestoreInfo[];
41
+ indexBuffer: BufferDataRestoreInfo;
42
+ blendShapes: BlendShapeRestoreInfo[];
43
+ }
44
+ /**
45
+ * @internal
46
+ */
47
+ export declare class BufferRestoreInfo {
48
+ buffer: Buffer;
49
+ data: BufferDataRestoreInfo;
50
+ constructor(buffer: Buffer, data: BufferDataRestoreInfo);
51
+ }
52
+ /**
53
+ * @internal
54
+ */
55
+ export declare class BufferDataRestoreInfo {
56
+ main: RestoreDataAccessor;
57
+ typeSize?: number;
58
+ sparseCount?: number;
59
+ sparseIndices?: RestoreDataAccessor;
60
+ sparseValues?: RestoreDataAccessor;
61
+ constructor(main: RestoreDataAccessor, typeSize?: number, sparseCount?: number, sparseIndices?: RestoreDataAccessor, sparseValues?: RestoreDataAccessor);
62
+ }
63
+ /**
64
+ * @internal
65
+ */
66
+ export declare class RestoreDataAccessor {
67
+ bufferIndex: number;
68
+ TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray;
69
+ byteOffset: number;
70
+ length: number;
71
+ constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray, byteOffset: number, length: number);
72
+ }
73
+ /**
74
+ * @internal
75
+ */
76
+ export declare class BlendShapeRestoreInfo {
77
+ blendShape: BlendShape;
78
+ position: BlendShapeDataRestoreInfo;
79
+ normal?: BlendShapeDataRestoreInfo;
80
+ tangent?: BlendShapeDataRestoreInfo;
81
+ constructor(blendShape: BlendShape, position: BlendShapeDataRestoreInfo, normal?: BlendShapeDataRestoreInfo, tangent?: BlendShapeDataRestoreInfo);
82
+ }
83
+ /**
84
+ * @internal
85
+ */
86
+ export declare class BlendShapeDataRestoreInfo {
87
+ buffer: BufferDataRestoreInfo;
88
+ stride: number;
89
+ byteOffset: number;
90
+ count: number;
91
+ constructor(buffer: BufferDataRestoreInfo, stride: number, byteOffset: number, count: number);
92
+ }
@@ -0,0 +1,22 @@
1
+ import { AssetPromise, Engine, EngineConfiguration, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
2
+ import { GLTFResource } from "./gltf/GLTFResource";
3
+ export declare class GLTFLoader extends Loader<GLTFResource> {
4
+ /**
5
+ * Release glTF loader memory(includes meshopt workers).
6
+ * @remarks If use loader after releasing, we should release again.
7
+ */
8
+ static release(): void;
9
+ initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
10
+ load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<GLTFResource>;
11
+ }
12
+ /**
13
+ * GlTF loader params.
14
+ */
15
+ export interface GLTFParams {
16
+ /**
17
+ * @beta Now only contains vertex information, need to improve.
18
+ * Keep raw mesh data for glTF parser, default is false.
19
+ */
20
+ keepMeshData?: boolean;
21
+ [key: string]: any;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { AssetPromise, Loader, LoadItem, ResourceManager, Texture2D } from "@galacean/engine-core";
2
+ export declare class KTXLoader extends Loader<Texture2D> {
3
+ load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<Texture2D>;
4
+ }
@@ -0,0 +1 @@
1
+ export {};