@galacean/engine-loader 1.0.4 → 1.0.5
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 +5 -5
- package/types/gltf/GLTFUtil.d.ts +1 -1
- package/types/ktx2/KTX2Loader.d.ts +16 -5
- package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +4 -4
- package/types/PrefabLoader.d.ts +0 -6
- package/types/gltf/extensions/EXT_meshopt_compression.d.ts +0 -1
- package/types/gltf/extensions/MeshoptDecoder.d.ts +0 -12
- package/types/ktx2/KTX2Parser.d.ts +0 -4
- package/types/ktx2/TargetFormat.d.ts +0 -8
- package/types/resource-deserialize/resources/parser/HierarchyParser.d.ts +0 -43
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +0 -26
- package/types/resource-deserialize/resources/parser/PrefabParserContext.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-
|
|
19
|
-
"@galacean/engine-
|
|
20
|
-
"@galacean/engine-
|
|
21
|
-
"@galacean/engine-
|
|
18
|
+
"@galacean/engine-rhi-webgl": "1.0.5",
|
|
19
|
+
"@galacean/engine-core": "1.0.5",
|
|
20
|
+
"@galacean/engine-draco": "1.0.5",
|
|
21
|
+
"@galacean/engine-math": "1.0.5"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/gltf/GLTFUtil.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare class GLTFUtil {
|
|
|
21
21
|
/**
|
|
22
22
|
* Get the TypedArray corresponding to the component type.
|
|
23
23
|
*/
|
|
24
|
-
static getComponentType(componentType: AccessorComponentType):
|
|
24
|
+
static getComponentType(componentType: AccessorComponentType): Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor;
|
|
25
25
|
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
26
26
|
static getAccessorBuffer(context: ParserContext, gltf: IGLTF, accessor: IAccessor): BufferInfo;
|
|
27
27
|
/**
|
|
@@ -5,6 +5,7 @@ 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
|
* Destroy ktx2 transcoder worker.
|
|
@@ -24,30 +25,40 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
24
25
|
private static _getBinomialLLCTranscoder;
|
|
25
26
|
private static _getKhronosTranscoder;
|
|
26
27
|
private static _getEngineTextureFormat;
|
|
27
|
-
initialize(
|
|
28
|
+
initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
28
29
|
/**
|
|
29
30
|
* @internal
|
|
30
31
|
*/
|
|
31
32
|
load(item: LoadItem & {
|
|
32
33
|
params?: KTX2Params;
|
|
33
34
|
}, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
|
|
34
|
-
private _isKhronosSupported;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* KTX2 loader params interface.
|
|
38
38
|
*/
|
|
39
39
|
export interface KTX2Params {
|
|
40
|
-
/** Priority transcoding format queue, default is ASTC/ETC/
|
|
40
|
+
/** Priority transcoding format queue which is preferred options, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
|
|
41
|
+
/** @deprecated */
|
|
41
42
|
priorityFormats: KTX2TargetFormat[];
|
|
42
43
|
}
|
|
44
|
+
/** Used for initialize KTX2 transcoder. */
|
|
45
|
+
export declare enum KTX2Transcoder {
|
|
46
|
+
/** BinomialLLC transcoder. */
|
|
47
|
+
BinomialLLC = 0,
|
|
48
|
+
/** Khronos transcoder. */
|
|
49
|
+
Khronos = 1
|
|
50
|
+
}
|
|
43
51
|
declare module "@galacean/engine-core" {
|
|
44
52
|
interface EngineConfiguration {
|
|
45
53
|
/** KTX2 loader options. */
|
|
46
54
|
ktx2Loader?: {
|
|
47
55
|
/** Worker count for transcoder, default is 4. */
|
|
48
56
|
workerCount?: number;
|
|
49
|
-
/**
|
|
50
|
-
|
|
57
|
+
/** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
|
|
58
|
+
/** @deprecated */
|
|
59
|
+
priorityFormats?: KTX2TargetFormat[];
|
|
60
|
+
/** Used for initialize KTX2 transcoder, default is BinomialLLC. */
|
|
61
|
+
transcoder?: KTX2Transcoder;
|
|
51
62
|
};
|
|
52
63
|
}
|
|
53
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BackgroundMode } from "@galacean/engine-core";
|
|
2
|
-
import {
|
|
2
|
+
import { IRefObject } from "@galacean/engine-core/types/asset/IRefObject";
|
|
3
3
|
import { IColor } from "../mesh/IModelMesh";
|
|
4
4
|
export interface IPrefabFile {
|
|
5
5
|
entities: Array<IEntity>;
|
|
@@ -9,11 +9,11 @@ export interface IScene extends IPrefabFile {
|
|
|
9
9
|
background: {
|
|
10
10
|
mode: BackgroundMode;
|
|
11
11
|
color: IColor;
|
|
12
|
-
texture?:
|
|
13
|
-
sky?:
|
|
12
|
+
texture?: IRefObject;
|
|
13
|
+
sky?: IRefObject;
|
|
14
14
|
};
|
|
15
15
|
ambient: {
|
|
16
|
-
ambientLight:
|
|
16
|
+
ambientLight: IRefObject;
|
|
17
17
|
diffuseSolidColor: IColor;
|
|
18
18
|
diffuseIntensity: number;
|
|
19
19
|
specularIntensity: number;
|
package/types/PrefabLoader.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const MeshoptDecoder: {
|
|
2
|
-
ready: Promise<void>;
|
|
3
|
-
supported: boolean;
|
|
4
|
-
useWorkers: (count: any) => void;
|
|
5
|
-
decodeVertexBuffer: (target: any, count: any, size: any, source: any, filter: any) => void;
|
|
6
|
-
decodeIndexBuffer: (target: any, count: any, size: any, source: any) => void;
|
|
7
|
-
decodeIndexSequence: (target: any, count: any, size: any, source: any) => void;
|
|
8
|
-
decodeGltfBuffer: (target: any, count: any, size: any, source: any, mode: any, filter: any) => void;
|
|
9
|
-
decodeGltfBufferAsync: (count: number, stride: number, source: Uint8Array, mode: any, filter: any) => Promise<Uint8Array>;
|
|
10
|
-
release(): void;
|
|
11
|
-
};
|
|
12
|
-
export { MeshoptDecoder };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Entity, Engine, Scene } from "@galacean/engine-core";
|
|
2
|
-
import type { IPrefabFile } from "../schema";
|
|
3
|
-
import { ParserContext } from "./ParserContext";
|
|
4
|
-
/**
|
|
5
|
-
* HierarchyParser parser.
|
|
6
|
-
* Any HierarchyParser parser should extends this class, like scene parser, prefab parser, etc.
|
|
7
|
-
* @export
|
|
8
|
-
* @abstract
|
|
9
|
-
* @class HierarchyParserParser
|
|
10
|
-
* @template T
|
|
11
|
-
*/
|
|
12
|
-
export default abstract class HierarchyParser<T extends Scene | Entity> {
|
|
13
|
-
readonly context: ParserContext<T, IPrefabFile>;
|
|
14
|
-
/**
|
|
15
|
-
* The promise of parsed object.
|
|
16
|
-
*/
|
|
17
|
-
readonly promise: Promise<T>;
|
|
18
|
-
protected _engine: Engine;
|
|
19
|
-
protected _resolve: (prefab: T) => void;
|
|
20
|
-
protected _reject: (reason: any) => void;
|
|
21
|
-
private childrenContextMap;
|
|
22
|
-
constructor(context: ParserContext<T, IPrefabFile>);
|
|
23
|
-
/** start parse the scene or prefab or others */
|
|
24
|
-
start(): void;
|
|
25
|
-
/**
|
|
26
|
-
* Append child entity to target.
|
|
27
|
-
* @abstract
|
|
28
|
-
* @param {Entity} entity
|
|
29
|
-
* @memberof ParserContext
|
|
30
|
-
*/
|
|
31
|
-
protected abstract appendChild(entity: Entity): void;
|
|
32
|
-
private _parseEntities;
|
|
33
|
-
private _parseComponents;
|
|
34
|
-
private _parsePrefabModification;
|
|
35
|
-
private _clearAndResolve;
|
|
36
|
-
private _organizeEntities;
|
|
37
|
-
private _getEntityByConfig;
|
|
38
|
-
private _parseEntity;
|
|
39
|
-
private _parseGLTF;
|
|
40
|
-
private _parsePrefab;
|
|
41
|
-
private _parseChildren;
|
|
42
|
-
private _applyEntityData;
|
|
43
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component, Entity } from "@galacean/engine-core";
|
|
2
|
-
import type { IEntity } from "../schema";
|
|
3
|
-
/**
|
|
4
|
-
* Parser context
|
|
5
|
-
* @export
|
|
6
|
-
* @abstract
|
|
7
|
-
* @class ParserContext
|
|
8
|
-
* @template T
|
|
9
|
-
* @template I
|
|
10
|
-
*/
|
|
11
|
-
export declare abstract class ParserContext<T, I> {
|
|
12
|
-
readonly originalData: I;
|
|
13
|
-
readonly target: T;
|
|
14
|
-
entityMap: Map<string, Entity>;
|
|
15
|
-
components: Map<string, Component>;
|
|
16
|
-
assets: Map<string, any>;
|
|
17
|
-
entityConfigMap: Map<string, IEntity>;
|
|
18
|
-
rootIds: string[];
|
|
19
|
-
constructor(originalData: I, target: T);
|
|
20
|
-
/**
|
|
21
|
-
* Destroy the context.
|
|
22
|
-
* @abstract
|
|
23
|
-
* @memberof ParserContext
|
|
24
|
-
*/
|
|
25
|
-
destroy(): void;
|
|
26
|
-
}
|