@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.
- package/dist/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/draco/src/DRACOWorker.d.ts +23 -0
- package/types/draco/src/KHR_draco_mesh_compression.d.ts +9 -0
- package/types/draco/src/decoder.d.ts +18 -0
- package/types/gltf/GLTFParser.d.ts +9 -0
- package/types/gltf/GLTFPipeline.d.ts +23 -0
- package/types/gltf/GLTFUtil.d.ts +53 -0
- package/types/gltf/Schema.d.ts +814 -0
- package/types/gltf/extensions/ExtensionParser.d.ts +8 -0
- package/types/gltf/extensions/KHR_draco_mesh_compression.d.ts +1 -0
- package/types/gltf/extensions/Schema.d.ts +142 -0
- package/types/gltf/extensions/test.d.ts +0 -0
- package/types/gltf/parser/AnimationParser.d.ts +7 -0
- package/types/gltf/parser/BufferParser.d.ts +7 -0
- package/types/gltf/parser/EntityParser.d.ts +9 -0
- package/types/gltf/parser/MaterialParser.d.ts +8 -0
- package/types/gltf/parser/MeshParser.d.ts +13 -0
- package/types/gltf/parser/Parser.d.ts +21 -0
- package/types/gltf/parser/ParserContext.d.ts +46 -0
- package/types/gltf/parser/SceneParser.d.ts +11 -0
- package/types/gltf/parser/SkinParser.d.ts +6 -0
- package/types/gltf/parser/TextureParser.d.ts +8 -0
- package/types/gltf/parser/Validator.d.ts +5 -0
- package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +13 -0
- package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +33 -0
- package/types/ktx2/KTX2Parser.d.ts +4 -0
- package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +17 -0
- package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +34 -0
- package/types/ktx2/TargetFormat.d.ts +8 -0
- package/types/ktx2/TranscodeResult.d.ts +10 -0
- package/types/ktx2/constants.d.ts +7 -0
- package/types/ktx2/zstddec.d.ts +62 -0
- package/types/loader/src/AnimationClipLoader.d.ts +1 -0
- package/types/loader/src/AnimatorControllerLoader.d.ts +1 -0
- package/types/loader/src/BufferLoader.d.ts +1 -0
- package/types/loader/src/EnvLoader.d.ts +1 -0
- package/types/loader/src/FontLoader.d.ts +1 -0
- package/types/loader/src/GLTFContentRestorer.d.ts +92 -0
- package/types/loader/src/GLTFLoader.d.ts +22 -0
- package/types/loader/src/HDRLoader.d.ts +1 -0
- package/types/loader/src/JSONLoader.d.ts +1 -0
- package/types/loader/src/KTXCubeLoader.d.ts +1 -0
- package/types/loader/src/KTXLoader.d.ts +4 -0
- package/types/loader/src/MaterialLoader.d.ts +1 -0
- package/types/loader/src/MeshLoader.d.ts +1 -0
- package/types/loader/src/ProjectLoader.d.ts +1 -0
- package/types/loader/src/SceneLoader.d.ts +1 -0
- package/types/loader/src/SourceFontLoader.d.ts +1 -0
- package/types/loader/src/SpriteAtlasLoader.d.ts +1 -0
- package/types/loader/src/SpriteLoader.d.ts +1 -0
- package/types/loader/src/TextLoader.d.ts +1 -0
- package/types/loader/src/Texture2DContentRestorer.d.ts +11 -0
- package/types/loader/src/Texture2DLoader.d.ts +18 -0
- package/types/loader/src/TextureCubeContentRestorer.d.ts +11 -0
- package/types/loader/src/TextureCubeLoader.d.ts +1 -0
- package/types/loader/src/compressed-texture/KhronosTextureContainer.d.ts +20 -0
- package/types/loader/src/compressed-texture/index.d.ts +3 -0
- package/types/loader/src/compressed-texture/type.d.ts +87 -0
- package/types/loader/src/gltf/GLTFResource.d.ts +65 -0
- package/types/loader/src/gltf/GLTFSchema.d.ts +822 -0
- package/types/loader/src/gltf/GLTFUtils.d.ts +49 -0
- package/types/loader/src/gltf/extensions/EXT_meshopt_compression.d.ts +13 -0
- package/types/loader/src/gltf/extensions/GALACEAN_animation_event.d.ts +1 -0
- package/types/loader/src/gltf/extensions/GALACEAN_materials_remap.d.ts +1 -0
- package/types/loader/src/gltf/extensions/GLTFExtensionParser.d.ts +46 -0
- package/types/loader/src/gltf/extensions/GLTFExtensionSchema.d.ts +157 -0
- package/types/loader/src/gltf/extensions/KHR_lights_punctual.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_anisotropy.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_clearcoat.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_ior.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_pbrSpecularGlossiness.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_sheen.d.ts +0 -0
- package/types/loader/src/gltf/extensions/KHR_materials_transmission.d.ts +0 -0
- package/types/loader/src/gltf/extensions/KHR_materials_unlit.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_materials_variants.d.ts +6 -0
- package/types/loader/src/gltf/extensions/KHR_materials_volume.d.ts +0 -0
- package/types/loader/src/gltf/extensions/KHR_mesh_quantization.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_texture_basisu.d.ts +1 -0
- package/types/loader/src/gltf/extensions/KHR_texture_transform.d.ts +1 -0
- package/types/loader/src/gltf/extensions/MeshoptDecoder.d.ts +8 -0
- package/types/loader/src/gltf/extensions/index.d.ts +19 -0
- package/types/loader/src/gltf/index.d.ts +5 -0
- package/types/loader/src/gltf/parser/GLTFAnimationParser.d.ts +12 -0
- package/types/loader/src/gltf/parser/GLTFBufferParser.d.ts +6 -0
- package/types/loader/src/gltf/parser/GLTFBufferViewParser.d.ts +5 -0
- package/types/loader/src/gltf/parser/GLTFEntityParser.d.ts +6 -0
- package/types/loader/src/gltf/parser/GLTFMaterialParser.d.ts +18 -0
- package/types/loader/src/gltf/parser/GLTFMeshParser.d.ts +19 -0
- package/types/loader/src/gltf/parser/GLTFParser.d.ts +57 -0
- package/types/loader/src/gltf/parser/GLTFParserContext.d.ts +70 -0
- package/types/loader/src/gltf/parser/GLTFSceneParser.d.ts +11 -0
- package/types/loader/src/gltf/parser/GLTFSchemaParser.d.ts +7 -0
- package/types/loader/src/gltf/parser/GLTFSkinParser.d.ts +7 -0
- package/types/loader/src/gltf/parser/GLTFTextureParser.d.ts +12 -0
- package/types/loader/src/gltf/parser/GLTFValidator.d.ts +5 -0
- package/types/loader/src/gltf/parser/index.d.ts +13 -0
- package/types/loader/src/index.d.ts +28 -0
- package/types/loader/src/ktx2/KTX2Container.d.ts +72 -0
- package/types/loader/src/ktx2/KTX2Loader.d.ts +65 -0
- package/types/loader/src/ktx2/KTX2TargetFormat.d.ts +21 -0
- package/types/loader/src/ktx2/WorkerPool.d.ts +32 -0
- package/types/loader/src/ktx2/transcoder/AbstractTranscoder.d.ts +55 -0
- package/types/loader/src/ktx2/transcoder/BinomialLLCTranscoder.d.ts +8 -0
- package/types/loader/src/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +6 -0
- package/types/loader/src/ktx2/transcoder/KhronosTranscoder.d.ts +13 -0
- package/types/loader/src/ktx2/transcoder/KhronosWorkerCode.d.ts +1 -0
- package/types/loader/src/resource-deserialize/index.d.ts +18 -0
- package/types/loader/src/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +19 -0
- package/types/loader/src/resource-deserialize/resources/animationClip/ComponentMap.d.ts +2 -0
- package/types/loader/src/resource-deserialize/resources/mesh/MeshDecoder.d.ts +9 -0
- package/types/loader/src/resource-deserialize/resources/mesh/type.d.ts +31 -0
- package/types/loader/src/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
- package/types/loader/src/resource-deserialize/resources/parser/ReflectionParser.d.ts +18 -0
- package/types/loader/src/resource-deserialize/resources/scene/EditorTextureLoader.d.ts +4 -0
- package/types/loader/src/resource-deserialize/resources/scene/MeshLoader.d.ts +4 -0
- package/types/loader/src/resource-deserialize/resources/scene/SceneParser.d.ts +29 -0
- package/types/loader/src/resource-deserialize/resources/scene/SceneParserContext.d.ts +15 -0
- package/types/loader/src/resource-deserialize/resources/schema/BasicSchema.d.ts +66 -0
- package/types/loader/src/resource-deserialize/resources/schema/MaterialSchema.d.ts +91 -0
- package/types/loader/src/resource-deserialize/resources/schema/ProjectSchema.d.ts +9 -0
- package/types/loader/src/resource-deserialize/resources/schema/SceneSchema.d.ts +43 -0
- package/types/loader/src/resource-deserialize/resources/schema/index.d.ts +4 -0
- package/types/loader/src/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +5 -0
- package/types/loader/src/resource-deserialize/utils/BufferReader.d.ts +28 -0
- package/types/loader/src/resource-deserialize/utils/Decorator.d.ts +11 -0
- package/types/loader/src/resource-deserialize/utils/FileHeader.d.ts +9 -0
- package/types/loader/src/resource-deserialize/utils/Utils.d.ts +5 -0
- package/types/prefab/PrefabParserContext.d.ts +6 -0
- package/types/prefab/index.d.ts +3 -0
- package/types/resource-deserialize/resources/animationClip/ComponentMap.d.ts +2 -0
- package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
- package/types/resource-deserialize/resources/parser/PrefabParserContext.d.ts +5 -0
- package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +70 -0
- package/types/resource-deserialize/resources/prefab/ReflectionParser.d.ts +14 -0
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AssetPromise, ContentRestorer, Texture2D } from "@galacean/engine-core";
|
|
2
|
+
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class Texture2DContentRestorer extends ContentRestorer<Texture2D> {
|
|
7
|
+
url: string;
|
|
8
|
+
requestConfig: RequestConfig;
|
|
9
|
+
constructor(resource: Texture2D, url: string, requestConfig: RequestConfig);
|
|
10
|
+
restoreContent(): AssetPromise<Texture2D>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TextureFilterMode, TextureFormat, TextureWrapMode } from "@galacean/engine-core";
|
|
2
|
+
/**
|
|
3
|
+
* Texture2D loader params interface.
|
|
4
|
+
*/
|
|
5
|
+
export interface Texture2DParams {
|
|
6
|
+
/** Texture format. default `TextureFormat.R8G8B8A8` */
|
|
7
|
+
format: TextureFormat;
|
|
8
|
+
/** Whether to use multi-level texture, default is true. */
|
|
9
|
+
mipmap: boolean;
|
|
10
|
+
/** Wrapping mode for texture coordinate S. */
|
|
11
|
+
wrapModeU: TextureWrapMode;
|
|
12
|
+
/** Wrapping mode for texture coordinate T. */
|
|
13
|
+
wrapModeV: TextureWrapMode;
|
|
14
|
+
/** Filter mode for texture. */
|
|
15
|
+
filterMode: TextureFilterMode;
|
|
16
|
+
/** Anisotropic level for texture. */
|
|
17
|
+
anisoLevel: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AssetPromise, ContentRestorer, TextureCube } from "@galacean/engine-core";
|
|
2
|
+
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class TextureCubeContentRestorer extends ContentRestorer<TextureCube> {
|
|
7
|
+
urls: string[];
|
|
8
|
+
requestConfig: RequestConfig;
|
|
9
|
+
constructor(resource: TextureCube, urls: string[], requestConfig: RequestConfig);
|
|
10
|
+
restoreContent(): AssetPromise<TextureCube>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ported from https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.khronosTextureContainer.ts
|
|
4
|
+
*/
|
|
5
|
+
import { KTXContainer } from "./type";
|
|
6
|
+
/**
|
|
7
|
+
* for description see https://www.khronos.org/opengles/sdk/tools/KTX/
|
|
8
|
+
* for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
|
|
9
|
+
*/
|
|
10
|
+
export declare const khronosTextureContainerParser: {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param buffer contents of the KTX container file
|
|
14
|
+
* @param facesExpected should be either 1 or 6, based whether a cube texture or or
|
|
15
|
+
* @param threeDExpected provision for indicating that data should be a 3D texture, not implemented
|
|
16
|
+
* @param textureArrayExpected provision for indicating that data should be a texture array, not implemented
|
|
17
|
+
* @param mapEngineFormat get Galacean Engine native TextureFormat?
|
|
18
|
+
*/
|
|
19
|
+
parse(buffer: ArrayBuffer, facesExpected: number, withMipmaps: boolean, mapEngineFormat?: boolean): KTXContainer;
|
|
20
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { TextureFormat } from "@galacean/engine-core";
|
|
2
|
+
import { GLCompressedTextureInternalFormat } from "@galacean/engine-rhi-webgl";
|
|
3
|
+
export type CompressedTextureData = {
|
|
4
|
+
internalFormat: GLCompressedTextureInternalFormat;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
mipmaps: Mipmap[];
|
|
8
|
+
engineFormat: TextureFormat;
|
|
9
|
+
};
|
|
10
|
+
export type CompressedCubeData = {
|
|
11
|
+
engineFormat: TextureFormat;
|
|
12
|
+
internalFormat: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
mipmapsFaces: Mipmap[][];
|
|
16
|
+
};
|
|
17
|
+
export type Mipmap = {
|
|
18
|
+
data: ArrayBufferView;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
22
|
+
export type KTXContainer = {
|
|
23
|
+
/**
|
|
24
|
+
* origin buffer data
|
|
25
|
+
*/
|
|
26
|
+
buffer: ArrayBuffer;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the openGL type
|
|
29
|
+
*/
|
|
30
|
+
glType: number;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the openGL type size
|
|
33
|
+
*/
|
|
34
|
+
glTypeSize: number;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the openGL format
|
|
37
|
+
*/
|
|
38
|
+
glFormat: number;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the openGL internal format
|
|
41
|
+
*/
|
|
42
|
+
glInternalFormat: number;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the base internal format
|
|
45
|
+
*/
|
|
46
|
+
glBaseInternalFormat: GLCompressedTextureInternalFormat;
|
|
47
|
+
/**
|
|
48
|
+
* Gets image width in pixel
|
|
49
|
+
*/
|
|
50
|
+
pixelWidth: number;
|
|
51
|
+
/**
|
|
52
|
+
* Gets image height in pixel
|
|
53
|
+
*/
|
|
54
|
+
pixelHeight: number;
|
|
55
|
+
/**
|
|
56
|
+
* Gets image depth in pixels
|
|
57
|
+
*/
|
|
58
|
+
pixelDepth: number;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the number of array elements
|
|
61
|
+
*/
|
|
62
|
+
numberOfArrayElements: number;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the number of faces
|
|
65
|
+
*/
|
|
66
|
+
numberOfFaces: number;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the number of mipmap levels
|
|
69
|
+
*/
|
|
70
|
+
numberOfMipmapLevels: number;
|
|
71
|
+
/**
|
|
72
|
+
* Gets the bytes of key value data
|
|
73
|
+
*/
|
|
74
|
+
bytesOfKeyValueData: number;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the load type
|
|
77
|
+
*/
|
|
78
|
+
loadType: number;
|
|
79
|
+
/**
|
|
80
|
+
* parsed mipmap data
|
|
81
|
+
*/
|
|
82
|
+
mipmaps?: Mipmap[];
|
|
83
|
+
/**
|
|
84
|
+
* Galacean Engine native TextureFormat
|
|
85
|
+
*/
|
|
86
|
+
engineFormat?: TextureFormat;
|
|
87
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AnimationClip, Camera, Engine, Entity, Light, Material, ModelMesh, ReferResource, Skin, Texture2D } from "@galacean/engine-core";
|
|
2
|
+
/**
|
|
3
|
+
* Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
|
|
4
|
+
*/
|
|
5
|
+
export declare class GLTFResource extends ReferResource {
|
|
6
|
+
/** glTF file url. */
|
|
7
|
+
readonly url: string;
|
|
8
|
+
/** Texture2D after TextureParser. */
|
|
9
|
+
readonly textures?: Texture2D[];
|
|
10
|
+
/** Material after MaterialParser. */
|
|
11
|
+
readonly materials?: Material[];
|
|
12
|
+
/** ModelMesh after MeshParser. */
|
|
13
|
+
readonly meshes?: ModelMesh[][];
|
|
14
|
+
/** Skin after SkinParser. */
|
|
15
|
+
readonly skins?: Skin[];
|
|
16
|
+
/** AnimationClip after AnimationParser. */
|
|
17
|
+
readonly animations?: AnimationClip[];
|
|
18
|
+
/** @internal */
|
|
19
|
+
_defaultSceneRoot: Entity;
|
|
20
|
+
/** @internal */
|
|
21
|
+
_sceneRoots: Entity[];
|
|
22
|
+
/** @internal */
|
|
23
|
+
_extensionsData: Record<string, any>;
|
|
24
|
+
/**
|
|
25
|
+
* Extensions data.
|
|
26
|
+
*/
|
|
27
|
+
get extensionsData(): Record<string, any>;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
constructor(engine: Engine, url: string);
|
|
32
|
+
/**
|
|
33
|
+
* Instantiate scene root entity.
|
|
34
|
+
* @param sceneIndex - Scene index
|
|
35
|
+
* @returns Root entity
|
|
36
|
+
*/
|
|
37
|
+
instantiateSceneRoot(sceneIndex?: number): Entity;
|
|
38
|
+
protected _onDestroy(): void;
|
|
39
|
+
private _disassociationSuperResource;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
* Entity after EntityParser.
|
|
43
|
+
*/
|
|
44
|
+
entities: Entity[];
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
* Camera after SceneParser.
|
|
48
|
+
*/
|
|
49
|
+
cameras?: Camera[];
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated
|
|
52
|
+
* Export lights in extension KHR_lights_punctual.
|
|
53
|
+
*/
|
|
54
|
+
lights?: Light[];
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated Please use `instantiateSceneRoot` instead.
|
|
57
|
+
* RootEntities after SceneParser.
|
|
58
|
+
*/
|
|
59
|
+
get sceneRoots(): Entity[];
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Please use `instantiateSceneRoot` instead.
|
|
62
|
+
* RootEntity after SceneParser.
|
|
63
|
+
*/
|
|
64
|
+
get defaultSceneRoot(): Entity;
|
|
65
|
+
}
|