@galacean/engine-loader 1.5.14 → 1.6.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 +232 -368
- package/dist/main.js.map +1 -1
- package/dist/module.js +234 -369
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +5 -14
- package/types/gltf/extensions/index.d.ts +1 -1
- package/types/gltf/parser/GLTFMaterialParser.d.ts +2 -2
- package/types/gltf/parser/GLTFParserContext.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/ktx2/KTX2Container.d.ts +6 -1
- package/types/ktx2/KTX2Loader.d.ts +0 -12
- package/types/ktx2/KTX2TargetFormat.d.ts +7 -1
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +8 -1
- package/types/resource-deserialize/resources/scene/SceneParser.d.ts +7 -8
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +8 -9
- package/types/ktx2/transcoder/KhronosTranscoder.d.ts +0 -13
- package/types/ktx2/transcoder/KhronosWorkerCode.d.ts +0 -1
- /package/types/gltf/extensions/{KHR_materials_pbrSpecularGlossiness.d.ts → KHR_materials_specular.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"libs/**/*"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@galacean/engine-math": "1.
|
|
23
|
-
"@galacean/engine-rhi-webgl": "1.
|
|
24
|
-
"@galacean/engine-core": "1.
|
|
22
|
+
"@galacean/engine-math": "1.6.0-alpha.1",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "1.6.0-alpha.1",
|
|
24
|
+
"@galacean/engine-core": "1.6.0-alpha.1"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -39,16 +39,6 @@ export interface IKHRMaterialsIor {
|
|
|
39
39
|
*/
|
|
40
40
|
export interface IKHRMaterialsUnlit {
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Interfaces from the KHR_materials_pbrSpecularGlossiness extension
|
|
44
|
-
*/
|
|
45
|
-
export interface IKHRMaterialsPbrSpecularGlossiness {
|
|
46
|
-
diffuseFactor: number[];
|
|
47
|
-
diffuseTexture: ITextureInfo;
|
|
48
|
-
specularFactor: number[];
|
|
49
|
-
glossinessFactor: number;
|
|
50
|
-
specularGlossinessTexture: ITextureInfo;
|
|
51
|
-
}
|
|
52
42
|
/**
|
|
53
43
|
* Interfaces from the KHR_materials_sheen extension
|
|
54
44
|
*/
|
|
@@ -62,9 +52,10 @@ export interface IKHRMaterialsSheen {
|
|
|
62
52
|
* Interfaces from the KHR_materials_specular extension
|
|
63
53
|
*/
|
|
64
54
|
export interface IKHRMaterialsSpecular {
|
|
65
|
-
specularFactor
|
|
66
|
-
specularColorFactor
|
|
67
|
-
specularTexture
|
|
55
|
+
specularFactor?: number;
|
|
56
|
+
specularColorFactor?: number[];
|
|
57
|
+
specularTexture?: ITextureInfo;
|
|
58
|
+
specularColorTexture?: ITextureInfo;
|
|
68
59
|
}
|
|
69
60
|
/**
|
|
70
61
|
* Interfaces from the KHR_materials_transmission extension
|
|
@@ -174,4 +165,4 @@ export interface IKHRMaterialsVolume {
|
|
|
174
165
|
attenuationDistance?: number;
|
|
175
166
|
attenuationColor?: number[];
|
|
176
167
|
}
|
|
177
|
-
export type GLTFExtensionSchema = IKHRLightsPunctual_Light | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit |
|
|
168
|
+
export type GLTFExtensionSchema = IKHRLightsPunctual_Light | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRMaterialsAnisotropy | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node | IGalaceanAnimation | IKHRMaterialsIridescence | IKHRMaterialsVolume | Object;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "./KHR_lights_punctual";
|
|
2
2
|
import "./KHR_materials_clearcoat";
|
|
3
3
|
import "./KHR_materials_ior";
|
|
4
|
-
import "./KHR_materials_pbrSpecularGlossiness";
|
|
5
4
|
import "./KHR_materials_sheen";
|
|
6
5
|
import "./KHR_materials_transmission";
|
|
7
6
|
import "./KHR_materials_unlit";
|
|
@@ -16,6 +15,7 @@ import "./GALACEAN_animation_event";
|
|
|
16
15
|
import "./EXT_meshopt_compression";
|
|
17
16
|
import "./KHR_materials_anisotropy";
|
|
18
17
|
import "./KHR_materials_iridescence";
|
|
18
|
+
import "./KHR_materials_specular";
|
|
19
19
|
import "./EXT_texture_webp";
|
|
20
20
|
export { GLTFExtensionParser, GLTFExtensionMode } from "./GLTFExtensionParser";
|
|
21
21
|
export * from "./GLTFExtensionSchema";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise, Material, PBRMaterial,
|
|
1
|
+
import { AssetPromise, Material, PBRMaterial, UnlitMaterial } from "@galacean/engine-core";
|
|
2
2
|
import { IMaterial, ITextureInfo } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
@@ -10,6 +10,6 @@ export declare class GLTFMaterialParser extends GLTFParser {
|
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
static _parseStandardProperty(context: GLTFParserContext, material: UnlitMaterial | PBRMaterial
|
|
13
|
+
static _parseStandardProperty(context: GLTFParserContext, material: UnlitMaterial | PBRMaterial, materialInfo: IMaterial): void;
|
|
14
14
|
parse(context: GLTFParserContext, index: number): AssetPromise<Material>;
|
|
15
15
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export * from "./SceneLoader";
|
|
|
29
29
|
export type { Texture2DParams } from "./Texture2DLoader";
|
|
30
30
|
export { parseSingleKTX } from "./compressed-texture";
|
|
31
31
|
export * from "./gltf";
|
|
32
|
-
export { KTX2Loader
|
|
32
|
+
export { KTX2Loader } from "./ktx2/KTX2Loader";
|
|
33
33
|
export { KTX2TargetFormat } from "./ktx2/KTX2TargetFormat";
|
|
34
34
|
export * from "./resource-deserialize";
|
|
35
35
|
export * from "./prefab/PrefabResource";
|
|
@@ -2,6 +2,11 @@ export declare enum DFDTransferFunction {
|
|
|
2
2
|
linear = 1,
|
|
3
3
|
sRGB = 2
|
|
4
4
|
}
|
|
5
|
+
export declare enum ColorModel {
|
|
6
|
+
ETC1S = 163,
|
|
7
|
+
UASTC_LDR_4X4 = 166,
|
|
8
|
+
UASTC_HDR_4X4 = 167
|
|
9
|
+
}
|
|
5
10
|
export declare enum SupercompressionScheme {
|
|
6
11
|
None = 0,
|
|
7
12
|
BasisLZ = 1,
|
|
@@ -26,7 +31,7 @@ export declare class KTX2Container {
|
|
|
26
31
|
globalData: KTX2GlobalDataBasisLZ | null;
|
|
27
32
|
constructor(buffer: Uint8Array);
|
|
28
33
|
get isSRGB(): boolean;
|
|
29
|
-
get
|
|
34
|
+
get colorModel(): ColorModel;
|
|
30
35
|
private parse;
|
|
31
36
|
}
|
|
32
37
|
interface KTX2Level {
|
|
@@ -3,9 +3,7 @@ import { KTX2Container } from "./KTX2Container";
|
|
|
3
3
|
import { KTX2TargetFormat } from "./KTX2TargetFormat";
|
|
4
4
|
import { TranscodeResult } from "./transcoder/AbstractTranscoder";
|
|
5
5
|
export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
6
|
-
private static _isBinomialInit;
|
|
7
6
|
private static _binomialLLCTranscoder;
|
|
8
|
-
private static _khronosTranscoder;
|
|
9
7
|
private static _priorityFormats;
|
|
10
8
|
private static _capabilityMap;
|
|
11
9
|
/**
|
|
@@ -26,7 +24,6 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
26
24
|
private static _decideTargetFormat;
|
|
27
25
|
private static _detectSupportedFormat;
|
|
28
26
|
private static _getBinomialLLCTranscoder;
|
|
29
|
-
private static _getKhronosTranscoder;
|
|
30
27
|
private static _getEngineTextureFormat;
|
|
31
28
|
initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
32
29
|
/**
|
|
@@ -44,13 +41,6 @@ export interface KTX2Params {
|
|
|
44
41
|
/** @deprecated */
|
|
45
42
|
priorityFormats: KTX2TargetFormat[];
|
|
46
43
|
}
|
|
47
|
-
/** Used for initialize KTX2 transcoder. */
|
|
48
|
-
export declare enum KTX2Transcoder {
|
|
49
|
-
/** BinomialLLC transcoder. */
|
|
50
|
-
BinomialLLC = 0,
|
|
51
|
-
/** Khronos transcoder. */
|
|
52
|
-
Khronos = 1
|
|
53
|
-
}
|
|
54
44
|
declare module "@galacean/engine-core" {
|
|
55
45
|
interface EngineConfiguration {
|
|
56
46
|
/** KTX2 loader options. If set this option and workCount is great than 0, workers will be created. */
|
|
@@ -60,8 +50,6 @@ declare module "@galacean/engine-core" {
|
|
|
60
50
|
/** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
|
|
61
51
|
/** @deprecated */
|
|
62
52
|
priorityFormats?: KTX2TargetFormat[];
|
|
63
|
-
/** Used for initialize KTX2 transcoder, default is BinomialLLC. */
|
|
64
|
-
transcoder?: KTX2Transcoder;
|
|
65
53
|
};
|
|
66
54
|
}
|
|
67
55
|
}
|
|
@@ -17,5 +17,11 @@ export declare enum KTX2TargetFormat {
|
|
|
17
17
|
/** RG format, 16 bits per pixel. */
|
|
18
18
|
R8G8 = 6,
|
|
19
19
|
/** RGBA format, 32 bits per pixel. */
|
|
20
|
-
R8G8B8A8 = 7
|
|
20
|
+
R8G8B8A8 = 7,
|
|
21
|
+
/** RGB HDR compressed format, 8 bits per pixel. */
|
|
22
|
+
BC6H = 8,
|
|
23
|
+
/** HDR RGB(A) compressed format, 128 bits per 4x4 pixel block (currently UASTC HDR 4x4 encoders are only RGB). */
|
|
24
|
+
ASTC_HDR_4x4 = 9,
|
|
25
|
+
/** RGBA format, 16 bits per channel. */
|
|
26
|
+
R16G16B16A16 = 10
|
|
21
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Engine, EngineObject, Entity, ReferResource, ResourceManager, Scene } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, Component, Engine, EngineObject, Entity, ReferResource, ResourceManager, Scene } from "@galacean/engine-core";
|
|
2
2
|
import type { IEntity, IHierarchyFile } from "../schema";
|
|
3
3
|
export declare enum ParserType {
|
|
4
4
|
Prefab = 0,
|
|
@@ -18,6 +18,13 @@ export declare class ParserContext<T extends IHierarchyFile, I extends EngineObj
|
|
|
18
18
|
rootIds: string[];
|
|
19
19
|
strippedIds: string[];
|
|
20
20
|
readonly resourceManager: ResourceManager;
|
|
21
|
+
private _tasks;
|
|
22
|
+
private _loaded;
|
|
23
|
+
private _total;
|
|
21
24
|
constructor(engine: Engine, type: ParserType, resource: ReferResource | Scene);
|
|
22
25
|
clear(): void;
|
|
26
|
+
/** @internal */
|
|
27
|
+
_setTaskCompleteProgress: (loaded: number, total: number) => void;
|
|
28
|
+
/** @internal */
|
|
29
|
+
_addDependentAsset(refID: string, promise: AssetPromise<any>): void;
|
|
23
30
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IScene } from "../schema";
|
|
1
|
+
import { Scene } from "@galacean/engine-core";
|
|
3
2
|
import { HierarchyParser } from "../parser/HierarchyParser";
|
|
4
3
|
import { ParserContext } from "../parser/ParserContext";
|
|
4
|
+
import { type IScene } from "../schema";
|
|
5
5
|
/** @Internal */
|
|
6
6
|
export declare class SceneParser extends HierarchyParser<Scene, ParserContext<IScene, Scene>> {
|
|
7
7
|
readonly scene: Scene;
|
|
8
|
+
constructor(data: IScene, context: ParserContext<IScene, Scene>, scene: Scene);
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @param engine - the engine of the parser context
|
|
11
|
-
* @param sceneData - scene data which is exported by editor
|
|
12
|
-
* @returns a promise of scene
|
|
10
|
+
* @internal
|
|
13
11
|
*/
|
|
14
|
-
|
|
15
|
-
constructor(data: IScene, context: ParserContext<IScene, Scene>, scene: Scene);
|
|
12
|
+
_collectDependentAssets(data: IScene): void;
|
|
16
13
|
protected _handleRootEntity(id: string): void;
|
|
17
14
|
protected _clearAndResolve(): Scene;
|
|
15
|
+
private _parseDependentAssets;
|
|
16
|
+
private _searchDependentAssets;
|
|
18
17
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BackgroundMode, BackgroundTextureFillMode, BloomDownScaleMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution, TonemappingMode } from "@galacean/engine-core";
|
|
2
|
-
import type {
|
|
3
|
-
import type { IColor, IHierarchyFile, IVector3 } from "./BasicSchema";
|
|
2
|
+
import type { IAssetRef, IColor, IHierarchyFile, IVector3 } from "./BasicSchema";
|
|
4
3
|
export declare enum SpecularMode {
|
|
5
4
|
Sky = "Sky",
|
|
6
5
|
Custom = "Custom"
|
|
@@ -10,16 +9,16 @@ export interface IScene extends IHierarchyFile {
|
|
|
10
9
|
background: {
|
|
11
10
|
mode: BackgroundMode;
|
|
12
11
|
color: IColor;
|
|
13
|
-
texture?:
|
|
12
|
+
texture?: IAssetRef;
|
|
14
13
|
textureFillMode?: BackgroundTextureFillMode;
|
|
15
|
-
skyMesh?:
|
|
16
|
-
skyMaterial?:
|
|
14
|
+
skyMesh?: IAssetRef;
|
|
15
|
+
skyMaterial?: IAssetRef;
|
|
17
16
|
};
|
|
18
17
|
ambient: {
|
|
19
18
|
diffuseMode: DiffuseMode;
|
|
20
|
-
ambientLight:
|
|
21
|
-
customAmbientLight:
|
|
22
|
-
customSpecularTexture:
|
|
19
|
+
ambientLight: IAssetRef;
|
|
20
|
+
customAmbientLight: IAssetRef;
|
|
21
|
+
customSpecularTexture: IAssetRef;
|
|
23
22
|
diffuseSolidColor: IColor;
|
|
24
23
|
diffuseIntensity: number;
|
|
25
24
|
specularIntensity: number;
|
|
@@ -52,7 +51,7 @@ export interface IScene extends IHierarchyFile {
|
|
|
52
51
|
scatter: number;
|
|
53
52
|
intensity: number;
|
|
54
53
|
tint: IColor;
|
|
55
|
-
dirtTexture:
|
|
54
|
+
dirtTexture: IAssetRef;
|
|
56
55
|
dirtIntensity: number;
|
|
57
56
|
};
|
|
58
57
|
tonemapping: {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { KTX2Container } from "../KTX2Container";
|
|
2
|
-
import { KTX2TargetFormat } from "../KTX2TargetFormat";
|
|
3
|
-
import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
|
|
4
|
-
/** @internal */
|
|
5
|
-
export declare class KhronosTranscoder extends AbstractTranscoder {
|
|
6
|
-
readonly type: KTX2TargetFormat;
|
|
7
|
-
static transcoderMap: {
|
|
8
|
-
0: string;
|
|
9
|
-
};
|
|
10
|
-
constructor(workerLimitCount: number, type: KTX2TargetFormat);
|
|
11
|
-
_initTranscodeWorkerPool(): Promise<Worker[]>;
|
|
12
|
-
transcode(ktx2Container: KTX2Container): Promise<TranscodeResult>;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function TranscodeWorkerCode(): void;
|
|
File without changes
|