@galacean/effects-plugin-model 2.0.0-alpha.10 → 2.0.0-alpha.12

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.
@@ -1,6 +1,6 @@
1
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';
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';
@@ -42,7 +42,7 @@ export declare class PMesh extends PEntity {
42
42
  /**
43
43
  * primitive 对象数组
44
44
  */
45
- primitives: PPrimitive[];
45
+ subMeshes: PSubMesh[];
46
46
  /**
47
47
  * 是否隐藏,默认是隐藏
48
48
  */
@@ -144,15 +144,11 @@ export declare class PMesh extends PEntity {
144
144
  * 是否有蒙皮
145
145
  */
146
146
  get hasSkin(): boolean;
147
- /**
148
- * 获取 GE Mesh 数组
149
- */
150
- get mriMeshs(): Mesh[];
151
147
  }
152
148
  /**
153
- * Primitive 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
149
+ * PSubMesh 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
154
150
  */
155
- export declare class PPrimitive {
151
+ export declare class PSubMesh {
156
152
  private engine;
157
153
  /**
158
154
  * 宿主 Mesh,包含了当前 Primitive
@@ -173,10 +169,6 @@ export declare class PPrimitive {
173
169
  * 名称
174
170
  */
175
171
  name: string;
176
- /**
177
- * GE Mesh
178
- */
179
- effectsMesh: Mesh;
180
172
  /**
181
173
  * 渲染优先级
182
174
  */
@@ -195,7 +187,7 @@ export declare class PPrimitive {
195
187
  * @param data - Primitive 参数
196
188
  * @param parent - 所属 Mesh 对象
197
189
  */
198
- create(data: ModelMeshPrimitiveData, parent: PMesh): void;
190
+ create(geometry: Geometry, material: Material, parent: PMesh): void;
199
191
  /**
200
192
  * 创建 GE Mesh、Geometry 和 Material 对象,用于后面的渲染
201
193
  * 着色器部分 Uniform 数据来自 uniformSemantics
@@ -266,7 +258,7 @@ export declare class PPrimitive {
266
258
  * 获取 GE 材质
267
259
  * @returns
268
260
  */
269
- getModelMaterial(): Material;
261
+ getEffectsMaterial(): Material;
270
262
  /**
271
263
  * 是否无光照材质
272
264
  * @returns
@@ -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(engine: Engine, 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(engine: Engine, 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(engine: Engine, params: PSkyboxParams): {
319
+ images: spec.Image[];
320
+ textureOptions: TextureSourceOptions;
321
+ } | undefined;
303
322
  /**
304
323
  * 创建天空盒参数
305
324
  * @param skyboxType - 天空盒类型
@@ -261,7 +261,7 @@ export declare class PluginHelper {
261
261
  * @param autoAdjustScene - 是否自动调整
262
262
  * @returns 场景信息描述
263
263
  */
264
- static preprocessScene(scene: Scene, runtimeEnv: string, compatibleMode: string, autoAdjustScene: boolean): EffectsSceneInfo;
264
+ static preprocessScene(scene: Scene, runtimeEnv: string, compatibleMode: string): EffectsSceneInfo;
265
265
  /**
266
266
  * 纹理参数预处理,设置环绕模式和滤波器
267
267
  * @param index - 纹理索引
@@ -270,7 +270,7 @@ export declare class PluginHelper {
270
270
  * @param tiny3dMode - 是否 Tiny3d 模式
271
271
  * @returns
272
272
  */
273
- static preprocessTextureOptions(index: number, textures: Array<TextureSourceOptions>, isBaseColor: boolean, tiny3dMode: boolean): void;
273
+ static preprocessTextureOptions(dataMap: Record<string, TextureSourceOptions>, textureInfo: spec.MaterialTextureProperty | spec.DataPath, isBaseColor: boolean, tiny3dMode: boolean): void;
274
274
  /**
275
275
  * 设置 3D 元素参数,在播放器创建 3D 元素前
276
276
  * @param scene - 场景
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-model",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.12",
4
4
  "description": "Galacean Effects player model plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -33,15 +33,15 @@
33
33
  "registry": "https://registry.npmjs.org"
34
34
  },
35
35
  "dependencies": {
36
- "@galacean/effects-helper": "2.0.0-alpha.10"
36
+ "@galacean/effects-helper": "2.0.0-alpha.12"
37
37
  },
38
38
  "devDependencies": {
39
- "@vvfx/resource-detection": "0.6.0-alpha.3",
39
+ "@vvfx/resource-detection": "0.6.0-alpha.5",
40
40
  "@types/hammerjs": "^2.0.45",
41
41
  "fpsmeter": "^0.3.1",
42
42
  "hammerjs": "^2.0.8",
43
- "@galacean/effects": "2.0.0-alpha.10",
44
- "@galacean/effects-plugin-editor-gizmo": "2.0.0-alpha.10"
43
+ "@galacean/effects": "2.0.0-alpha.12",
44
+ "@galacean/effects-plugin-editor-gizmo": "2.0.0-alpha.12"
45
45
  },
46
46
  "scripts": {
47
47
  "dev": "vite",
@@ -51,6 +51,6 @@
51
51
  "build:module": "rollup -c",
52
52
  "build:declaration": "tsc -d --emitDeclarationOnly",
53
53
  "build:demo": "rimraf dist && vite build",
54
- "clean": "rimraf dist && rimraf '*+(.tsbuildinfo)'"
54
+ "clean": "rimraf dist && rimraf \"*+(.tsbuildinfo)\""
55
55
  }
56
56
  }