@galacean/effects-plugin-model 2.0.0-alpha.7 → 2.0.0-alpha.9
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/gltf/loader-ecs-ext.d.ts +2 -2
- package/dist/gltf/loader-ecs.d.ts +21 -7
- package/dist/gltf/protocol.d.ts +17 -7
- package/dist/index.js +552 -449
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +550 -450
- package/dist/index.mjs.map +1 -1
- package/dist/loader.mjs +4439 -4336
- package/dist/loader.mjs.map +1 -1
- package/dist/runtime/common.d.ts +2 -0
- package/dist/runtime/material.d.ts +76 -93
- package/dist/runtime/math.d.ts +2 -1
- package/dist/runtime/mesh.d.ts +5 -0
- package/dist/runtime/shader-libs/standard-shader-source.d.ts +1 -0
- package/dist/runtime/shader-libs/standard-shader.d.ts +8 -0
- package/dist/runtime/skybox.d.ts +1 -1
- package/dist/utility/plugin-helper.d.ts +7 -6
- package/dist/utility/shader-helper.d.ts +2 -0
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { GLTFResources } from '@vvfx/resource-detection';
|
|
2
2
|
import type { Player, spec } from '@galacean/effects';
|
|
3
3
|
import type { LoadSceneOptions, LoadSceneECSResult } from './protocol';
|
|
4
|
-
import {
|
|
5
|
-
export declare class LoaderECSEx extends
|
|
4
|
+
import { LoaderECSImpl } from './loader-ecs';
|
|
5
|
+
export declare class LoaderECSEx extends LoaderECSImpl {
|
|
6
6
|
loadScene(options: LoadSceneOptions): Promise<LoadSceneECSResult>;
|
|
7
7
|
/**
|
|
8
8
|
* 检查序列化和反序列逻辑,排查渲染场景中渲染正常和编辑器中渲染错误的问题。
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Texture, Engine } from '@galacean/effects';
|
|
2
1
|
import { spec } from '@galacean/effects';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
2
|
+
import type { Texture, Engine, EffectComponentData, TextureSourceOptions, MaterialData } from '@galacean/effects';
|
|
3
|
+
import type { LoaderOptions, SkyboxType, LoadSceneOptions, LoadSceneECSResult, LoaderECS } from './protocol';
|
|
4
|
+
import type { ModelMeshComponentData, ModelSkyboxComponentData, ModelAnimationOptions, ModelCameraOptions, ModelLightOptions, ModelSkyboxOptions, ModelTreeOptions, ModelLightComponentData, ModelCameraComponentData } from '../index';
|
|
5
|
+
import type { GLTFImage, GLTFTexture, GLTFScene, GLTFLight, GLTFCamera, GLTFAnimation, GLTFResources } from '@vvfx/resource-detection';
|
|
6
6
|
import { PSkyboxType } from '../runtime/skybox';
|
|
7
|
-
export declare class LoaderECS {
|
|
7
|
+
export declare class LoaderECSImpl implements LoaderECS {
|
|
8
8
|
private sceneOptions;
|
|
9
9
|
private loaderOptions;
|
|
10
10
|
private gltfScene;
|
|
@@ -28,10 +28,18 @@ export declare class LoaderECS {
|
|
|
28
28
|
constructor(composition?: spec.Composition);
|
|
29
29
|
initial(engine: Engine, options?: LoaderOptions): void;
|
|
30
30
|
loadScene(options: LoadSceneOptions): Promise<LoadSceneECSResult>;
|
|
31
|
+
processGLTFResource(resource: GLTFResources): void;
|
|
32
|
+
processComponentData(components: EffectComponentData[]): void;
|
|
33
|
+
processLightComponentData(light: ModelLightComponentData): void;
|
|
34
|
+
processCameraComponentData(camera: ModelCameraComponentData): void;
|
|
35
|
+
processMeshComponentData(mesh: ModelMeshComponentData): void;
|
|
36
|
+
processSkyboxComponentData(skybox: ModelSkyboxComponentData): void;
|
|
37
|
+
processMaterialData(material: MaterialData): void;
|
|
38
|
+
processTextureOptions(options: TextureSourceOptions, isBaseColor: boolean): void;
|
|
39
|
+
processMaterialTexture(material: MaterialData, textureName: string, isBaseColor: boolean, dataMap: Record<string, TextureSourceOptions>): void;
|
|
31
40
|
getLoadResult(): LoadSceneECSResult;
|
|
32
41
|
addLight(data: ModelLight): void;
|
|
33
42
|
addCamera(camera: ModelCamera): void;
|
|
34
|
-
processMaterial(materials: GLTFMaterial[], fromGLTF: boolean): void;
|
|
35
43
|
createTreeOptions(scene: GLTFScene): ModelTreeOptions;
|
|
36
44
|
createAnimations(animations: GLTFAnimation[]): ModelAnimationOptions[];
|
|
37
45
|
createTexture2D(image: GLTFImage, texture: GLTFTexture, isBaseColor: boolean): Promise<Texture>;
|
|
@@ -39,7 +47,7 @@ export declare class LoaderECS {
|
|
|
39
47
|
scaleColorVal(val: number, fromGLTF: boolean): number;
|
|
40
48
|
scaleColorVec(vec: number[], fromGLTF: boolean): number[];
|
|
41
49
|
createLightOptions(light: GLTFLight): ModelLightOptions;
|
|
42
|
-
createCameraOptions(camera: GLTFCamera): ModelCameraOptions
|
|
50
|
+
createCameraOptions(camera: GLTFCamera): ModelCameraOptions;
|
|
43
51
|
private clear;
|
|
44
52
|
/**
|
|
45
53
|
* 按照传入的动画播放参数,计算需要播放的动画索引
|
|
@@ -84,3 +92,9 @@ export interface ModelLight {
|
|
|
84
92
|
duration: number;
|
|
85
93
|
endBehavior: spec.ItemEndBehavior;
|
|
86
94
|
}
|
|
95
|
+
export declare function getDefaultEffectsGLTFLoaderECS(engine: Engine, options?: LoaderOptions): LoaderECS;
|
|
96
|
+
export declare function setDefaultEffectsGLTFLoaderECS(loader: LoaderECS): void;
|
|
97
|
+
export declare function getPBRShaderProperties(): string;
|
|
98
|
+
export declare function getUnlitShaderProperties(): string;
|
|
99
|
+
export declare function getDefaultPBRMaterialData(): MaterialData;
|
|
100
|
+
export declare function getDefaultUnlitMaterialData(): MaterialData;
|
package/dist/gltf/protocol.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { GLTFMaterial, GLTFPrimitive, GLTFLight, GLTFScene, GLTFImage, GLTFTexture, GLTFCamera, GLTFAnimation, GLTFImageBasedLight } from '@vvfx/resource-detection';
|
|
1
|
+
import type { GLTFMaterial, GLTFPrimitive, GLTFLight, GLTFScene, GLTFImage, GLTFTexture, GLTFCamera, GLTFAnimation, GLTFImageBasedLight, GLTFResources } from '@vvfx/resource-detection';
|
|
2
2
|
import type { CubeImage } from '@vvfx/resource-detection/dist/src/gltf-tools/gltf-image-based-light';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { ModelAnimationOptions, ModelMaterialOptions, ModelSkyboxOptions, ModelTreeOptions, ModelBaseItem } from '../index';
|
|
3
|
+
import type { spec, Renderer, Texture, Geometry, TextureSourceOptions, EffectComponentData, MaterialData } from '@galacean/effects';
|
|
4
|
+
import type { ModelAnimationOptions, ModelMaterialOptions, ModelSkyboxOptions, ModelTreeOptions, ModelBaseItem, ModelLightComponentData, ModelCameraComponentData, ModelMeshComponentData, ModelSkyboxComponentData } from '../index';
|
|
6
5
|
/**
|
|
7
6
|
* glTF 场景文件加载选项,主要用于 Demo 测试或外部测试调用
|
|
8
7
|
*/
|
|
@@ -17,9 +16,9 @@ export interface LoadSceneOptions {
|
|
|
17
16
|
*/
|
|
18
17
|
resource: string | Uint8Array | GLTFResources;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* 兼容模式,目前支持 gltf 和 tiny3d
|
|
21
20
|
*/
|
|
22
|
-
compatibleMode?: 'gltf' | 'tiny3d'
|
|
21
|
+
compatibleMode?: 'gltf' | 'tiny3d';
|
|
23
22
|
/**
|
|
24
23
|
* 检查ResourceDetection序列化和反序列逻辑
|
|
25
24
|
*/
|
|
@@ -77,7 +76,7 @@ export interface LoadSceneECSResult {
|
|
|
77
76
|
};
|
|
78
77
|
}
|
|
79
78
|
export interface LoaderOptions {
|
|
80
|
-
compatibleMode?: 'gltf' | 'tiny3d'
|
|
79
|
+
compatibleMode?: 'gltf' | 'tiny3d';
|
|
81
80
|
}
|
|
82
81
|
export type SkyboxType = 'NFT' | 'FARM';
|
|
83
82
|
export interface Loader {
|
|
@@ -96,3 +95,14 @@ export interface Loader {
|
|
|
96
95
|
scaleColorVal(val: number, fromGLTF: boolean): number;
|
|
97
96
|
scaleColorVec(vec: number[], fromGLTF: boolean): number[];
|
|
98
97
|
}
|
|
98
|
+
export interface LoaderECS {
|
|
99
|
+
loadScene(options: LoadSceneOptions): Promise<LoadSceneECSResult>;
|
|
100
|
+
processGLTFResource(resource: GLTFResources): void;
|
|
101
|
+
processComponentData(components: EffectComponentData[]): void;
|
|
102
|
+
processLightComponentData(light: ModelLightComponentData): void;
|
|
103
|
+
processCameraComponentData(camera: ModelCameraComponentData): void;
|
|
104
|
+
processMeshComponentData(mesh: ModelMeshComponentData): void;
|
|
105
|
+
processSkyboxComponentData(skybox: ModelSkyboxComponentData): void;
|
|
106
|
+
processMaterialData(material: MaterialData): void;
|
|
107
|
+
processTextureOptions(options: TextureSourceOptions, isBaseColor: boolean): void;
|
|
108
|
+
}
|