@galacean/engine-loader 1.0.0 → 1.1.0-alpha.0

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 (47) hide show
  1. package/dist/main.js +1520 -1080
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +1538 -1098
  4. package/dist/module.js +1507 -1082
  5. package/dist/module.js.map +1 -1
  6. package/package.json +5 -5
  7. package/types/AnimationClipLoader.d.ts +1 -0
  8. package/types/GLTFContentRestorer.d.ts +82 -0
  9. package/types/GLTFLoader.d.ts +3 -0
  10. package/types/Texture2DContentRestorer.d.ts +11 -0
  11. package/types/TextureCubeContentRestorer.d.ts +11 -0
  12. package/types/gltf/GLTFPipeline.d.ts +23 -0
  13. package/types/gltf/GLTFResource.d.ts +8 -12
  14. package/types/gltf/GLTFSchema.d.ts +816 -0
  15. package/types/gltf/GLTFUtil.d.ts +1 -1
  16. package/types/gltf/GLTFUtils.d.ts +47 -0
  17. package/types/gltf/extensions/GALACEAN_animation_event.d.ts +1 -0
  18. package/types/gltf/extensions/GLTFExtensionParser.d.ts +52 -0
  19. package/types/gltf/extensions/GLTFExtensionSchema.d.ts +149 -0
  20. package/types/gltf/extensions/KHR_materials_ior.d.ts +1 -0
  21. package/types/gltf/extensions/KHR_materials_variants.d.ts +6 -1
  22. package/types/gltf/extensions/index.d.ts +5 -1
  23. package/types/gltf/index.d.ts +6 -0
  24. package/types/gltf/parser/GLTFAnimationParser.d.ts +12 -0
  25. package/types/gltf/parser/GLTFBufferParser.d.ts +7 -0
  26. package/types/gltf/parser/GLTFEntityParser.d.ts +9 -0
  27. package/types/gltf/parser/GLTFMaterialParser.d.ts +15 -0
  28. package/types/gltf/parser/GLTFMeshParser.d.ts +19 -0
  29. package/types/gltf/parser/GLTFParser.d.ts +63 -0
  30. package/types/gltf/parser/GLTFParserContext.d.ts +48 -0
  31. package/types/gltf/parser/GLTFSceneParser.d.ts +11 -0
  32. package/types/gltf/parser/GLTFSkinParser.d.ts +6 -0
  33. package/types/gltf/parser/GLTFTextureParser.d.ts +8 -0
  34. package/types/gltf/parser/GLTFValidator.d.ts +6 -0
  35. package/types/gltf/parser/index.d.ts +11 -0
  36. package/types/index.d.ts +2 -2
  37. package/types/resource-deserialize/index.d.ts +3 -3
  38. package/types/resource-deserialize/resources/mesh/MeshDecoder.d.ts +1 -1
  39. package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
  40. package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +14 -0
  41. package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +4 -4
  42. package/types/resource-deserialize/resources/scene/SceneParser.d.ts +1 -1
  43. package/types/resource-deserialize/resources/scene/SceneParserContext.d.ts +1 -1
  44. package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +61 -0
  45. package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +91 -0
  46. package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +41 -0
  47. package/types/resource-deserialize/resources/schema/index.d.ts +3 -0
@@ -0,0 +1,61 @@
1
+ export interface IVector3 {
2
+ x: number;
3
+ y: number;
4
+ z: number;
5
+ }
6
+ export interface IVector2 {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface IVector4 {
11
+ x: number;
12
+ y: number;
13
+ z: number;
14
+ w: number;
15
+ }
16
+ export interface IColor {
17
+ r: number;
18
+ g: number;
19
+ b: number;
20
+ a: number;
21
+ }
22
+ export interface IPrefabFile {
23
+ entities: Array<IEntity>;
24
+ }
25
+ export type IMethodParams = Array<IBasicType>;
26
+ export type IClassObject = {
27
+ class: string;
28
+ constructParams?: IMethodParams;
29
+ methods?: {
30
+ [methodName: string]: Array<IMethodParams>;
31
+ };
32
+ props?: {
33
+ [key: string]: IBasicType | IMethodParams;
34
+ };
35
+ };
36
+ export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams;
37
+ export type IAssetRef = {
38
+ key?: string;
39
+ refId: string;
40
+ };
41
+ export interface IBasicEntity {
42
+ name?: string;
43
+ id?: string;
44
+ components?: Array<IComponent>;
45
+ isActive?: boolean;
46
+ position?: IVector3;
47
+ rotation?: IVector3;
48
+ scale?: IVector3;
49
+ children?: Array<string>;
50
+ parent?: string;
51
+ }
52
+ export type IEntity = IBasicEntity | IRefEntity;
53
+ export interface IRefEntity extends IBasicEntity {
54
+ assetRefId: string;
55
+ key?: string;
56
+ isClone?: boolean;
57
+ }
58
+ export type IComponent = {
59
+ id: string;
60
+ refId?: string;
61
+ } & IClassObject;
@@ -0,0 +1,91 @@
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: "Vector2" | "Vector3" | "Vector4" | "Color" | "Float" | "Texture";
83
+ value: IVector3 | IVector2 | IColor | number | IAssetRef;
84
+ };
85
+ };
86
+ macros: Array<{
87
+ name: string;
88
+ value?: string;
89
+ }>;
90
+ renderState: IRenderState;
91
+ }
@@ -0,0 +1,41 @@
1
+ import { BackgroundMode, DiffuseMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
2
+ import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
3
+ import type { IColor, IPrefabFile } from "./BasicSchema";
4
+ export declare enum SpecularMode {
5
+ Sky = "Sky",
6
+ Custom = "Custom"
7
+ }
8
+ export interface IScene extends IPrefabFile {
9
+ scene: {
10
+ background: {
11
+ mode: BackgroundMode;
12
+ color: IColor;
13
+ texture?: IReferable;
14
+ skyMesh?: IReferable;
15
+ skyMaterial?: IReferable;
16
+ };
17
+ ambient: {
18
+ diffuseMode: DiffuseMode;
19
+ ambientLight: IReferable;
20
+ customAmbientLight: IReferable;
21
+ customSpecularTexture: IReferable;
22
+ diffuseSolidColor: IColor;
23
+ diffuseIntensity: number;
24
+ specularIntensity: number;
25
+ specularMode: SpecularMode;
26
+ bakerResolution: number;
27
+ };
28
+ shadow?: {
29
+ castShadows: boolean;
30
+ shadowResolution: ShadowResolution;
31
+ shadowDistance: number;
32
+ shadowCascades: ShadowCascadesMode;
33
+ };
34
+ };
35
+ files: Array<{
36
+ id: string;
37
+ type: string;
38
+ virtualPath: string;
39
+ path: string;
40
+ }>;
41
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./BasicSchema";
2
+ export * from "./MaterialSchema";
3
+ export * from "./SceneSchema";