@galacean/effects-plugin-model 2.0.0-alpha.9 → 2.0.0-beta.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 (46) hide show
  1. package/dist/alipay.js +13901 -0
  2. package/dist/alipay.js.map +1 -0
  3. package/dist/alipay.mjs +13782 -0
  4. package/dist/alipay.mjs.map +1 -0
  5. package/dist/douyin.js +13901 -0
  6. package/dist/douyin.js.map +1 -0
  7. package/dist/douyin.mjs +13782 -0
  8. package/dist/douyin.mjs.map +1 -0
  9. package/dist/gesture/index.d.ts +3 -3
  10. package/dist/gltf/index.d.ts +2 -1
  11. package/dist/gltf/json-converter.d.ts +54 -0
  12. package/dist/gltf/loader-ext.d.ts +6 -37
  13. package/dist/gltf/loader-impl.d.ts +76 -60
  14. package/dist/gltf/protocol.d.ts +49 -31
  15. package/dist/helper/index.d.ts +0 -1
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +3700 -1679
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.min.js +2 -2
  20. package/dist/index.min.js.map +1 -1
  21. package/dist/index.mjs +3458 -1476
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/loader.mjs +11268 -9286
  24. package/dist/loader.mjs.map +1 -1
  25. package/dist/plugin/model-item.d.ts +60 -11
  26. package/dist/plugin/model-plugin.d.ts +4 -3
  27. package/dist/plugin/model-tree-item.d.ts +5 -9
  28. package/dist/runtime/animation.d.ts +22 -15
  29. package/dist/runtime/cache.d.ts +1 -2
  30. package/dist/runtime/camera.d.ts +7 -2
  31. package/dist/runtime/index.d.ts +1 -0
  32. package/dist/runtime/material.d.ts +11 -17
  33. package/dist/runtime/mesh.d.ts +17 -24
  34. package/dist/runtime/scene.d.ts +15 -2
  35. package/dist/runtime/shader-libs/standard-shader-source.d.ts +1 -2
  36. package/dist/runtime/shader-libs/standard-shader.d.ts +2 -2
  37. package/dist/runtime/skybox.d.ts +21 -2
  38. package/dist/utility/plugin-helper.d.ts +6 -9
  39. package/dist/utility/shader-helper.d.ts +2 -2
  40. package/dist/weapp.js +13901 -0
  41. package/dist/weapp.js.map +1 -0
  42. package/dist/weapp.mjs +13782 -0
  43. package/dist/weapp.mjs.map +1 -0
  44. package/package.json +22 -7
  45. package/dist/gltf/loader-ecs-ext.d.ts +0 -24
  46. package/dist/gltf/loader-ecs.d.ts +0 -100
@@ -1,10 +1,10 @@
1
- import type { HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, Engine, Renderer } from '@galacean/effects';
2
- import { ItemBehaviour, RendererComponent, TimelineComponent } from '@galacean/effects';
3
- import { Vector3 } from '../runtime/math';
4
- import type { Euler } from '../runtime/math';
5
- import type { ModelItemBounding, ModelMeshComponentData, ModelCameraComponentData, ModelSkyboxComponentData, ModelLightComponentData } from '../index';
1
+ import type { Engine, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, Renderer, VFXItem } from '@galacean/effects';
2
+ import { Behaviour, RendererComponent, AnimationClip } from '@galacean/effects';
3
+ import type { ModelCameraComponentData, ModelItemBounding, ModelLightComponentData, ModelMeshComponentData, ModelSkyboxComponentData, AnimationComponentData } from '../index';
6
4
  import type { PSceneManager } from '../runtime';
7
5
  import { PCamera, PLight, PMesh, PSkybox } from '../runtime';
6
+ import type { Euler } from '../runtime/math';
7
+ import { Vector3 } from '../runtime/math';
8
8
  /**
9
9
  * 插件 Mesh 组件类,支持 3D Mesh 渲染能力
10
10
  * @since 2.0.0
@@ -27,6 +27,10 @@ export declare class ModelMeshComponent extends RendererComponent {
27
27
  * 场景管理器
28
28
  */
29
29
  sceneManager?: PSceneManager;
