@galacean/engine-loader 1.1.0-beta.9 → 1.2.0-alpha.1
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 +863 -487
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +862 -487
- package/dist/module.js +852 -477
- package/dist/module.js.map +1 -1
- package/package.json +4 -5
- package/types/GLTFLoader.d.ts +8 -1
- package/types/Texture2DLoader.d.ts +9 -1
- package/types/gltf/GLTFResource.d.ts +50 -16
- package/types/gltf/GLTFSchema.d.ts +1 -1
- package/types/gltf/GLTFUtils.d.ts +1 -1
- package/types/gltf/extensions/EXT_meshopt_compression.d.ts +13 -0
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +1 -1
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +18 -10
- package/types/gltf/extensions/KHR_materials_anisotropy.d.ts +1 -0
- package/types/gltf/extensions/MeshoptDecoder.d.ts +8 -0
- package/types/gltf/extensions/index.d.ts +2 -1
- package/types/gltf/index.d.ts +2 -1
- package/types/gltf/parser/GLTFBufferViewParser.d.ts +5 -0
- package/types/gltf/parser/GLTFParser.d.ts +1 -1
- package/types/gltf/parser/GLTFParserContext.d.ts +24 -8
- package/types/gltf/parser/GLTFSceneParser.d.ts +0 -1
- package/types/gltf/parser/index.d.ts +2 -1
- package/types/index.d.ts +2 -1
- package/types/ktx2/KTX2Loader.d.ts +20 -8
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +1 -1
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +2 -0
- package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +1 -1
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +3 -1
- package/types/resource-deserialize/utils/BufferReader.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-
|
|
19
|
-
"@galacean/engine-
|
|
20
|
-
"@galacean/engine-
|
|
21
|
-
"@galacean/engine-math": "1.1.0-beta.9"
|
|
18
|
+
"@galacean/engine-core": "1.2.0-alpha.1",
|
|
19
|
+
"@galacean/engine-math": "1.2.0-alpha.1",
|
|
20
|
+
"@galacean/engine-rhi-webgl": "1.2.0-alpha.1"
|
|
22
21
|
},
|
|
23
22
|
"scripts": {
|
|
24
23
|
"b:types": "tsc"
|
package/types/GLTFLoader.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, Engine, EngineConfiguration, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
3
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>;
|
|
4
10
|
load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<GLTFResource>;
|
|
5
11
|
}
|
|
6
12
|
/**
|
|
@@ -12,4 +18,5 @@ export interface GLTFParams {
|
|
|
12
18
|
* Keep raw mesh data for glTF parser, default is false.
|
|
13
19
|
*/
|
|
14
20
|
keepMeshData?: boolean;
|
|
21
|
+
[key: string]: any;
|
|
15
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextureFormat } from "@galacean/engine-core";
|
|
1
|
+
import { TextureFilterMode, TextureFormat, TextureWrapMode } from "@galacean/engine-core";
|
|
2
2
|
/**
|
|
3
3
|
* Texture2D loader params interface.
|
|
4
4
|
*/
|
|
@@ -7,4 +7,12 @@ export interface Texture2DParams {
|
|
|
7
7
|
format: TextureFormat;
|
|
8
8
|
/** Whether to use multi-level texture, default is true. */
|
|
9
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;
|
|
10
18
|
}
|
|
@@ -4,28 +4,62 @@ import { AnimationClip, Camera, Engine, Entity, Light, Material, ModelMesh, Refe
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class GLTFResource extends ReferResource {
|
|
6
6
|
/** glTF file url. */
|
|
7
|
-
url: string;
|
|
7
|
+
readonly url: string;
|
|
8
8
|
/** Texture2D after TextureParser. */
|
|
9
|
-
textures?: Texture2D[];
|
|
9
|
+
readonly textures?: Texture2D[];
|
|
10
10
|
/** Material after MaterialParser. */
|
|
11
|
-
materials?: Material[];
|
|
11
|
+
readonly materials?: Material[];
|
|
12
12
|
/** ModelMesh after MeshParser. */
|
|
13
|
-
meshes?: ModelMesh[][];
|
|
13
|
+
readonly meshes?: ModelMesh[][];
|
|
14
14
|
/** Skin after SkinParser. */
|
|
15
|
-
skins?: Skin[];
|
|
15
|
+
readonly skins?: Skin[];
|
|
16
16
|
/** AnimationClip after AnimationParser. */
|
|
17
|
-
animations?: AnimationClip[];
|
|
18
|
-
/**
|
|
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
|
+
*/
|
|
19
44
|
entities: Entity[];
|
|
20
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
* Camera after SceneParser.
|
|
48
|
+
*/
|
|
21
49
|
cameras?: Camera[];
|
|
22
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated
|
|
52
|
+
* Export lights in extension KHR_lights_punctual.
|
|
53
|
+
*/
|
|
23
54
|
lights?: Light[];
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
31
65
|
}
|
|
@@ -30,7 +30,7 @@ export declare class GLTFUtils {
|
|
|
30
30
|
/**
|
|
31
31
|
* Get accessor data.
|
|
32
32
|
*/
|
|
33
|
-
static processingSparseData(
|
|
33
|
+
static processingSparseData(context: GLTFParserContext, accessor: IAccessor, bufferInfo: BufferInfo): Promise<void>;
|
|
34
34
|
static getIndexFormat(type: AccessorComponentType): IndexFormat;
|
|
35
35
|
static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat;
|
|
36
36
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare module "@galacean/engine-core" {
|
|
2
|
+
interface EngineConfiguration {
|
|
3
|
+
/** glTF loader options. */
|
|
4
|
+
glTF?: {
|
|
5
|
+
/** Meshopt options. If set this option and workCount is great than 0, workers will be created. */
|
|
6
|
+
meshOpt?: {
|
|
7
|
+
/** Worker count for transcoder, default is 4. */
|
|
8
|
+
workerCount: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -19,7 +19,7 @@ export declare abstract class GLTFExtensionParser {
|
|
|
19
19
|
* @param extensionOwnerSchema - The extension owner schema
|
|
20
20
|
* @returns The resource or promise
|
|
21
21
|
*/
|
|
22
|
-
createAndParse(context: GLTFParserContext, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | Promise<EngineObject>;
|
|
22
|
+
createAndParse(context: GLTFParserContext, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | Promise<EngineObject | Uint8Array>;
|
|
23
23
|
/**
|
|
24
24
|
* Additive parse to the resource.
|
|
25
25
|
* @param context - The parser context
|
|
@@ -18,15 +18,6 @@ export interface IKHRLightsPunctual_Light {
|
|
|
18
18
|
export interface IKHRLightsPunctual {
|
|
19
19
|
lights: IKHRLightsPunctual_Light[];
|
|
20
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
21
|
/**
|
|
31
22
|
* Interfaces from the KHR_materials_clearcoat extension
|
|
32
23
|
*/
|
|
@@ -105,6 +96,14 @@ export interface IKHRMaterialVariants_Variant {
|
|
|
105
96
|
extensions?: any;
|
|
106
97
|
extras?: any;
|
|
107
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Interfaces from the KHR_materials_clearcoat extension
|
|
101
|
+
*/
|
|
102
|
+
export interface IKHRMaterialsAnisotropy {
|
|
103
|
+
anisotropyStrength: number;
|
|
104
|
+
anisotropyRotation: number;
|
|
105
|
+
anisotropyTexture: ITextureInfo;
|
|
106
|
+
}
|
|
108
107
|
export interface IKHRMaterialVariants_Variants {
|
|
109
108
|
variants: Array<IKHRMaterialVariants_Variant>;
|
|
110
109
|
}
|
|
@@ -134,6 +133,15 @@ export interface IKHRXmp {
|
|
|
134
133
|
export interface IKHRXmp_Node {
|
|
135
134
|
packet: number;
|
|
136
135
|
}
|
|
136
|
+
export interface IEXTMeshoptCompressionSchema {
|
|
137
|
+
buffer: number;
|
|
138
|
+
byteOffset?: number;
|
|
139
|
+
byteLength: number;
|
|
140
|
+
byteStride: number;
|
|
141
|
+
mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES";
|
|
142
|
+
count: number;
|
|
143
|
+
filter?: "NONE" | "OCTAHEDRAL" | "QUATERNION" | "EXPONENTIAL";
|
|
144
|
+
}
|
|
137
145
|
export interface IGalaceanMaterialRemap {
|
|
138
146
|
refId: string;
|
|
139
147
|
key?: string;
|
|
@@ -146,4 +154,4 @@ export interface IGalaceanAnimation {
|
|
|
146
154
|
parameter: any;
|
|
147
155
|
}[];
|
|
148
156
|
}
|
|
149
|
-
export type GLTFExtensionSchema = IKHRLightsPunctual_Light |
|
|
157
|
+
export type GLTFExtensionSchema = IKHRLightsPunctual_Light | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsPbrSpecularGlossiness | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRMaterialsAnisotropy | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node | IGalaceanAnimation | Object;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./KHR_draco_mesh_compression";
|
|
2
1
|
import "./KHR_lights_punctual";
|
|
3
2
|
import "./KHR_materials_clearcoat";
|
|
4
3
|
import "./KHR_materials_ior";
|
|
@@ -14,5 +13,7 @@ import "./KHR_texture_transform";
|
|
|
14
13
|
import "./KHR_materials_ior";
|
|
15
14
|
import "./GALACEAN_materials_remap";
|
|
16
15
|
import "./GALACEAN_animation_event";
|
|
16
|
+
import "./EXT_meshopt_compression";
|
|
17
|
+
import "./KHR_materials_anisotropy";
|
|
17
18
|
export { GLTFExtensionParser, GLTFExtensionMode } from "./GLTFExtensionParser";
|
|
18
19
|
export * from "./GLTFExtensionSchema";
|
package/types/gltf/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { GLTFResource } from "./GLTFResource";
|
|
|
2
2
|
export { GLTFUtils } from "./GLTFUtils";
|
|
3
3
|
export * from "./parser";
|
|
4
4
|
export * from "./extensions/index";
|
|
5
|
-
export
|
|
5
|
+
export { AccessorType } from "./GLTFSchema";
|
|
6
|
+
export type { IMaterial, IMeshPrimitive, ITextureInfo, INode, GLTFExtensionOwnerSchema, IGLTF, IMesh } from "./GLTFSchema";
|
|
@@ -17,7 +17,7 @@ export declare abstract class GLTFParser {
|
|
|
17
17
|
*/
|
|
18
18
|
static executeExtensionsCreateAndParse(extensions: {
|
|
19
19
|
[key: string]: any;
|
|
20
|
-
}, context: GLTFParserContext, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | void | Promise<EngineObject | void>;
|
|
20
|
+
}, context: GLTFParserContext, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | void | Promise<EngineObject | Uint8Array | void>;
|
|
21
21
|
/**
|
|
22
22
|
* Execute all parses of extension to parse resource.
|
|
23
23
|
* @param extensions - Related extensions field
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Buffer, Entity, ResourceManager, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { BufferDataRestoreInfo, GLTFContentRestorer } from "../../GLTFContentRestorer";
|
|
3
|
+
import { GLTFParams } from "../../GLTFLoader";
|
|
3
4
|
import { GLTFResource } from "../GLTFResource";
|
|
4
5
|
import type { IGLTF } from "../GLTFSchema";
|
|
5
6
|
import { GLTFParser } from "./GLTFParser";
|
|
@@ -9,7 +10,7 @@ import { GLTFParser } from "./GLTFParser";
|
|
|
9
10
|
export declare class GLTFParserContext {
|
|
10
11
|
glTFResource: GLTFResource;
|
|
11
12
|
resourceManager: ResourceManager;
|
|
12
|
-
|
|
13
|
+
params: GLTFParams;
|
|
13
14
|
private static readonly _parsers;
|
|
14
15
|
static addParser(parserType: GLTFParserType, parser: GLTFParser): void;
|
|
15
16
|
glTF: IGLTF;
|
|
@@ -17,7 +18,12 @@ export declare class GLTFParserContext {
|
|
|
17
18
|
contentRestorer: GLTFContentRestorer;
|
|
18
19
|
buffers?: ArrayBuffer[];
|
|
19
20
|
private _resourceCache;
|
|
20
|
-
|
|
21
|
+
private _progress;
|
|
22
|
+
/** @internal */
|
|
23
|
+
_setTaskCompleteProgress: (loaded: number, total: number) => void;
|
|
24
|
+
/** @internal */
|
|
25
|
+
_setTaskDetailProgress: (url: string, loaded: number, total: number) => void;
|
|
26
|
+
constructor(glTFResource: GLTFResource, resourceManager: ResourceManager, params: GLTFParams);
|
|
21
27
|
get<T>(type: GLTFParserType.Entity, index: number): Entity;
|
|
22
28
|
get<T>(type: GLTFParserType.Entity): Entity[];
|
|
23
29
|
get<T>(type: GLTFParserType.Schema): Promise<T>;
|
|
@@ -25,6 +31,15 @@ export declare class GLTFParserContext {
|
|
|
25
31
|
get<T>(type: GLTFParserType, index: number): Promise<T>;
|
|
26
32
|
get<T>(type: GLTFParserType): Promise<T[]>;
|
|
27
33
|
parse(): Promise<GLTFResource>;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
_onTaskDetail: (url: string, loaded: number, total: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
_addTaskCompletePromise(taskPromise: Promise<any>): void;
|
|
42
|
+
private _createAnimator;
|
|
28
43
|
private _handleSubAsset;
|
|
29
44
|
}
|
|
30
45
|
/**
|
|
@@ -44,11 +59,12 @@ export declare enum GLTFParserType {
|
|
|
44
59
|
Validator = 1,
|
|
45
60
|
Scene = 2,
|
|
46
61
|
Buffer = 3,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
BufferView = 4,
|
|
63
|
+
Texture = 5,
|
|
64
|
+
Material = 6,
|
|
65
|
+
Mesh = 7,
|
|
66
|
+
Entity = 8,
|
|
67
|
+
Skin = 9,
|
|
68
|
+
Animation = 10
|
|
53
69
|
}
|
|
54
70
|
export declare function registerGLTFParser(pipeline: GLTFParserType): (Parser: new () => GLTFParser) => void;
|
|
@@ -9,4 +9,5 @@ export { GLTFSceneParser } from "./GLTFSceneParser";
|
|
|
9
9
|
export { GLTFSkinParser } from "./GLTFSkinParser";
|
|
10
10
|
export { GLTFTextureParser } from "./GLTFTextureParser";
|
|
11
11
|
export { GLTFValidator } from "./GLTFValidator";
|
|
12
|
-
export { GLTFParserContext, GLTFParserType, registerGLTFParser } from "./GLTFParserContext";
|
|
12
|
+
export { GLTFParserContext, GLTFParserType, registerGLTFParser, BufferInfo } from "./GLTFParserContext";
|
|
13
|
+
export { GLTFBufferViewParser } from "./GLTFBufferViewParser";
|
package/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./SceneLoader";
|
|
|
22
22
|
export type { Texture2DParams } from "./Texture2DLoader";
|
|
23
23
|
export { parseSingleKTX } from "./compressed-texture";
|
|
24
24
|
export * from "./gltf";
|
|
25
|
-
export {
|
|
25
|
+
export { GLTFLoader } from "./GLTFLoader";
|
|
26
|
+
export { KTX2Loader, KTX2Transcoder } from "./ktx2/KTX2Loader";
|
|
26
27
|
export { KTX2TargetFormat } from "./ktx2/KTX2TargetFormat";
|
|
27
28
|
export * from "./resource-deserialize";
|
|
@@ -5,11 +5,13 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
5
5
|
private static _isBinomialInit;
|
|
6
6
|
private static _binomialLLCTranscoder;
|
|
7
7
|
private static _khronosTranscoder;
|
|
8
|
+
private static _priorityFormats;
|
|
8
9
|
private static _supportedMap;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Release ktx2 transcoder worker.
|
|
12
|
+
* @remarks If use loader after releasing, we should release again.
|
|
11
13
|
*/
|
|
12
|
-
static
|
|
14
|
+
static release(): void;
|
|
13
15
|
/** @internal */
|
|
14
16
|
static _parseBuffer(buffer: Uint8Array, engine: Engine, params?: KTX2Params): Promise<{
|
|
15
17
|
engine: Engine;
|
|
@@ -24,30 +26,40 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
24
26
|
private static _getBinomialLLCTranscoder;
|
|
25
27
|
private static _getKhronosTranscoder;
|
|
26
28
|
private static _getEngineTextureFormat;
|
|
27
|
-
initialize(
|
|
29
|
+
initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
28
30
|
/**
|
|
29
31
|
* @internal
|
|
30
32
|
*/
|
|
31
33
|
load(item: LoadItem & {
|
|
32
34
|
params?: KTX2Params;
|
|
33
35
|
}, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
|
|
34
|
-
private _isKhronosSupported;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* KTX2 loader params interface.
|
|
38
39
|
*/
|
|
39
40
|
export interface KTX2Params {
|
|
40
|
-
/** Priority transcoding format queue, default is ASTC/ETC/
|
|
41
|
+
/** Priority transcoding format queue which is preferred options, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
|
|
42
|
+
/** @deprecated */
|
|
41
43
|
priorityFormats: KTX2TargetFormat[];
|
|
42
44
|
}
|
|
45
|
+
/** Used for initialize KTX2 transcoder. */
|
|
46
|
+
export declare enum KTX2Transcoder {
|
|
47
|
+
/** BinomialLLC transcoder. */
|
|
48
|
+
BinomialLLC = 0,
|
|
49
|
+
/** Khronos transcoder. */
|
|
50
|
+
Khronos = 1
|
|
51
|
+
}
|
|
43
52
|
declare module "@galacean/engine-core" {
|
|
44
53
|
interface EngineConfiguration {
|
|
45
|
-
/** KTX2 loader options. */
|
|
54
|
+
/** KTX2 loader options. If set this option and workCount is great than 0, workers will be created. */
|
|
46
55
|
ktx2Loader?: {
|
|
47
56
|
/** Worker count for transcoder, default is 4. */
|
|
48
57
|
workerCount?: number;
|
|
49
|
-
/**
|
|
50
|
-
|
|
58
|
+
/** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
|
|
59
|
+
/** @deprecated */
|
|
60
|
+
priorityFormats?: KTX2TargetFormat[];
|
|
61
|
+
/** Used for initialize KTX2 transcoder, default is BinomialLLC. */
|
|
62
|
+
transcoder?: KTX2Transcoder;
|
|
51
63
|
};
|
|
52
64
|
}
|
|
53
65
|
}
|
|
@@ -10,7 +10,7 @@ export declare class ReflectionParser {
|
|
|
10
10
|
parseClassObject(item: IClassObject): Promise<any>;
|
|
11
11
|
parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">): Promise<any>;
|
|
12
12
|
parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>): Promise<any>;
|
|
13
|
-
parseBasicType(value: IBasicType): Promise<any>;
|
|
13
|
+
parseBasicType(value: IBasicType, originValue?: any): Promise<any>;
|
|
14
14
|
private _getEntityByConfig;
|
|
15
15
|
private static _isClass;
|
|
16
16
|
private static _isAssetRef;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Layer } from "@galacean/engine-core";
|
|
1
2
|
export interface IVector3 {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -33,6 +34,7 @@ export interface IBasicEntity {
|
|
|
33
34
|
scale?: IVector3;
|
|
34
35
|
children?: Array<string>;
|
|
35
36
|
parent?: string;
|
|
37
|
+
layer?: Layer;
|
|
36
38
|
}
|
|
37
39
|
export type IEntity = IBasicEntity | IRefEntity;
|
|
38
40
|
export interface IRefEntity extends IBasicEntity {
|
|
@@ -79,7 +79,7 @@ export interface IMaterialSchema {
|
|
|
79
79
|
shader: string;
|
|
80
80
|
shaderData: {
|
|
81
81
|
[key: string]: {
|
|
82
|
-
type: "Vector2" | "Vector3" | "Vector4" | "Color" | "Float" | "Texture";
|
|
82
|
+
type: "Vector2" | "Vector3" | "Vector4" | "Color" | "Float" | "Texture" | "Boolean" | "Integer";
|
|
83
83
|
value: IVector3 | IVector2 | IColor | number | IAssetRef;
|
|
84
84
|
};
|
|
85
85
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BackgroundMode, DiffuseMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
2
2
|
import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
|
|
3
|
-
import type { IColor, IPrefabFile } from "./BasicSchema";
|
|
3
|
+
import type { IColor, IPrefabFile, IVector3 } from "./BasicSchema";
|
|
4
4
|
export declare enum SpecularMode {
|
|
5
5
|
Sky = "Sky",
|
|
6
6
|
Custom = "Custom"
|
|
@@ -30,6 +30,8 @@ export interface IScene extends IPrefabFile {
|
|
|
30
30
|
shadowResolution: ShadowResolution;
|
|
31
31
|
shadowDistance: number;
|
|
32
32
|
shadowCascades: ShadowCascadesMode;
|
|
33
|
+
shadowTwoCascadeSplits: number;
|
|
34
|
+
shadowFourCascadeSplits: IVector3;
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
37
|
files: Array<{
|
|
@@ -2,7 +2,7 @@ export declare class BufferReader {
|
|
|
2
2
|
data: Uint8Array;
|
|
3
3
|
private _dataView;
|
|
4
4
|
private _littleEndian;
|
|
5
|
-
private
|
|
5
|
+
private _position;
|
|
6
6
|
private _baseOffset;
|
|
7
7
|
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
8
8
|
get position(): number;
|