@galacean/engine-loader 1.0.0 → 1.1.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 +5604 -4048
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +5527 -3971
- package/dist/module.js +5592 -4051
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/AnimationClipLoader.d.ts +1 -0
- package/types/GLTFContentRestorer.d.ts +92 -0
- package/types/GLTFLoader.d.ts +3 -0
- package/types/Texture2DContentRestorer.d.ts +11 -0
- package/types/TextureCubeContentRestorer.d.ts +11 -0
- package/types/gltf/GLTFPipeline.d.ts +23 -0
- package/types/gltf/GLTFResource.d.ts +7 -15
- package/types/gltf/GLTFSchema.d.ts +822 -0
- package/types/gltf/GLTFUtil.d.ts +1 -1
- package/types/gltf/GLTFUtils.d.ts +49 -0
- package/types/gltf/extensions/GALACEAN_animation_event.d.ts +1 -0
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +52 -0
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +149 -0
- package/types/gltf/extensions/KHR_materials_ior.d.ts +1 -0
- package/types/gltf/extensions/KHR_materials_variants.d.ts +6 -1
- package/types/gltf/extensions/KHR_texture_basisu.d.ts +1 -0
- package/types/gltf/extensions/index.d.ts +5 -1
- package/types/gltf/index.d.ts +6 -0
- package/types/gltf/parser/GLTFAnimationParser.d.ts +12 -0
- package/types/gltf/parser/GLTFBufferParser.d.ts +7 -0
- package/types/gltf/parser/GLTFEntityParser.d.ts +9 -0
- package/types/gltf/parser/GLTFMaterialParser.d.ts +15 -0
- package/types/gltf/parser/GLTFMeshParser.d.ts +19 -0
- package/types/gltf/parser/GLTFParser.d.ts +63 -0
- package/types/gltf/parser/GLTFParserContext.d.ts +53 -0
- package/types/gltf/parser/GLTFSceneParser.d.ts +13 -0
- package/types/gltf/parser/GLTFSkinParser.d.ts +7 -0
- package/types/gltf/parser/GLTFTextureParser.d.ts +12 -0
- package/types/gltf/parser/GLTFValidator.d.ts +6 -0
- package/types/gltf/parser/index.d.ts +11 -0
- package/types/index.d.ts +7 -4
- package/types/ktx2/KTX2Container.d.ts +72 -0
- package/types/ktx2/KTX2Loader.d.ts +53 -0
- package/types/ktx2/KTX2TargetFormat.d.ts +21 -0
- package/types/ktx2/WorkerPool.d.ts +32 -0
- package/types/ktx2/transcoder/AbstractTranscoder.d.ts +55 -0
- package/types/ktx2/transcoder/BinomialLLCTranscoder.d.ts +8 -0
- package/types/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +2 -0
- package/types/ktx2/transcoder/KhronosTranscoder.d.ts +13 -0
- package/types/ktx2/transcoder/KhronosWorkerCode.d.ts +1 -0
- package/types/resource-deserialize/index.d.ts +3 -3
- package/types/resource-deserialize/resources/mesh/MeshDecoder.d.ts +1 -1
- 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/scene/SceneParser.d.ts +1 -1
- package/types/resource-deserialize/resources/scene/SceneParserContext.d.ts +1 -1
- 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/types/resource-deserialize/utils/BufferReader.d.ts +6 -10
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AssetPromise, Engine, EngineConfiguration, LoadItem, Loader, ResourceManager, Texture2D, TextureCube } from "@galacean/engine-core";
|
|
2
|
+
import { KTX2TargetFormat } from "./KTX2TargetFormat";
|
|
3
|
+
import { TranscodeResult } from "./transcoder/AbstractTranscoder";
|
|
4
|
+
export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
5
|
+
private static _isBinomialInit;
|
|
6
|
+
private static _binomialLLCTranscoder;
|
|
7
|
+
private static _khronosTranscoder;
|
|
8
|
+
private static _supportedMap;
|
|
9
|
+
/**
|
|
10
|
+
* Destroy ktx2 transcoder worker.
|
|
11
|
+
*/
|
|
12
|
+
static destroy(): void;
|
|
13
|
+
/** @internal */
|
|
14
|
+
static _parseBuffer(buffer: Uint8Array, engine: Engine, params?: KTX2Params): Promise<{
|
|
15
|
+
engine: Engine;
|
|
16
|
+
result: TranscodeResult;
|
|
17
|
+
targetFormat: KTX2TargetFormat;
|
|
18
|
+
params: Uint8Array;
|
|
19
|
+
}>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
static _createTextureByBuffer(engine: Engine, transcodeResult: TranscodeResult, targetFormat: KTX2TargetFormat, params?: Uint8Array): Texture2D | TextureCube;
|
|
22
|
+
private static _decideTargetFormat;
|
|
23
|
+
private static _detectSupportedFormat;
|
|
24
|
+
private static _getBinomialLLCTranscoder;
|
|
25
|
+
private static _getKhronosTranscoder;
|
|
26
|
+
private static _getEngineTextureFormat;
|
|
27
|
+
initialize(engine: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
load(item: LoadItem & {
|
|
32
|
+
params?: KTX2Params;
|
|
33
|
+
}, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
|
|
34
|
+
private _isKhronosSupported;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* KTX2 loader params interface.
|
|
38
|
+
*/
|
|
39
|
+
export interface KTX2Params {
|
|
40
|
+
/** Priority transcoding format queue, default is ASTC/ETC/DXT/PVRTC/RGBA8. */
|
|
41
|
+
priorityFormats: KTX2TargetFormat[];
|
|
42
|
+
}
|
|
43
|
+
declare module "@galacean/engine-core" {
|
|
44
|
+
interface EngineConfiguration {
|
|
45
|
+
/** KTX2 loader options. */
|
|
46
|
+
ktx2Loader?: {
|
|
47
|
+
/** Worker count for transcoder, default is 4. */
|
|
48
|
+
workerCount?: number;
|
|
49
|
+
/** Pre-initialization according to the priority transcoding format queue, default is ASTC/ETC/DXT/PVRTC/RGBA8. */
|
|
50
|
+
priorityFormats?: KTX2TargetFormat[] | KTX2TargetFormat[][];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KTX2 transcode target format.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum KTX2TargetFormat {
|
|
5
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
6
|
+
ASTC = 0,
|
|
7
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
8
|
+
BC7 = 1,
|
|
9
|
+
/** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */
|
|
10
|
+
BC1_BC3 = 2,
|
|
11
|
+
/** RGB(A) compressed format, 4 bits per pixel. */
|
|
12
|
+
PVRTC = 3,
|
|
13
|
+
/** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */
|
|
14
|
+
ETC = 4,
|
|
15
|
+
/** R format, 8 bits per pixel. */
|
|
16
|
+
R8 = 5,
|
|
17
|
+
/** RG format, 16 bits per pixel. */
|
|
18
|
+
R8G8 = 6,
|
|
19
|
+
/** RGBA format, 32 bits per pixel. */
|
|
20
|
+
R8G8B8A8 = 7
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* WorkerPool, T is is post message type, U is return type.
|
|
4
|
+
*/
|
|
5
|
+
export declare class WorkerPool<T = any, U = any> {
|
|
6
|
+
readonly limitedCount: number;
|
|
7
|
+
private readonly _workerCreator;
|
|
8
|
+
private _taskQueue;
|
|
9
|
+
private _workerStatus;
|
|
10
|
+
private _workerItems;
|
|
11
|
+
/**
|
|
12
|
+
* Constructor of WorkerPool.
|
|
13
|
+
* @param limitedCount - worker limit count
|
|
14
|
+
* @param _workerCreator - creator of worker
|
|
15
|
+
*/
|
|
16
|
+
constructor(limitedCount: number, _workerCreator: () => Worker | Promise<Worker>);
|
|
17
|
+
prepareWorker(): Promise<Worker[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Post message to worker.
|
|
20
|
+
* @param message - Message which posted to worker
|
|
21
|
+
* @returns Return a promise of message
|
|
22
|
+
*/
|
|
23
|
+
postMessage(message: T): Promise<U>;
|
|
24
|
+
/**
|
|
25
|
+
* Destroy the worker pool.
|
|
26
|
+
*/
|
|
27
|
+
destroy(): void;
|
|
28
|
+
private _initWorker;
|
|
29
|
+
private _getIdleWorkerId;
|
|
30
|
+
private _onMessage;
|
|
31
|
+
private _nextTask;
|
|
32
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { WorkerPool } from "../WorkerPool";
|
|
2
|
+
export declare abstract class AbstractTranscoder {
|
|
3
|
+
readonly workerLimitCount: number;
|
|
4
|
+
protected _transcodeWorkerPool: WorkerPool;
|
|
5
|
+
protected _initPromise: Promise<any>;
|
|
6
|
+
constructor(workerLimitCount: number);
|
|
7
|
+
init(): Promise<any>;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
protected abstract _initTranscodeWorkerPool(): Promise<any>;
|
|
10
|
+
protected _createTranscodePool(workerURL: string, wasmBuffer: ArrayBuffer): Promise<Worker[]>;
|
|
11
|
+
}
|
|
12
|
+
type MessageType = "init" | "transcode";
|
|
13
|
+
export interface BaseMessage {
|
|
14
|
+
type: MessageType;
|
|
15
|
+
}
|
|
16
|
+
export interface InitMessage extends BaseMessage {
|
|
17
|
+
type: "init";
|
|
18
|
+
transcoderWasm: ArrayBuffer;
|
|
19
|
+
}
|
|
20
|
+
export interface BinomialTranscodeMessage extends BaseMessage {
|
|
21
|
+
type: "transcode";
|
|
22
|
+
format: number;
|
|
23
|
+
buffer: ArrayBuffer;
|
|
24
|
+
}
|
|
25
|
+
export type IBinomialMessage = InitMessage | BinomialTranscodeMessage;
|
|
26
|
+
export type TranscodeResult = {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
hasAlpha: boolean;
|
|
30
|
+
format: number;
|
|
31
|
+
faces: Array<{
|
|
32
|
+
data: Uint8Array;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
}>[];
|
|
36
|
+
faceCount: number;
|
|
37
|
+
};
|
|
38
|
+
export type TranscodeResponse = {
|
|
39
|
+
id: number;
|
|
40
|
+
type: "transcoded";
|
|
41
|
+
} & TranscodeResult;
|
|
42
|
+
export interface EncodedData {
|
|
43
|
+
buffer: Uint8Array;
|
|
44
|
+
levelWidth: number;
|
|
45
|
+
levelHeight: number;
|
|
46
|
+
uncompressedByteLength: number;
|
|
47
|
+
}
|
|
48
|
+
export interface KhronosTranscoderMessage extends BaseMessage {
|
|
49
|
+
type: "transcode";
|
|
50
|
+
format: number;
|
|
51
|
+
needZstd: boolean;
|
|
52
|
+
data: EncodedData[][];
|
|
53
|
+
}
|
|
54
|
+
export type IKhronosMessageMessage = InitMessage | KhronosTranscoderMessage;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KTX2TargetFormat } from "../KTX2TargetFormat";
|
|
2
|
+
import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class BinomialLLCTranscoder extends AbstractTranscoder {
|
|
5
|
+
constructor(workerLimitCount: number);
|
|
6
|
+
_initTranscodeWorkerPool(): Promise<Worker[]>;
|
|
7
|
+
transcode(buffer: ArrayBuffer, format: KTX2TargetFormat): Promise<TranscodeResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TranscodeWorkerCode(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Engine } from "@galacean/engine-core";
|
|
2
2
|
export { MeshDecoder } from "./resources/mesh/MeshDecoder";
|
|
3
3
|
export { Texture2DDecoder } from "./resources/texture2D/TextureDecoder";
|
|
4
|
-
export { ReflectionParser } from "./resources/
|
|
5
|
-
export { PrefabParser } from "./resources/
|
|
4
|
+
export { ReflectionParser } from "./resources/parser/ReflectionParser";
|
|
5
|
+
export { PrefabParser } from "./resources/parser/PrefabParser";
|
|
6
6
|
export * from "./resources/animationClip/AnimationClipDecoder";
|
|
7
7
|
export type { IModelMesh } from "./resources/mesh/IModelMesh";
|
|
8
8
|
/**
|
|
@@ -12,7 +12,7 @@ export type { IModelMesh } from "./resources/mesh/IModelMesh";
|
|
|
12
12
|
* @returns
|
|
13
13
|
*/
|
|
14
14
|
export declare function decode<T>(arrayBuffer: ArrayBuffer, engine: Engine): Promise<T>;
|
|
15
|
-
export * from "./resources/
|
|
15
|
+
export * from "./resources/schema";
|
|
16
16
|
export * from "./resources/scene/SceneParser";
|
|
17
17
|
export * from "./resources/scene/MeshLoader";
|
|
18
18
|
export * from "./resources/scene/EditorTextureLoader";
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Entity, Scene } from "@galacean/engine-core";
|
|
2
|
-
import { IEntity, IScene } from "../
|
|
2
|
+
import type { IEntity, IScene } from "../schema";
|
|
3
3
|
export declare class SceneParserContext {
|
|
4
4
|
readonly originalData: IScene;
|
|
5
5
|
readonly scene: Scene;
|
|
@@ -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
|
+
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export declare class BufferReader {
|
|
2
|
-
|
|
2
|
+
data: Uint8Array;
|
|
3
3
|
private _dataView;
|
|
4
4
|
private _littleEndian;
|
|
5
5
|
private _offset;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
2: string;
|
|
10
|
-
3: string;
|
|
11
|
-
};
|
|
12
|
-
constructor(buffer: ArrayBuffer, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
6
|
+
private _baseOffset;
|
|
7
|
+
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
8
|
+
get position(): number;
|
|
13
9
|
get offset(): number;
|
|
14
10
|
nextUint8(): number;
|
|
15
11
|
nextUint16(): number;
|
|
@@ -25,8 +21,8 @@ export declare class BufferReader {
|
|
|
25
21
|
/**
|
|
26
22
|
* image data 放在最后
|
|
27
23
|
*/
|
|
28
|
-
nextImageData(count?: number):
|
|
29
|
-
nextImagesData(count: number):
|
|
24
|
+
nextImageData(count?: number): Uint8Array;
|
|
25
|
+
nextImagesData(count: number): Uint8Array[];
|
|
30
26
|
skip(bytes: number): this;
|
|
31
27
|
scan(maxByteLength: number, term?: number): Uint8Array;
|
|
32
28
|
}
|