@galacean/engine-loader 0.9.18 → 0.9.20
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 +11 -5
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +11 -5
- package/dist/module.js +11 -5
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFContentRestorer.d.ts +18 -8
- package/types/gltf/GLTFUtils.d.ts +3 -2
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +1 -1
- package/types/gltf/parser/GLTFAnimationParser.d.ts +2 -2
- package/types/gltf/parser/GLTFMeshParser.d.ts +5 -5
- package/types/gltf/parser/GLTFParser.d.ts +1 -1
- package/types/gltf/parser/GLTFParserContext.d.ts +7 -2
- package/types/gltf/parser/GLTFSceneParser.d.ts +2 -2
- package/types/gltf/parser/GLTFSkinParser.d.ts +2 -1
- package/types/gltf/parser/GLTFTextureParser.d.ts +3 -2
- package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +5 -0
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +14 -0
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +61 -0
- package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +91 -0
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +41 -0
- package/types/resource-deserialize/resources/schema/index.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.20",
|
|
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-core": "0.9.
|
|
19
|
-
"@galacean/engine-draco": "0.9.
|
|
20
|
-
"@galacean/engine-
|
|
21
|
-
"@galacean/engine-
|
|
18
|
+
"@galacean/engine-core": "0.9.20",
|
|
19
|
+
"@galacean/engine-draco": "0.9.20",
|
|
20
|
+
"@galacean/engine-rhi-webgl": "0.9.20",
|
|
21
|
+
"@galacean/engine-math": "0.9.20"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
3
|
import { Vector2 } from "@galacean/engine-math";
|
|
4
4
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
5
|
-
import { IBufferView } from "./gltf/GLTFSchema";
|
|
5
|
+
import type { IBufferView } from "./gltf/GLTFSchema";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -65,18 +65,28 @@ export declare class BufferDataRestoreInfo {
|
|
|
65
65
|
*/
|
|
66
66
|
export declare class RestoreDataAccessor {
|
|
67
67
|
bufferIndex: number;
|
|
68
|
-
TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) =>
|
|
68
|
+
TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray;
|
|
69
69
|
byteOffset: number;
|
|
70
70
|
length: number;
|
|
71
|
-
constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) =>
|
|
71
|
+
constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray, byteOffset: number, length: number);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
76
|
export declare class BlendShapeRestoreInfo {
|
|
77
77
|
blendShape: BlendShape;
|
|
78
|
-
position:
|
|
79
|
-
normal?:
|
|
80
|
-
tangent?:
|
|
81
|
-
constructor(blendShape: BlendShape, position:
|
|
78
|
+
position: BlendShapeDataRestoreInfo;
|
|
79
|
+
normal?: BlendShapeDataRestoreInfo;
|
|
80
|
+
tangent?: BlendShapeDataRestoreInfo;
|
|
81
|
+
constructor(blendShape: BlendShape, position: BlendShapeDataRestoreInfo, normal?: BlendShapeDataRestoreInfo, tangent?: BlendShapeDataRestoreInfo);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export declare class BlendShapeDataRestoreInfo {
|
|
87
|
+
buffer: BufferDataRestoreInfo;
|
|
88
|
+
stride: number;
|
|
89
|
+
byteOffset: number;
|
|
90
|
+
count: number;
|
|
91
|
+
constructor(buffer: BufferDataRestoreInfo, stride: number, byteOffset: number, count: number);
|
|
82
92
|
}
|
|
@@ -17,9 +17,10 @@ export declare class GLTFUtils {
|
|
|
17
17
|
/**
|
|
18
18
|
* Get the TypedArray corresponding to the component type.
|
|
19
19
|
*/
|
|
20
|
-
static getComponentType(componentType: AccessorComponentType):
|
|
20
|
+
static getComponentType(componentType: AccessorComponentType): Float32ArrayConstructor | Uint32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor;
|
|
21
21
|
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
22
|
-
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): BufferInfo
|
|
22
|
+
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): Promise<BufferInfo>;
|
|
23
|
+
static bufferToVector3Array(data: TypedArray, byteStride: number, accessorByteOffset: number, count: number): Vector3[];
|
|
23
24
|
/**
|
|
24
25
|
* @deprecated
|
|
25
26
|
* Get accessor data.
|
|
@@ -6,7 +6,7 @@ export declare class GLTFAnimationParser extends GLTFParser {
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): void
|
|
9
|
+
static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): Promise<void>;
|
|
10
10
|
private static _addCurve;
|
|
11
|
-
parse(context: GLTFParserContext): AssetPromise<AnimationClip[]
|
|
11
|
+
parse(context: GLTFParserContext): AssetPromise<AnimationClip[]> | void;
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssetPromise, ModelMesh, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { ModelMeshRestoreInfo } from "../../GLTFContentRestorer";
|
|
3
|
-
import { IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
3
|
+
import type { IAccessor, IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParser } from "./GLTFParser";
|
|
5
5
|
import { BufferInfo, GLTFParserContext } from "./GLTFParserContext";
|
|
6
6
|
export declare class GLTFMeshParser extends GLTFParser {
|
|
@@ -8,12 +8,12 @@ export declare class GLTFMeshParser extends GLTFParser {
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
|
-
static _parseMeshFromGLTFPrimitive(context: GLTFParserContext, mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, gltfMesh: IMesh, gltfPrimitive: IMeshPrimitive, gltf: IGLTF, getVertexBufferData: (semantic: string) => TypedArray, getBlendShapeData: (semantic: string, shapeIndex: number) => BufferInfo
|
|
11
|
+
static _parseMeshFromGLTFPrimitive(context: GLTFParserContext, mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, gltfMesh: IMesh, gltfPrimitive: IMeshPrimitive, gltf: IGLTF, getVertexBufferData: (semantic: string) => TypedArray, getBlendShapeData: (semantic: string, shapeIndex: number) => Promise<BufferInfo>, getIndexBufferData: () => Promise<TypedArray>, keepMeshData: boolean): Promise<ModelMesh>;
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
static _createBlendShape(mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, glTFMesh: IMesh, glTFTargets: {
|
|
15
|
+
static _createBlendShape(mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, glTFMesh: IMesh, accessors: IAccessor[], glTFTargets: {
|
|
16
16
|
[name: string]: number;
|
|
17
|
-
}[], getBlendShapeData: (semantic: string, shapeIndex: number) => BufferInfo): void
|
|
18
|
-
parse(context: GLTFParserContext): AssetPromise<ModelMesh[][]
|
|
17
|
+
}[], getBlendShapeData: (semantic: string, shapeIndex: number) => Promise<BufferInfo>): Promise<void[]>;
|
|
18
|
+
parse(context: GLTFParserContext): AssetPromise<ModelMesh[][]> | void;
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnimationClip, AssetPromise, EngineObject, Material, Mesh } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFExtensionMode, GLTFExtensionParser } from "../extensions/GLTFExtensionParser";
|
|
3
|
-
import { GLTFExtensionOwnerSchema } from "../GLTFSchema";
|
|
3
|
+
import type { GLTFExtensionOwnerSchema } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
5
5
|
/**
|
|
6
6
|
* Base class of glTF parser.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { BufferDataRestoreInfo, GLTFContentRestorer } from "../../GLTFContentRestorer";
|
|
3
3
|
import { GLTFResource } from "../GLTFResource";
|
|
4
|
-
import { IGLTF } from "../GLTFSchema";
|
|
4
|
+
import type { IGLTF } from "../GLTFSchema";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
8
|
export declare class GLTFParserContext {
|
|
9
9
|
glTF: IGLTF;
|
|
10
|
-
buffers: ArrayBuffer[];
|
|
11
10
|
glTFResource: GLTFResource;
|
|
12
11
|
keepMeshData: boolean;
|
|
13
12
|
hasSkinned: boolean;
|
|
@@ -21,7 +20,13 @@ export declare class GLTFParserContext {
|
|
|
21
20
|
masterPromiseInfo: PromiseInfo<GLTFResource>;
|
|
22
21
|
promiseMap: Record<string, AssetPromise<any>>;
|
|
23
22
|
contentRestorer: GLTFContentRestorer;
|
|
23
|
+
/** @internal */
|
|
24
|
+
_buffers: ArrayBuffer[] | Promise<ArrayBuffer[]>;
|
|
24
25
|
constructor(url: string);
|
|
26
|
+
/**
|
|
27
|
+
* Get all the buffer data.
|
|
28
|
+
*/
|
|
29
|
+
getBuffers(): Promise<ArrayBuffer[]>;
|
|
25
30
|
private _initPromiseInfo;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Entity } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, Entity } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
3
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFSceneParser extends GLTFParser {
|
|
5
5
|
private static _defaultMaterial;
|
|
6
6
|
private static _getDefaultMaterial;
|
|
7
|
-
parse(context: GLTFParserContext):
|
|
7
|
+
parse(context: GLTFParserContext): AssetPromise<Entity> | void;
|
|
8
8
|
private _createCamera;
|
|
9
9
|
private _createRenderer;
|
|
10
10
|
private _createAnimator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AssetPromise } from "@galacean/engine-core";
|
|
1
2
|
import { GLTFParserContext } from ".";
|
|
2
3
|
import { GLTFParser } from "./GLTFParser";
|
|
3
4
|
export declare class GLTFSkinParser extends GLTFParser {
|
|
4
|
-
parse(context: GLTFParserContext): void
|
|
5
|
+
parse(context: GLTFParserContext): AssetPromise<void>;
|
|
5
6
|
private _findSkeletonRootBone;
|
|
6
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AssetPromise, Texture2D } from "@galacean/engine-core";
|
|
2
|
-
import { GLTFParser } from "./GLTFParser";
|
|
3
2
|
import { GLTFParserContext } from ".";
|
|
3
|
+
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
export declare class GLTFTextureParser extends GLTFParser {
|
|
5
5
|
private static _wrapMap;
|
|
6
|
-
parse(context: GLTFParserContext): AssetPromise<Texture2D[]
|
|
6
|
+
parse(context: GLTFParserContext): AssetPromise<Texture2D[]> | void;
|
|
7
|
+
private _getSamplerInfo;
|
|
7
8
|
private _parseSampler;
|
|
8
9
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Engine, Entity } from "@galacean/engine-core";
|
|
2
|
+
import type { IBasicType, IClassObject, IEntity } from "../schema";
|
|
3
|
+
export declare class ReflectionParser {
|
|
4
|
+
static customParseComponentHandles: Map<string, Function>;
|
|
5
|
+
static registerCustomParseComponent(componentType: string, handle: Function): void;
|
|
6
|
+
static parseEntity(entityConfig: IEntity, engine: Engine): Promise<Entity>;
|
|
7
|
+
private static getEntityByConfig;
|
|
8
|
+
static parseClassObject(item: IClassObject, engine: Engine, resourceManager?: any): Promise<any>;
|
|
9
|
+
static parseBasicType(value: IBasicType, engine: Engine, resourceManager?: any): Promise<any>;
|
|
10
|
+
static parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">, engine: Engine, resourceManager?: any): Promise<any>;
|
|
11
|
+
static parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>, engine: Engine, resourceManager?: any): Promise<any>;
|
|
12
|
+
private static _isClass;
|
|
13
|
+
private static _isRef;
|
|
14
|
+
}
|
|
@@ -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
|
+
}
|