30
+ /**
31
+ * morph 动画权重
32
+ */
33
+ morphWeights: number[];
30
34
  /**
31
35
  * 构造函数,只保存传入参数,不在这里创建内部对象
32
36
  * @param engine - 引擎
@@ -42,6 +46,11 @@ export declare class ModelMeshComponent extends RendererComponent {
42
46
  * @param dt - 更新间隔
43
47
  */
44
48
  update(dt: number): void;
49
+ /**
50
+ * 组件晚更新,晚更新内部对象状态
51
+ * @param dt - 更新间隔
52
+ */
53
+ lateUpdate(dt: number): void;
45
54
  /**
46
55
  * 组件渲染,需要检查可见性
47
56
  * @param renderer - 渲染器
@@ -144,7 +153,7 @@ export declare class ModelSkyboxComponent extends RendererComponent {
144
153
  * @since 2.0.0
145
154
  * @internal
146
155
  */
147
- export declare class ModelLightComponent extends ItemBehaviour {
156
+ export declare class ModelLightComponent extends Behaviour {
148
157
  /**
149
158
  * 内部灯光对象
150
159
  */
@@ -196,7 +205,7 @@ export declare class ModelLightComponent extends ItemBehaviour {
196
205
  * @since 2.0.0
197
206
  * @internal
198
207
  */
199
- export declare class ModelCameraComponent extends ItemBehaviour {
208
+ export declare class ModelCameraComponent extends Behaviour {
200
209
  /**
201
210
  * 内部相机对象
202
211
  */
@@ -205,10 +214,6 @@ export declare class ModelCameraComponent extends ItemBehaviour {
205
214
  * 参数
206
215
  */
207
216
  data?: ModelCameraComponentData;
208
- /**
209
- * 时间轴组件
210
- */
211
- timeline?: TimelineComponent;
212
217
  /**
213
218
  * 构造函数,只保存传入参数,不在这里创建内部对象
214
219
  * @param engine - 引擎
@@ -248,3 +253,47 @@ export declare class ModelCameraComponent extends ItemBehaviour {
248
253
  */
249
254
  setTransform(position?: Vector3, rotation?: Euler): void;
250
255
  }
256
+ /**
257
+ * 插件动画组件类,支持 3D 动画能力
258
+ * @since 2.0.0
259
+ * @internal
260
+ */
261
+ export declare class AnimationComponent extends Behaviour {
262
+ /**
263
+ * 参数
264
+ */
265
+ data?: AnimationComponentData;
266
+ elapsedTime: number;
267
+ animation: number;
268
+ clips: ModelAnimationClip[];
269
+ /**
270
+ * 构造函数,只保存传入参数,不在这里创建内部对象
271
+ * @param engine - 引擎
272
+ */
273
+ constructor(engine: Engine);
274
+ /**
275
+ * 组件开始,需要创建内部对象和添加到场景管理器中
276
+ */
277
+ start(): void;
278
+ /**
279
+ * 组件更新,更新内部对象状态
280
+ * @param dt - 更新间隔
281
+ */
282
+ update(dt: number): void;
283
+ /**
284
+ * 组件销毁
285
+ */
286
+ onDestroy(): void;
287
+ /**
288
+ * 反序列化,记录传入参数
289
+ * @param data - 组件参数
290
+ */
291
+ fromData(data: AnimationComponentData): void;
292
+ }
293
+ declare class ModelAnimationClip extends AnimationClip {
294
+ path2Node: Record<string, VFXItem>;
295
+ sampleAnimation(vfxItem: VFXItem, time: number): void;
296
+ setFromAnimationClip(clip: AnimationClip): void;
297
+ getTargetItem(rootItem: VFXItem, path: string): VFXItem;
298
+ }
299
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { Scene, SceneLoadOptions, Composition, RenderFrame, Engine, Component, Renderer } from '@galacean/effects';
2
- import { AbstractPlugin, spec, ItemBehaviour } from '@galacean/effects';
2
+ import { AbstractPlugin, spec, Behaviour } from '@galacean/effects';
3
3
  import { CompositionCache } from '../runtime/cache';
4
4
  import { PSceneManager } from '../runtime';
5
5
  /**
@@ -51,7 +51,7 @@ export interface ModelPluginOptions {
51
51
  * @since 2.0.0
52
52
  * @internal
53
53
  */
54
- export declare class ModelPluginComponent extends ItemBehaviour {
54
+ export declare class ModelPluginComponent extends Behaviour {
55
55
  private runtimeEnv;
56
56
  private compatibleMode;
57
57
  private renderSkybox;
@@ -99,7 +99,7 @@ export declare class ModelPluginComponent extends ItemBehaviour {
99
99
  * 反序列化,创建场景管理器
100
100
  * @param date - 组件参数
101
101
  */
102
- fromData(data: any): void;
102
+ fromData(data: ModelPluginOptions): void;
103
103
  /**
104
104
  * 组件初始化,初始化场景管理器并更新合成相机
105
105
  * @param sceneParams - 场景参数
@@ -113,6 +113,7 @@ export declare class ModelPluginComponent extends ItemBehaviour {
113
113
  */
114
114
  private updateSceneCamera;
115
115
  private getLightItemCount;
116
+ private getMaxJointCount;
116
117
  }
117
118
  /**
118
119
  * 获取场景管理器,从合成中查找
@@ -1,6 +1,6 @@
1
- import { Transform, ItemBehaviour } from '@galacean/effects';
2
- import type { TimelineComponent, VFXItemContent, Engine, VFXItem } from '@galacean/effects';
3
- import type { ModelTreeOptions, ModelTreeContent } from '../index';
1
+ import type { Engine, VFXItem } from '@galacean/effects';
2
+ import { Behaviour, Transform } from '@galacean/effects';
3
+ import type { ModelTreeContent, ModelTreeOptions } from '../index';
4
4
  import { PAnimationManager } from '../runtime';
5
5
  /**
6
6
  * 场景树节点描述
@@ -47,7 +47,7 @@ export declare class ModelTreeItem {
47
47
  * @param props - 场景树数据
48
48
  * @param owner - 场景树元素
49
49
  */
50
- constructor(props: ModelTreeOptions, owner: VFXItem<VFXItemContent>);
50
+ constructor(props: ModelTreeOptions, owner: VFXItem);
51
51
  /**
52
52
  * 场景树更新,主要是动画更新
53
53
  * @param dt - 时间间隔
@@ -87,7 +87,7 @@ export declare class ModelTreeItem {
87
87
  * @since 2.0.0
88
88
  * @internal
89
89
  */
90
- export declare class ModelTreeComponent extends ItemBehaviour {
90
+ export declare class ModelTreeComponent extends Behaviour {
91
91
  /**
92
92
  * 内部节点树元素
93
93
  */
@@ -96,10 +96,6 @@ export declare class ModelTreeComponent extends ItemBehaviour {
96
96
  * 参数
97
97
  */
98
98
  options?: ModelTreeContent;
99
- /**
100
- * 时间轴组件
101
- */
102
- timeline?: TimelineComponent;
103
99
  /**
104
100
  * 构造函数,创建节点树元素
105
101
  * @param engine
@@ -1,6 +1,6 @@
1
- import type { Geometry, Engine, VFXItemContent, VFXItem } from '@galacean/effects';
1
+ import type { Geometry, Engine, VFXItem, SkinProps } from '@galacean/effects';
2
2
  import { Texture } from '@galacean/effects';
3
- import type { ModelSkinOptions, ModelAnimTrackOptions, ModelAnimationOptions, ModelTreeOptions } from '../index';
3
+ import type { ModelAnimTrackOptions, ModelAnimationOptions, ModelTreeOptions } from '../index';
4
4
  import { Matrix4 } from './math';
5
5
  import { PObject } from './object';
6
6
  import type { PSceneManager } from './scene';
@@ -19,7 +19,7 @@ export declare class PSkin extends PObject {
19
19
  /**
20
20
  * 场景树父元素
21
21
  */
22
- parentItem?: VFXItem<VFXItemContent>;
22
+ rootBoneItem?: VFXItem;
23
23
  /**
24
24
  * 骨骼索引
25
25
  */
@@ -27,7 +27,7 @@ export declare class PSkin extends PObject {
27
27
  /**
28
28
  * 关节索引
29
29
  */
30
- jointList: number[];
30
+ jointItem: VFXItem[];
31
31
  /**
32
32
  * 逆绑定矩阵
33
33
  */
@@ -40,13 +40,17 @@ export declare class PSkin extends PObject {
40
40
  * 纹理数据模式
41
41
  */
42
42
  textureDataMode: TextureDataMode;
43
+ /**
44
+ * 最大骨骼数目
45
+ */
46
+ maxJointCount: number;
43
47
  /**
44
48
  * 创建蒙皮对象
45
- * @param options - 蒙皮相关数据
49
+ * @param props - 蒙皮相关数据
46
50
  * @param engine - 引擎对象
47
- * @param parentItem - 场景树父元素
51
+ * @param rootBoneItem - 场景树父元素
48
52
  */
49
- create(options: ModelSkinOptions, engine: Engine, parentItem?: VFXItem<VFXItemContent>): void;
53
+ create(props: SkinProps, engine: Engine, rootBoneItem: VFXItem, maxJointCount: number): void;
50
54
  /**
51
55
  * 更新蒙皮矩阵
52
56
  */
@@ -62,7 +66,7 @@ export declare class PSkin extends PObject {
62
66
  * 更新父元素
63
67
  * @param parentItem - 场景树父元素
64
68
  */
65
- updateParentItem(parentItem: VFXItem<VFXItemContent>): void;
69
+ updateParentItem(parentItem: VFXItem): void;
66
70
  /**
67
71
  * 获取关节点数
68
72
  * @returns
@@ -78,6 +82,9 @@ export declare class PSkin extends PObject {
78
82
  */
79
83
  dispose(): void;
80
84
  private getTextureDataMode;
85
+ private getJointItems;
86
+ private genNodeName;
87
+ private genNodeNameDFS;
81
88
  }
82
89
  /**
83
90
  * Morph 动画类
@@ -95,7 +102,7 @@ export declare class PMorph extends PObject {
95
102
  * weights 数组的具体数据,来自动画控制器的每帧更新
96
103
  * 数组的长度必须和 morphWeightsLength 相同,否则会出错。
97
104
  */
98
- morphWeightsArray?: Float32Array;
105
+ morphWeightsArray: number[];
99
106
  /**
100
107
  * 是否有 Position 相关的 Morph 动画,shader 中需要知道
101
108
  */
@@ -114,12 +121,12 @@ export declare class PMorph extends PObject {
114
121
  * @returns 是否创建成功
115
122
  */
116
123
  create(geometry: Geometry): boolean;
117
- dispose(): void;
118
124
  /**
119
125
  * 初始化 Morph target 的权重数组
120
126
  * @param weights - glTF Mesh 的权重数组,长度必须严格一致
121
127
  */
122
128
  initWeights(weights: number[]): void;
129
+ updateWeights(weights: number[]): void;
123
130
  /**
124
131
  * 当前状态是否有 Morph 动画:
125
132
  * 需要判断 weights 数组长度,以及 Position、Normal 和 Tangent 是否有动画
@@ -133,7 +140,7 @@ export declare class PMorph extends PObject {
133
140
  * @returns 返回两个 Morph 动画状态是否相等
134
141
  */
135
142
  equals(morph: PMorph): boolean;
136
- getMorphWeightsArray(): Float32Array;
143
+ getMorphWeightsArray(): number[];
137
144
  /**
138
145
  * 统计 Geometry 中 Attribute 名称个数:
139
146
  * 主要用于统计 Morph 动画中新增的 Attribute 名称的个数,会作为最终的 weights 数组长度使用
@@ -216,7 +223,7 @@ export declare class PAnimTrack {
216
223
  * @param treeItem - 节点树元素
217
224
  * @param sceneManager - 3D 场景管理器
218
225
  */
219
- tick(time: number, treeItem: VFXItem<VFXItemContent>, sceneManager?: PSceneManager): void;
226
+ tick(time: number, treeItem: VFXItem, sceneManager?: PSceneManager): void;
220
227
  /**
221
228
  * 获取动画结束时间
222
229
  * @returns
@@ -290,7 +297,7 @@ export declare class PAnimation extends PObject {
290
297
  * @param treeItem - 场景树元素
291
298
  * @param sceneManager - 3D 场景管理器
292
299
  */
293
- tick(time: number, treeItem: VFXItem<VFXItemContent>, sceneManager?: PSceneManager): void;
300
+ tick(time: number, treeItem: VFXItem, sceneManager?: PSceneManager): void;
294
301
  /**
295
302
  * 销毁
296
303
  */
@@ -312,7 +319,7 @@ export declare class PAnimationManager extends PObject {
312
319
  * @param treeOptions - 场景树参数
313
320
  * @param ownerItem - 场景树所属元素
314
321
  */
315
- constructor(treeOptions: ModelTreeOptions, ownerItem: VFXItem<VFXItemContent>);
322
+ constructor(treeOptions: ModelTreeOptions, ownerItem: VFXItem);
316
323
  /**
317
324
  * 设置场景管理器
318
325
  * @param sceneManager - 场景管理器
@@ -337,5 +344,5 @@ export declare class PAnimationManager extends PObject {
337
344
  * 获取场景树元素
338
345
  * @returns
339
346
  */
340
- getTreeItem(): VFXItem<VFXItemContent>;
347
+ getTreeItem(): VFXItem;
341
348
  }
@@ -72,10 +72,9 @@ export declare class CompositionCache {
72
72
  * 获取滤波 Mesh
73
73
  * @param name - 名称
74
74
  * @param material - 材质
75
- * @param uniformSemantics - Uniform 语义信息
76
75
  * @returns
77
76
  */
78
- getFilterMesh(name: string, material: PMaterialBase, uniformSemantics: Record<string, any>): Mesh;
77
+ getFilterMesh(name: string, material: PMaterialBase): Mesh;
79
78
  getShadowBasePass(name: string, priority: number, meshList: Mesh[], fboOptions: FBOOptions): RenderPass;
80
79
  getShadowFilterPass(name: string, priority: number, meshList: Mesh[], fboOptions: FBOOptions): RenderPass;
81
80
  /**
@@ -34,6 +34,10 @@ export declare class PCamera extends PEntity {
34
34
  * Y 轴上视角
35
35
  */
36
36
  fov: number;
37
+ /**
38
+ * 视图矩阵
39
+ */
40
+ viewportMatrix: math.Matrix4;
37
41
  /**
38
42
  * 纵横比
39
43
  */
@@ -134,7 +138,8 @@ export declare class PCameraManager {
134
138
  dispose(): void;
135
139
  /**
136
140
  * 更新默认相机状态,并计算新的透视和相机矩阵
137
- * @param fovy - 视角
141
+ * @param fov - 视角
142
+ * @param viewportMatrix - 视图矩阵
138
143
  * @param aspect - 纵横比
139
144
  * @param nearPlane - 近裁剪平面
140
145
  * @param farPlane - 远裁剪平面
@@ -142,7 +147,7 @@ export declare class PCameraManager {
142
147
  * @param rotation - 旋转
143
148
  * @param clipMode - 剪裁模式
144
149
  */
145
- updateDefaultCamera(fovy: number, aspect: number, nearPlane: number, farPlane: number, position: Vector3, rotation: Quaternion, clipMode: number): void;
150
+ updateDefaultCamera(fov: number, viewportMatrix: Matrix4, aspect: number, nearPlane: number, farPlane: number, position: Vector3, rotation: Quaternion, clipMode: number): void;
146
151
  /**
147
152
  * 获取相机对象列表
148
153
  * @returns
@@ -10,3 +10,4 @@ export * from './object';
10
10
  export * from './scene';
11
11
  export * from './shader';
12
12
  export * from './skybox';
13
+ export * from './math';
@@ -5,16 +5,6 @@ import type { Matrix3 } from './math';
5
5
  import { Vector3, Vector4, Color } from './math';
6
6
  import { PMaterialType } from './common';
7
7
  import { PObject } from './object';
8
- export declare enum RenderType {
9
- Opaque = "Opaque",
10
- Mask = "Mask",
11
- Blend = "Blend"
12
- }
13
- export declare enum CullMode {
14
- Front = "Front",
15
- Back = "Back",
16
- Double = "Double"
17
- }
18
8
  /**
19
9
  * 3D 材质基础类,支持公共的材质功能
20
10
  */
@@ -43,15 +33,19 @@ export declare abstract class PMaterialBase extends PObject {
43
33
  /**
44
34
  * 渲染类型,默认是不透明
45
35
  */
46
- renderType: RenderType;
36
+ renderType: spec.RenderType;
37
+ /**
38
+ * 是否 Alpha 裁剪,默认关闭
39
+ */
40
+ alphaClip: boolean;
47
41
  /**
48
42
  * Alpha 测试截断值
49
43
  */
50
- alphaCutOff: number;
44
+ alphaCutoff: number;
51
45
  /**
52
46
  * 面侧模式,默认是正面
53
47
  */
54
- cullMode: CullMode;
48
+ renderFace: spec.RenderFace;
55
49
  /**
56
50
  * 获取着色器特性列表,根据材质状态
57
51
  * @returns 特性列表
@@ -92,15 +86,15 @@ export declare abstract class PMaterialBase extends PObject {
92
86
  */
93
87
  isOpaque(): boolean;
94
88
  /**
95
- * 是否遮罩
89
+ * 是否 Alpha 裁剪
96
90
  * @returns
97
91
  */
98
- isMasked(): boolean;
92
+ isAlphaClip(): boolean;
99
93
  /**
100
94
  * 是否半透明
101
95
  * @returns
102
96
  */
103
- isBlend(): boolean;
97
+ isTransparent(): boolean;
104
98
  /**
105
99
  * 是否正面模式
106
100
  * @returns
@@ -115,7 +109,7 @@ export declare abstract class PMaterialBase extends PObject {
115
109
  * 是否双面模式
116
110
  * @returns
117
111
  */
118
- isDoubleSide(): boolean;
112
+ isBothSide(): boolean;
119
113
  }
120
114
  /**
121
115
  * 无光照材质类,负责无关照或者不接受光照情况下的物体材质效果
@@ -1,6 +1,6 @@
1
- import type { Engine, math, VFXItemContent, VFXItem, Renderer, Geometry } from '@galacean/effects';
2
- import { spec, Mesh, Material } from '@galacean/effects';
3
- import type { ModelMeshComponentData, ModelMeshPrimitiveData } from '../index';
1
+ import type { Engine, math, VFXItem, Renderer, Geometry } from '@galacean/effects';
2
+ import { spec, Material } from '@galacean/effects';
3
+ import type { ModelMeshComponentData } from '../index';
4
4
  import { PEntity } from './object';
5
5
  import type { PMaterial } from './material';
6
6
  import { Matrix4, Vector3, Box3 } from './math';
@@ -26,11 +26,12 @@ export declare class PMesh extends PEntity {
26
26
  /**
27
27
  * 父元素
28
28
  */
29
- parentItem?: VFXItem<VFXItemContent>;
29
+ parentItem?: VFXItem;
30
30
  /**
31
31
  * 父元素索引
32
32
  */
33
33
  parentItemId?: string;
34
+ rootBoneItem?: VFXItem;
34
35
  /**
35
36
  * 蒙皮
36
37
  */
@@ -42,7 +43,7 @@ export declare class PMesh extends PEntity {
42
43
  /**
43
44
  * primitive 对象数组
44
45
  */
45
- primitives: PPrimitive[];
46
+ subMeshes: PSubMesh[];
46
47
  /**
47
48
  * 是否隐藏,默认是隐藏
48
49
  */
@@ -80,7 +81,7 @@ export declare class PMesh extends PEntity {
80
81
  * @param parentId - 父元素索引
81
82
  * @param parent - 父元素
82
83
  */
83
- constructor(engine: Engine, name: string, meshData: ModelMeshComponentData, owner?: ModelMeshComponent, parentId?: string, parent?: VFXItem<VFXItemContent>);
84
+ constructor(engine: Engine, name: string, meshData: ModelMeshComponentData, owner: ModelMeshComponent, parentId?: string, parent?: VFXItem);
84
85
  /**
85
86
  * 创建 GE 的 Mesh、Geometry 和 Material 对象
86
87
  * @param scene - 场景管理器
@@ -91,6 +92,10 @@ export declare class PMesh extends PEntity {
91
92
  * 更新变换数据和蒙皮数据
92
93
  */
93
94
  update(): void;
95
+ /**
96
+ * 更新骨骼动画
97
+ */
98
+ lateUpdate(): void;
94
99
  /**
95
100
  * 渲染 Mesh 对象,需要将内部相关数据传给渲染器
96
101
  * @param scene - 场景
@@ -115,7 +120,7 @@ export declare class PMesh extends PEntity {
115
120
  * @param parentId - 父元素索引
116
121
  * @param parentItem - 父 VFX 元素
117
122
  */
118
- updateParentInfo(parentId: string, parentItem: VFXItem<VFXItemContent>): void;
123
+ updateParentInfo(parentId: string, parentItem: VFXItem): void;
119
124
  /**
120
125
  * 根据当前场景状态更新内部材质数据
121
126
  * @param scene - 场景管理器
@@ -144,15 +149,11 @@ export declare class PMesh extends PEntity {
144
149
  * 是否有蒙皮
145
150
  */
146
151
  get hasSkin(): boolean;
147
- /**
148
- * 获取 GE Mesh 数组
149
- */
150
- get mriMeshs(): Mesh[];
151
152
  }
152
153
  /**
153
- * Primitive 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
154
+ * PSubMesh 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
154
155
  */
155
- export declare class PPrimitive {
156
+ export declare class PSubMesh {
156
157
  private engine;
157
158
  /**
158
159
  * 宿主 Mesh,包含了当前 Primitive
@@ -173,10 +174,6 @@ export declare class PPrimitive {
173
174
  * 名称
174
175
  */
175
176
  name: string;
176
- /**
177
- * GE Mesh
178
- */
179
- effectsMesh: Mesh;
180
177
  /**
181
178
  * 渲染优先级
182
179
  */
@@ -195,17 +192,13 @@ export declare class PPrimitive {
195
192
  * @param data - Primitive 参数
196
193
  * @param parent - 所属 Mesh 对象
197
194
  */
198
- create(data: ModelMeshPrimitiveData, parent: PMesh): void;
195
+ create(geometry: Geometry, material: Material, parent: PMesh): void;
199
196
  /**
200
197
  * 创建 GE Mesh、Geometry 和 Material 对象,用于后面的渲染
201
- * 着色器部分 Uniform 数据来自 uniformSemantics
202
198
  * @param lightCount - 灯光数目
203
- * @param uniformSemantics - Uniform 语义数据
204
199
  * @param skybox - 天空盒
205
200
  */
206
- build(lightCount: number, uniformSemantics: {
207
- [k: string]: any;
208
- }, skybox?: PSkybox): void;
201
+ build(lightCount: number, skybox?: PSkybox): void;
209
202
  private getFeatureList;
210
203
  private getMacroList;
211
204
  /**
@@ -266,7 +259,7 @@ export declare class PPrimitive {
266
259
  * 获取 GE 材质
267
260
  * @returns
268
261
  */
269
- getModelMaterial(): Material;
262
+ getEffectsMaterial(): Material;
270
263
  /**
271
264
  * 是否无光照材质
272
265
  * @returns
@@ -4,7 +4,8 @@ import { PMesh } from './mesh';
4
4
  import type { PCamera } from './camera';
5
5
  import { PCameraManager } from './camera';
6
6
  import { PLight, PLightManager } from './light';
7
- import { Vector3, Matrix4, Box3 } from './math';
7
+ import type { Vector3 } from './math';
8
+ import { Matrix4, Box3 } from './math';
8
9
  import { PSkybox } from './skybox';
9
10
  import type { CompositionCache } from './cache';
10
11
  import type { PEntity } from './object';
@@ -63,6 +64,10 @@ export interface PSceneOptions {
63
64
  * 灯光元素数目
64
65
  */
65
66
  lightItemCount: number;
67
+ /**
68
+ * 最大骨骼数目
69
+ */
70
+ maxJointCount: number;
66
71
  }
67
72
  /**
68
73
  * 场景状态接口,每次场景管理器 Tick 时都会生成
@@ -112,6 +117,10 @@ export interface PSceneStates {
112
117
  * 最大灯光数目
113
118
  */
114
119
  maxLightCount: number;
120
+ /**
121
+ * 最大骨骼数目
122
+ */
123
+ maxJointCount: number;
115
124
  /**
116
125
  * 天空盒对象
117
126
  */
@@ -174,6 +183,10 @@ export declare class PSceneManager {
174
183
  * 最多灯光数目
175
184
  */
176
185
  maxLightCount: number;
186
+ /**
187
+ * 最大骨骼数目
188
+ */
189
+ maxJointCount: number;
177
190
  /**
178
191
  * 场景状态
179
192
  */
@@ -209,7 +222,7 @@ export declare class PSceneManager {
209
222
  * 更新默认相机状态,根据传入的相机参数
210
223
  * @param camera - 相机参数
211
224
  */
212
- updateDefaultCamera(camera: CameraOptionsEx): void;
225
+ updateDefaultCamera(camera: CameraOptionsEx, viewportMatrix: Matrix4): void;
213
226
  /**
214
227
  * 更新插件场景,需要更新内部的相关的插件对象,特别是 Mesh 对象的骨骼动画
215
228
  * 并将需要渲染的对象添加到渲染对象集合中
@@ -9,6 +9,5 @@ export declare namespace StandardShaderSource {
9
9
  * @param isWebGL2 - 是否 WebGL2
10
10
  * @returns 最终代码
11
11
  */
12
- function build(source: string, features: string[], isWebGL2: boolean): string;
13
- function getSourceCode(source: string, isWebGL2?: boolean): string;
12
+ function build(source: string, features: string[]): string;
14
13
  }
@@ -20,11 +20,11 @@ export declare class StandardShader {
20
20
  * @returns
21
21
  */
22
22
  static getFragmentShaderCode(context: PShaderContext): string;
23
- static genVertexShaderCode(materialType: PMaterialType, isWebGL2?: boolean): string;
23
+ static genVertexShaderCode(materialType: PMaterialType): string;
24
24
  /**
25
25
  * 获取片段着色器代码
26
26
  * @param materialType - 材质类型
27
27
  * @returns
28
28
  */
29
- static genFragmentShaderCode(materialType: PMaterialType, isWebGL2?: boolean): string;
29
+ static genFragmentShaderCode(materialType: PMaterialType): string;
30
30
  }
@@ -1,5 +1,5 @@
1
1
  import type { Mesh, Material, TextureSourceOptions, Engine, Renderer } from '@galacean/effects';
2
- import { Texture } from '@galacean/effects';
2
+ import { spec, Texture } from '@galacean/effects';
3
3
  import type { ModelSkyboxComponentData, ModelSkyboxOptions } from '../index';
4
4
  import { PEntity } from './object';
5
5
  import { PMaterialBase } from './material';
@@ -212,7 +212,7 @@ export interface PSkyboxBaseParams {
212
212
  /**
213
213
  * 辐射照度系数
214
214
  */
215
- irradianceCoeffs?: number[][];
215
+ irradianceCoeffs?: number[];
216
216
  /**
217
217
  * 高光贴图 Mip 层数
218
218
  */
@@ -286,6 +286,17 @@ export declare class PSkyboxCreator {
286
286
  * @returns 天空盒选项
287
287
  */
288
288
  static createSkyboxOptions(engine: Engine, params: PSkyboxParams): Promise<ModelSkyboxOptions>;
289
+ /**
290
+ * 创建天空盒选项
291
+ * @param engine - 引擎
292
+ * @param params - 天空盒参数
293
+ * @returns 天空盒选项
294
+ */
295
+ static createSkyboxComponentData(params: PSkyboxParams): {
296
+ imageList: spec.Image[];
297
+ textureOptionsList: TextureSourceOptions[];
298
+ component: spec.SkyboxComponentData;
299
+ };
289
300
  /**
290
301
  * 创建高光 Cube Map 纹理
291
302
  * @param engine - 引擎
@@ -293,6 +304,10 @@ export declare class PSkyboxCreator {
293
304
  * @returns 纹理
294
305
  */
295
306
  static createSpecularCubeMap(engine: Engine, params: PSkyboxParams): Promise<Texture>;
307
+ static getSpecularCubeMapData(params: PSkyboxParams): {
308
+ images: spec.Image[];
309
+ textureOptions: TextureSourceOptions;
310
+ };
296
311
  /**
297
312
  * 创建漫反射纹理
298
313
  * @param engine - 引擎
@@ -300,6 +315,10 @@ export declare class PSkyboxCreator {
300
315
  * @returns 纹理或未定义
301
316
  */
302
317
  static createDiffuseCubeMap(engine: Engine, params: PSkyboxParams): Promise<Texture | null>;
318
+ static getDiffuseCubeMapData(params: PSkyboxParams): {
319
+ images: spec.Image[];
320
+ textureOptions: TextureSourceOptions;
321
+ } | undefined;
303
322
  /**
304
323
  * 创建天空盒参数
305
324
  * @param skyboxType - 天空盒类型