@galacean/engine-loader 0.0.0-experimental-2.0-game.19 → 0.0.0-experimental-2.0-migrate.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 (35) hide show
  1. package/dist/main.js +5707 -5939
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +5708 -5940
  4. package/dist/module.js.map +1 -1
  5. package/package.json +4 -4
  6. package/types/HDRDecoder.d.ts +27 -8
  7. package/types/SceneLoader.d.ts +8 -1
  8. package/types/{Texture2DLoader.d.ts → TextureLoader.d.ts} +4 -4
  9. package/types/gltf/GLTFResource.d.ts +5 -0
  10. package/types/gltf/extensions/GLTFExtensionSchema.d.ts +2 -3
  11. package/types/gltf/parser/GLTFSceneParser.d.ts +1 -0
  12. package/types/gltf/parser/GLTFSkinParser.d.ts +5 -2
  13. package/types/index.d.ts +3 -5
  14. package/types/prefab/PrefabParser.d.ts +9 -6
  15. package/types/resource-deserialize/index.d.ts +3 -2
  16. package/types/resource-deserialize/resources/parser/HierarchyParser.d.ts +22 -27
  17. package/types/resource-deserialize/resources/parser/ParserContext.d.ts +11 -11
  18. package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +41 -18
  19. package/types/resource-deserialize/resources/scene/SceneParser.d.ts +6 -7
  20. package/types/schema/BasicSchema.d.ts +21 -0
  21. package/types/schema/CommonSchema.d.ts +33 -0
  22. package/types/schema/HierarchySchema.d.ts +71 -0
  23. package/types/schema/MaterialSchema.d.ts +27 -0
  24. package/types/schema/PrefabSchema.d.ts +4 -0
  25. package/types/schema/SceneSchema.d.ts +63 -0
  26. package/types/{resource-deserialize/resources/schema → schema}/index.d.ts +4 -1
  27. package/types/schema/refs.d.ts +2 -0
  28. package/types/ShaderChunkLoader.d.ts +0 -9
  29. package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +0 -105
  30. package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +0 -102
  31. package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +0 -84
  32. package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +0 -9
  33. /package/types/{TextureCubeLoader.d.ts → resource-deserialize/resources/texture2D/Texture2DDecoder.d.ts} +0 -0
  34. /package/types/{gltf/parser/GLTFSkinParser.test.d.ts → resource-deserialize/resources/textureCube/TextureCubeDecoder.d.ts} +0 -0
  35. /package/types/{resource-deserialize/resources/schema → schema}/ProjectSchema.d.ts +0 -0
@@ -1,4 +1,7 @@
1
+ export * from "./CommonSchema";
2
+ export * from "./HierarchySchema";
3
+ export * from "./SceneSchema";
4
+ export * from "./PrefabSchema";
1
5
  export * from "./BasicSchema";
2
6
  export * from "./MaterialSchema";
3
7
  export * from "./ProjectSchema";
4
- export * from "./SceneSchema";
@@ -0,0 +1,2 @@
1
+ import type { RefItem } from "./CommonSchema";
2
+ export declare function resolveRefItem(refs: RefItem[], index: number, owner: string, label: string): RefItem;
@@ -1,9 +0,0 @@
1
- import { AssetPromise, LoadItem, Loader, ResourceManager } from "@galacean/engine-core";
2
- export declare class ShaderChunkLoader extends Loader<void[]> {
3
- private static _shaderIncludeRegex;
4
- /**
5
- * @internal
6
- */
7
- static _loadChunksInCode(code: string, basePath: string, resourceManager: ResourceManager): Promise<void[]>;
8
- load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<void[]>;
9
- }
@@ -1,105 +0,0 @@
1
- import { Layer } from "@galacean/engine-core";
2
- export interface IVector3 {
3
- x: number;
4
- y: number;
5
- z: number;
6
- }
7
- export interface IVector2 {
8
- x: number;
9
- y: number;
10
- }
11
- export interface IVector4 {
12
- x: number;
13
- y: number;
14
- z: number;
15
- w: number;
16
- }
17
- export interface IColor {
18
- r: number;
19
- g: number;
20
- b: number;
21
- a: number;
22
- }
23
- export interface IHierarchyFile {
24
- entities: Array<IEntity>;
25
- }
26
- export type IMethod = {
27
- params: Array<IBasicType>;
28
- result?: IInstance;
29
- };
30
- export type IMethodParams = Array<IBasicType> | IMethod;
31
- export interface IBasicEntity {
32
- name?: string;
33
- id?: string;
34
- transform?: IComponent;
35
- components?: Array<IComponent>;
36
- isActive?: boolean;
37
- position?: IVector3;
38
- rotation?: IVector3;
39
- scale?: IVector3;
40
- children?: Array<string>;
41
- parent?: string;
42
- layer?: Layer;
43
- }
44
- export type IEntity = IBasicEntity | IRefEntity | IStrippedEntity;
45
- export interface IRefEntity extends IBasicEntity {
46
- assetUrl: string;
47
- key?: string;
48
- isClone?: boolean;
49
- modifications: (IInstance & {
50
- target: IPrefabModifyTarget;
51
- })[];
52
- removedEntities: IPrefabModifyTarget[];
53
- removedComponents: IPrefabModifyTarget[];
54
- }
55
- export interface IPrefabModifyTarget {
56
- entityId?: string;
57
- componentId?: string;
58
- }
59
- export interface IStrippedEntity extends IBasicEntity {
60
- strippedId: string;
61
- prefabInstanceId: string;
62
- prefabSource: {
63
- assetId: string;
64
- entityId: string;
65
- };
66
- }
67
- export type IComponent = {
68
- id: string;
69
- url?: string;
70
- } & IClass;
71
- export type IClass = {
72
- class: string;
73
- constructParams?: Array<IBasicType>;
74
- } & IInstance;
75
- export interface IInstance {
76
- methods?: {
77
- [methodName: string]: Array<IMethodParams>;
78
- };
79
- props?: {
80
- [key: string]: IBasicType | IMethodParams;
81
- };
82
- }
83
- export type IClassType = {
84
- classType: string;
85
- };
86
- export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef | IComponentRef | ISignalRef;
87
- export type IAssetRef = {
88
- key?: string;
89
- url: string;
90
- };
91
- export type IEntityRef = {
92
- entityPath: number[];
93
- };
94
- export type IComponentRef = {
95
- entityPath: number[];
96
- componentType: string;
97
- componentIndex: number;
98
- };
99
- export type ISignalRef = {
100
- listeners: Array<{
101
- target: IComponentRef;
102
- methodName: string;
103
- arguments?: Array<IBasicType>;
104
- }>;
105
- };
@@ -1,102 +0,0 @@
1
- import { BlendFactor, BlendOperation, ColorWriteMask, CompareFunction, CullMode, RenderQueueType, StencilOperation } from "@galacean/engine-core";
2
- import type { IAssetRef, IColor, IVector2, IVector3 } from "./BasicSchema";
3
- export interface IRenderState {
4
- /** Blend state. */
5
- blendState: {
6
- /** The blend state of the render target. */
7
- targetBlendState: {
8
- /** Whether to enable blend. */
9
- enabled: boolean;
10
- /** color (RGB) blend operation. */
11
- colorBlendOperation: BlendOperation;
12
- /** alpha (A) blend operation. */
13
- alphaBlendOperation: BlendOperation;
14
- /** color blend factor (RGB) for source. */
15
- sourceColorBlendFactor: BlendFactor;
16
- /** alpha blend factor (A) for source. */
17
- sourceAlphaBlendFactor: BlendFactor;
18
- /** color blend factor (RGB) for destination. */
19
- destinationColorBlendFactor: BlendFactor;
20
- /** alpha blend factor (A) for destination. */
21
- destinationAlphaBlendFactor: BlendFactor;
22
- /** color mask. */
23
- colorWriteMask: ColorWriteMask;
24
- };
25
- blendColor: IColor;
26
- /** Whether to use (Alpha-to-Coverage) technology. */
27
- alphaToCoverage: boolean;
28
- };
29
- /** Depth state. */
30
- depthState: {
31
- /** Whether to enable the depth test. */
32
- enabled: boolean;
33
- /** Whether the depth value can be written.*/
34
- writeEnabled: boolean;
35
- /** Depth comparison function. */
36
- compareFunction: CompareFunction;
37
- };
38
- /** Stencil state. */
39
- stencilState: {
40
- /** Whether to enable stencil test. */
41
- enabled: boolean;
42
- /** Write the reference value of the stencil buffer. */
43
- referenceValue: number;
44
- /** Specifying a bit-wise mask that is used to AND the reference value and the stored stencil value when the test is done. */
45
- mask: number;
46
- /** Specifying a bit mask to enable or disable writing of individual bits in the stencil planes. */
47
- writeMask: number;
48
- /** The comparison function of the reference value of the front face of the geometry and the current buffer storage value. */
49
- compareFunctionFront: CompareFunction;
50
- /** The comparison function of the reference value of the back of the geometry and the current buffer storage value. */
51
- compareFunctionBack: CompareFunction;
52
- /** specifying the function to use for front face when both the stencil test and the depth test pass. */
53
- passOperationFront: StencilOperation;
54
- /** specifying the function to use for back face when both the stencil test and the depth test pass. */
55
- passOperationBack: StencilOperation;
56
- /** specifying the function to use for front face when the stencil test fails. */
57
- failOperationFront: StencilOperation;
58
- /** specifying the function to use for back face when the stencil test fails. */
59
- failOperationBack: StencilOperation;
60
- /** specifying the function to use for front face when the stencil test passes, but the depth test fails. */
61
- zFailOperationFront: StencilOperation;
62
- /** specifying the function to use for back face when the stencil test passes, but the depth test fails. */
63
- zFailOperationBack: StencilOperation;
64
- };
65
- /** Raster state. */
66
- rasterState: {
67
- /** Specifies whether or not front- and/or back-facing polygons can be culled. */
68
- cullMode: CullMode;
69
- /** The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. */
70
- depthBias: number;
71
- /** The scale factor for the variable depth offset for each polygon. */
72
- slopeScaledDepthBias: number;
73
- };
74
- /** Render queue type. */
75
- renderQueueType: RenderQueueType;
76
- }
77
- export interface IMaterialSchema {
78
- name: string;
79
- shader: string;
80
- shaderData: {
81
- [key: string]: {
82
- type: MaterialLoaderType;
83
- value: IVector3 | IVector2 | IColor | number | IAssetRef;
84
- };
85
- };
86
- macros: Array<{
87
- name: string;
88
- value?: string;
89
- }>;
90
- renderState: IRenderState;
91
- shaderRef: IAssetRef;
92
- }
93
- export declare enum MaterialLoaderType {
94
- Vector2 = "Vector2",
95
- Vector3 = "Vector3",
96
- Vector4 = "Vector4",
97
- Color = "Color",
98
- Float = "Float",
99
- Texture = "Texture",
100
- Boolean = "Boolean",
101
- Integer = "Integer"
102
- }
@@ -1,84 +0,0 @@
1
- import { BackgroundMode, BackgroundTextureFillMode, BloomDownScaleMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution, TonemappingMode } from "@galacean/engine-core";
2
- import type { IAssetRef, IColor, IHierarchyFile, IVector3 } from "./BasicSchema";
3
- export declare enum SpecularMode {
4
- Sky = "Sky",
5
- Custom = "Custom"
6
- }
7
- export interface IScene extends IHierarchyFile {
8
- name?: string;
9
- scene: {
10
- background: {
11
- mode: BackgroundMode;
12
- color: IColor;
13
- texture?: IAssetRef;
14
- textureFillMode?: BackgroundTextureFillMode;
15
- skyMesh?: IAssetRef;
16
- skyMaterial?: IAssetRef;
17
- };
18
- ambient: {
19
- diffuseMode: DiffuseMode;
20
- ambientLight: IAssetRef;
21
- customAmbientLight: IAssetRef;
22
- customSpecularTexture: IAssetRef;
23
- diffuseSolidColor: IColor;
24
- diffuseIntensity: number;
25
- specularIntensity: number;
26
- specularMode: SpecularMode;
27
- bakerResolution: number;
28
- };
29
- shadow?: {
30
- castShadows: boolean;
31
- enableTransparentShadow: boolean;
32
- shadowResolution: ShadowResolution;
33
- shadowDistance: number;
34
- shadowCascades: ShadowCascadesMode;
35
- shadowTwoCascadeSplits: number;
36
- shadowFourCascadeSplits: IVector3;
37
- shadowFadeBorder: number;
38
- };
39
- fog?: {
40
- fogMode: FogMode;
41
- fogStart: number;
42
- fogEnd: number;
43
- fogDensity: number;
44
- fogColor: IColor;
45
- };
46
- physics?: {
47
- gravity?: IVector3;
48
- fixedTimeStep?: number;
49
- };
50
- postProcess?: {
51
- isActive: boolean;
52
- bloom: {
53
- enabled: boolean;
54
- downScale: BloomDownScaleMode;
55
- threshold: number;
56
- scatter: number;
57
- intensity: number;
58
- tint: IColor;
59
- dirtTexture: IAssetRef;
60
- dirtIntensity: number;
61
- };
62
- tonemapping: {
63
- enabled: boolean;
64
- mode: TonemappingMode;
65
- };
66
- };
67
- ambientOcclusion?: {
68
- bias: number;
69
- bilateralThreshold: number;
70
- enabledAmbientOcclusion: boolean;
71
- intensity: number;
72
- power: number;
73
- quality: number;
74
- radius: number;
75
- minHorizonAngle: number;
76
- };
77
- };
78
- files: Array<{
79
- id: string;
80
- type: string;
81
- virtualPath: string;
82
- path: string;
83
- }>;
84
- }
@@ -1,9 +0,0 @@
1
- import { AssetPromise, Engine, Texture2D } from "@galacean/engine-core";
2
- import { BufferReader } from "../../utils/BufferReader";
3
- /**
4
- * Data format: [url] [mipmap(1B)] [filterMode(1B)] [anisoLevel(1B)] [wrapModeU(1B)] [wrapModeV(1B)]
5
- * [format(1B)] [width(2B)] [height(2B)] [isPixelBuffer(1B)] [isSRGBColorSpace(1B)] [mipCount(1B)] [imageData...]
6
- */
7
- export declare class Texture2DDecoder {
8
- static decode(engine: Engine, bufferReader: BufferReader, restoredTexture?: Texture2D): AssetPromise<Texture2D>;
9
- }