@galacean/effects-plugin-model 2.0.0-alpha.2 → 2.0.0-alpha.21

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,13 +1,15 @@
1
- import type { Material, Texture } from '@galacean/effects';
1
+ import type { Texture, Material } from '@galacean/effects';
2
2
  import { spec } from '@galacean/effects';
3
- import type { ModelMaterialOptions, ModelMaterialUnlitOptions, ModelMaterialPBROptions } from '../index';
4
- import { Vector3, Vector4, Matrix3 } from './math';
5
- import { PMaterialType, PBlendMode, PFaceSideMode } from './common';
3
+ import type { MacroInfo } from '../index';
4
+ import type { Matrix3 } from './math';
5
+ import { Vector3, Vector4, Color } from './math';
6
+ import { PMaterialType } from './common';
6
7
  import { PObject } from './object';
7
8
  /**
8
9
  * 3D 材质基础类,支持公共的材质功能
9
10
  */
10
11
  export declare abstract class PMaterialBase extends PObject {
12
+ effectMaterial: Material;
11
13
  /**
12
14
  * 材质类型,主要是 pbr 和 unlit 两类
13
15
  */
@@ -23,28 +25,33 @@ export declare abstract class PMaterialBase extends PObject {
23
25
  /**
24
26
  * 深度是否写入,默认是写入
25
27
  */
26
- depthMask: boolean;
28
+ ZWrite: boolean;
27
29
  /**
28
30
  * 是否深度测试提示,默认开启
29
31
  */
30
- depthTestHint: boolean;
32
+ ZTest: boolean;
31
33
  /**
32
- * 混合模式,默认是不透明
34
+ * 渲染类型,默认是不透明
33
35
  */
34
- blendMode: PBlendMode;
36
+ renderType: spec.RenderType;
37
+ /**
38
+ * 是否 Alpha 裁剪,默认关闭
39
+ */
40
+ alphaClip: boolean;
35
41
  /**
36
42
  * Alpha 测试截断值
37
43
  */
38
- alphaCutOff: number;
44
+ alphaCutoff: number;
39
45
  /**
40
46
  * 面侧模式,默认是正面
41
47
  */
42
- faceSideMode: PFaceSideMode;
48
+ renderFace: spec.RenderFace;
43
49
  /**
44
50
  * 获取着色器特性列表,根据材质状态
45
51
  * @returns 特性列表
46
52
  */
47
53
  getShaderFeatures(): string[];
54
+ getShaderMacros(): MacroInfo[];
48
55
  /**
49
56
  * 根据材质状态,更新 GE 材质状态
50
57
  * @param material - GE 材质
@@ -56,18 +63,8 @@ export declare abstract class PMaterialBase extends PObject {
56
63
  * @param inFeatureList - 外部特性列表
57
64
  */
58
65
  build(inFeatureList?: string[]): void;
59
- /**
60
- * 获取混合模式,根据 GE 混合模式
61
- * @param mode - GE 混合模式
62
- * @returns
63
- */
64
- getBlendMode(mode?: spec.MaterialBlending): PBlendMode;
65
- /**
66
- * 获取面侧模式,根据 GE 面侧模式
67
- * @param mode - GE 面侧模式
68
- * @returns
69
- */
70
- getFaceSideMode(mode?: spec.SideMode): PFaceSideMode;
66
+ getFeatureList(inFeatureList?: string[]): string[];
67
+ getMacroList(inMacroList?: MacroInfo[]): MacroInfo[];
71
68
  /**
72
69
  * 设置材质状态,根据 GE 材质状态
73
70
  * @param material - GE 材质
@@ -89,52 +86,52 @@ export declare abstract class PMaterialBase extends PObject {
89
86
  */
90
87
  isOpaque(): boolean;
91
88
  /**
92
- * 是否遮罩
89
+ * 是否 Alpha 裁剪
93
90
  * @returns
94
91
  */
95
- isMasked(): boolean;
92
+ isAlphaClip(): boolean;
96
93
  /**
97
94
  * 是否半透明
98
95
  * @returns
99
96
  */
100
- isTranslucent(): boolean;
101
- /**
102
- * 是否加法混合
103
- * @returns
104
- */
105
- isAdditive(): boolean;
106
- /**
107
- * 是否需要混合
108
- * @returns
109
- */
110
- requireBlend(): boolean;
97
+ isTransparent(): boolean;
111
98
  /**
112
99
  * 是否正面模式
113
100
  * @returns
114
101
  */
115
- isFrontFace(): boolean;
102
+ isFrontSide(): boolean;
116
103
  /**
117
104
  * 是否背面模式
118
105
  * @returns
119
106
  */
120
- isBackFace(): boolean;
107
+ isBackSide(): boolean;
121
108
  /**
122
109
  * 是否双面模式
123
110
  * @returns
124
111
  */
125
- isBothFace(): boolean;
112
+ isBothSide(): boolean;
126
113
  }
127
114
  /**
128
115
  * 无光照材质类,负责无关照或者不接受光照情况下的物体材质效果
129
116
  */
130
117
  export declare class PMaterialUnlit extends PMaterialBase {
131
- private baseColorFactor;
132
- private baseColorTexture?;
118
+ /**
119
+ * 基础颜色纹理
120
+ */
121
+ baseColorTexture?: Texture;
122
+ /**
123
+ * 基础颜色纹理变换
124
+ */
125
+ baseColorTextureTrans: Matrix3;
126
+ /**
127
+ * 基础颜色值,默认是白色 Color(1, 1, 1, 1)
128
+ */
129
+ baseColorFactor: Color;
133
130
  /**
134
131
  * 创建无光照材质,支持基础颜色纹理
135
- * @param options - 无光照材质参数
132
+ * @param material - effect 材质对象
136
133
  */
137
- create(options: ModelMaterialUnlitOptions): void;
134
+ create(material: Material): void;
138
135
  /**
139
136
  * 销毁材质
140
137
  */
@@ -144,6 +141,7 @@ export declare class PMaterialUnlit extends PMaterialBase {
144
141
  * @returns 着色器特性列表
145
142
  */
146
143
  getShaderFeatures(): string[];
144
+ getShaderMacros(): MacroInfo[];
147
145
  /**
148
146
  * 更新对应的 GE 材质中着色器的 Uniform 数据
149
147
  * @param material - GE 材质
@@ -165,15 +163,15 @@ export declare class PMaterialUnlit extends PMaterialBase {
165
163
  */
166
164
  setBaseColorTexture(val: Texture): void;
167
165
  /**
168
- * 获取基础颜色值
166
+ * 获取基础颜色纹理
169
167
  * @returns
170
168
  */
171
- getBaseColorFactor(): Vector4;
169
+ getBaseColorFactor(): Color;
172
170
  /**
173
171
  * 设置基础颜色值
174
172
  * @param val - 颜色值
175
173
  */
176
- setBaseColorFactor(val: Vector4 | spec.vec4): void;
174
+ setBaseColorFactor(val: Color | Vector4 | spec.vec4): void;
177
175
  }
178
176
  /**
179
177
  * PBR 材质类,负责基于物理的材质效果,也是渲染中最常用的材质。
@@ -187,11 +185,11 @@ export declare class PMaterialPBR extends PMaterialBase {
187
185
  /**
188
186
  * 基础颜色纹理变换
189
187
  */
190
- baseColorTextureTrans?: Matrix3;
188
+ baseColorTextureTrans: Matrix3;
191
189
  /**
192
- * 基础颜色值,默认是白色 Vector4(1, 1, 1, 1)
190
+ * 基础颜色值,默认是白色 Color(1, 1, 1, 1)
193
191
  */
194
- baseColorFactor: Vector4;
192
+ baseColorFactor: Color;
195
193
  /**
196
194
  * 金属度粗超度纹理
197
195
  */
@@ -199,7 +197,7 @@ export declare class PMaterialPBR extends PMaterialBase {
199
197
  /**
200
198
  * 金属度粗超度纹理变换
201
199
  */
202
- metallicRoughnessTextureTrans?: Matrix3;
200
+ metallicRoughnessTextureTrans: Matrix3;
203
201
  /**
204
202
  * 是否高光抗锯齿,能够明显提升高光表现效果
205
203
  */
@@ -219,7 +217,7 @@ export declare class PMaterialPBR extends PMaterialBase {
219
217
  /**
220
218
  * 法线纹理变换
221
219
  */
222
- normalTextureTrans?: Matrix3;
220
+ normalTextureTrans: Matrix3;
223
221
  /**
224
222
  * 法线纹理缩放
225
223
  */
@@ -231,7 +229,7 @@ export declare class PMaterialPBR extends PMaterialBase {
231
229
  /**
232
230
  * AO 纹理变换
233
231
  */
234
- occlusionTextureTrans?: Matrix3;
232
+ occlusionTextureTrans: Matrix3;
235
233
  /**
236
234
  * AO 纹理强度
237
235
  */
@@ -243,21 +241,20 @@ export declare class PMaterialPBR extends PMaterialBase {
243
241
  /**
244
242
  * 自发光纹理变换
245
243
  */
246
- emissiveTextureTrans?: Matrix3;
244
+ emissiveTextureTrans: Matrix3;
247
245
  /**
248
- * 自发光颜色值,默认是黑色 Vector3(0, 0, 0)
246
+ * 自发光颜色值,默认是黑色 Vector4(0, 0, 0, 0)
249
247
  */
250
- emissiveFactor: Vector3;
248
+ emissiveFactor: Color;
251
249
  /**
252
250
  * 自发光强度
253
251
  */
254
252
  emissiveIntensity: number;
255
- enableShadow: boolean;
256
253
  /**
257
254
  * 创建材质
258
- * @param options - PBR 材质参数
255
+ * @param material - effect 材质对象
259
256
  */
260
- create(options: ModelMaterialPBROptions): void;
257
+ create(material: Material): void;
261
258
  /**
262
259
  * 销毁材质
263
260
  */
@@ -267,6 +264,7 @@ export declare class PMaterialPBR extends PMaterialBase {
267
264
  * @returns 材质特性列表
268
265
  */
269
266
  getShaderFeatures(): string[];
267
+ getShaderMacros(): MacroInfo[];
270
268
  /**
271
269
  * 更新关联的 GE 材质中着色器的 Uniform 数据
272
270
  * @param material - GE 材质
@@ -277,11 +275,6 @@ export declare class PMaterialPBR extends PMaterialBase {
277
275
  * @returns
278
276
  */
279
277
  hasBaseColorTexture(): boolean;
280
- /**
281
- * 是否有基础颜色纹理变换
282
- * @returns
283
- */
284
- hasBaseColorTextureTrans(): boolean;
285
278
  /**
286
279
  * 设置基础颜色纹理
287
280
  * @param val - 纹理
@@ -291,22 +284,17 @@ export declare class PMaterialPBR extends PMaterialBase {
291
284
  * 获取基础颜色纹理
292
285
  * @returns
293
286
  */
294
- getBaseColorFactor(): Vector4;
287
+ getBaseColorFactor(): Color;
295
288
  /**
296
289
  * 设置基础颜色值
297
290
  * @param val - 颜色值
298
291
  */
299
- setBaseColorFactor(val: Vector4 | spec.vec4): void;
292
+ setBaseColorFactor(val: Color | Vector4 | spec.vec4): void;
300
293
  /**
301
294
  * 是否有金属度粗超度纹理
302
295
  * @returns
303
296
  */
304
297
  hasMetallicRoughnessTexture(): boolean;
305
- /**
306
- * 是否有金属度粗超度纹理坐标变换
307
- * @returns
308
- */
309
- hasMetallicRoughnessTextureTrans(): boolean;
310
298
  /**
311
299
  * 获取金属度粗超度纹理
312
300
  * @returns
@@ -322,11 +310,6 @@ export declare class PMaterialPBR extends PMaterialBase {
322
310
  * @returns
323
311
  */
324
312
  hasNormalTexture(): boolean;
325
- /**
326
- * 是否有法线纹理坐标变换
327
- * @returns
328
- */
329
- hasNormalTextureTrans(): boolean;
330
313
  /**
331
314
  * 获取法线纹理
332
315
  * @returns
@@ -342,11 +325,6 @@ export declare class PMaterialPBR extends PMaterialBase {
342
325
  * @returns
343
326
  */
344
327
  hasOcclusionTexture(): boolean;
345
- /**
346
- * 是否有遮挡纹理坐标变换
347
- * @returns
348
- */
349
- hasOcclusionTextureTrans(): boolean;
350
328
  /**
351
329
  * 获取遮挡纹理
352
330
  * @returns
@@ -362,11 +340,6 @@ export declare class PMaterialPBR extends PMaterialBase {
362
340
  * @returns
363
341
  */
364
342
  hasEmissiveTexture(): boolean;
365
- /**
366
- * 是否有自发光纹理坐标变换
367
- * @returns
368
- */
369
- hasEmissiveTextureTrans(): boolean;
370
343
  /**
371
344
  * 获取自发光纹理
372
345
  * @returns
@@ -378,20 +351,30 @@ export declare class PMaterialPBR extends PMaterialBase {
378
351
  */
379
352
  setEmissiveTexture(val: Texture): void;
380
353
  /**
381
- * 是否有自发光颜色,包含强度
354
+ * 是否有自发光值,包含强度
382
355
  * @returns
383
356
  */
384
- hasEmissiveFactor(): boolean;
357
+ hasEmissiveValue(): boolean;
385
358
  /**
386
- * 获取自发光颜色,包含强度
359
+ * 获取自发光颜色
387
360
  * @returns
388
361
  */
389
- getEmissiveFactor(): Vector3;
362
+ getEmissiveFactor(): Color;
390
363
  /**
391
364
  * 设置自发光颜色
392
365
  * @param val - 颜色
393
366
  */
394
- setEmissiveFactor(val: Vector3 | spec.vec3): void;
367
+ setEmissiveFactor(val: Color | Vector3 | spec.vec3): void;
368
+ /**
369
+ * 获取自发光强度
370
+ * @returns
371
+ */
372
+ getEmissiveIntensity(): number;
373
+ /**
374
+ * 设置自发光强度
375
+ * @param val - 强度
376
+ */
377
+ setEmissiveIntensity(val: number): void;
395
378
  }
396
379
  /**
397
380
  * 材质类型,包括无光照材质和 PBR 材质
@@ -399,8 +382,7 @@ export declare class PMaterialPBR extends PMaterialBase {
399
382
  export type PMaterial = PMaterialUnlit | PMaterialPBR;
400
383
  /**
401
384
  * 创建插件材质对象
402
- * @param options - 材质参数
385
+ * @param material - Effects 材质对象
403
386
  * @returns 材质对象
404
387
  */
405
- export declare function createPluginMaterial(options: ModelMaterialOptions): PMaterial;
406
- export declare function createInternalMaterial(options: {}): {};
388
+ export declare function createPluginMaterial(material: Material): PMaterial;
@@ -1,5 +1,5 @@
1
1
  import { math } from '@galacean/effects';
2
- export declare const Vector2: typeof math.Vector2, Vector3: typeof math.Vector3, Vector4: typeof math.Vector4, Matrix3: typeof math.Matrix3, Matrix4: typeof math.Matrix4, Euler: typeof math.Euler, EulerOrder: typeof math.EulerOrder, Quaternion: typeof math.Quaternion, Box3: typeof math.Box3, Sphere: typeof math.Sphere, Ray: typeof math.Ray, DEG2RAD: number;
2
+ export declare const Vector2: typeof math.Vector2, Vector3: typeof math.Vector3, Vector4: typeof math.Vector4, Matrix3: typeof math.Matrix3, Matrix4: typeof math.Matrix4, Color: typeof math.Color, Euler: typeof math.Euler, EulerOrder: typeof math.EulerOrder, Quaternion: typeof math.Quaternion, Box3: typeof math.Box3, Sphere: typeof math.Sphere, Ray: typeof math.Ray, DEG2RAD: number;
3
3
  export type Ray = math.Ray;
4
4
  export type Euler = math.Euler;
5
5
  export type Vector2 = math.Vector2;
@@ -7,4 +7,5 @@ export type Vector3 = math.Vector3;
7
7
  export type Vector4 = math.Vector4;
8
8
  export type Matrix3 = math.Matrix3;
9
9
  export type Matrix4 = math.Matrix4;
10
+ export type Color = math.Color;
10
11
  export type Quaternion = math.Quaternion;
@@ -1,6 +1,6 @@
1
- import type { Geometry, Engine, math, VFXItemContent, VFXItem, Renderer } from '@galacean/effects';
2
- import { spec, Mesh, Material } from '@galacean/effects';
3
- import type { ModelMeshContent, ModelMaterialOptions, ModelPrimitiveOptions } 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
  */
@@ -75,12 +76,12 @@ export declare class PMesh extends PEntity {
75
76
  * 构造函数,创建 Mesh 对象,并与所属组件和父元素相关联
76
77
  * @param engine - 引擎
77
78
  * @param name - 名称
78
- * @param meshContent - Mesh 参数
79
+ * @param meshData - Mesh 参数
79
80
  * @param owner - 所属的 Mesh 组件
80
81
  * @param parentId - 父元素索引
81
82
  * @param parent - 父元素
82
83
  */
83
- constructor(engine: Engine, name: string, meshContent: ModelMeshContent, 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 - 场景管理器
@@ -115,7 +116,7 @@ export declare class PMesh extends PEntity {
115
116
  * @param parentId - 父元素索引
116
117
  * @param parentItem - 父 VFX 元素
117
118
  */
118
- updateParentInfo(parentId: string, parentItem: VFXItem<VFXItemContent>): void;
119
+ updateParentInfo(parentId: string, parentItem: VFXItem): void;
119
120
  /**
120
121
  * 根据当前场景状态更新内部材质数据
121
122
  * @param scene - 场景管理器
@@ -144,15 +145,11 @@ export declare class PMesh extends PEntity {
144
145
  * 是否有蒙皮
145
146
  */
146
147
  get hasSkin(): boolean;
147
- /**
148
- * 获取 GE Mesh 数组
149
- */
150
- get mriMeshs(): Mesh[];
151
148
  }
152
149
  /**
153
- * Primitive 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
150
+ * PSubMesh 类,负责 Sub Mesh相关的功能,支持骨骼动画和 PBR 渲染
154
151
  */
155
- export declare class PPrimitive {
152
+ export declare class PSubMesh {
156
153
  private engine;
157
154
  /**
158
155
  * 宿主 Mesh,包含了当前 Primitive
@@ -173,10 +170,6 @@ export declare class PPrimitive {
173
170
  * 名称
174
171
  */
175
172
  name: string;
176
- /**
177
- * GE Mesh
178
- */
179
- effectsMesh: Mesh;
180
173
  /**
181
174
  * 渲染优先级
182
175
  */
@@ -192,10 +185,10 @@ export declare class PPrimitive {
192
185
  constructor(engine: Engine);
193
186
  /**
194
187
  * 创建 Primitive 对象
195
- * @param options - Primitive 参数
188
+ * @param data - Primitive 参数
196
189
  * @param parent - 所属 Mesh 对象
197
190
  */
198
- create(options: ModelPrimitiveOptions, parent: PMesh): void;
191
+ create(geometry: Geometry, material: Material, parent: PMesh): void;
199
192
  /**
200
193
  * 创建 GE Mesh、Geometry 和 Material 对象,用于后面的渲染
201
194
  * 着色器部分 Uniform 数据来自 uniformSemantics
@@ -207,6 +200,7 @@ export declare class PPrimitive {
207
200
  [k: string]: any;
208
201
  }, skybox?: PSkybox): void;
209
202
  private getFeatureList;
203
+ private getMacroList;
210
204
  /**
211
205
  * 销毁,需要释放创建的 GE 对象
212
206
  */
@@ -260,12 +254,12 @@ export declare class PPrimitive {
260
254
  * 设置材质
261
255
  * @param val - 插件材质对象或材质参数
262
256
  */
263
- setMaterial(val: PMaterial | ModelMaterialOptions): void;
257
+ setMaterial(val: PMaterial | Material): void;
264
258
  /**
265
259
  * 获取 GE 材质
266
260
  * @returns
267
261
  */
268
- getModelMaterial(): Material;
262
+ getEffectsMaterial(): Material;
269
263
  /**
270
264
  * 是否无光照材质
271
265
  * @returns
@@ -354,4 +348,8 @@ export declare class PGeometry {
354
348
  */
355
349
  hasWeights(): boolean;
356
350
  }
351
+ export interface MacroInfo {
352
+ name: string;
353
+ value?: boolean | number;
354
+ }
357
355
  export {};
@@ -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';
@@ -10,4 +10,5 @@ export declare namespace StandardShaderSource {
10
10
  * @returns 最终代码
11
11
  */
12
12
  function build(source: string, features: string[], isWebGL2: boolean): string;
13
+ function getSourceCode(source: string, isWebGL2?: boolean): string;
13
14
  }
@@ -1,3 +1,4 @@
1
+ import { PMaterialType } from '../common';
1
2
  import type { PShaderContext } from '../shader';
2
3
  /**
3
4
  * 着色器代码生成类
@@ -19,4 +20,11 @@ export declare class StandardShader {
19
20
  * @returns
20
21
  */
21
22
  static getFragmentShaderCode(context: PShaderContext): string;
23
+ static genVertexShaderCode(materialType: PMaterialType, isWebGL2?: boolean): string;
24
+ /**
25
+ * 获取片段着色器代码
26
+ * @param materialType - 材质类型
27
+ * @returns
28
+ */
29
+ static genFragmentShaderCode(materialType: PMaterialType, isWebGL2?: boolean): string;
22
30
  }
@@ -1,6 +1,6 @@
1
1
  import type { Mesh, Material, TextureSourceOptions, Engine, Renderer } from '@galacean/effects';
2
- import { Texture } from '@galacean/effects';
3
- import type { ModelSkyboxOptions } from '../index';
2
+ import { spec, Texture } from '@galacean/effects';
3
+ import type { ModelSkyboxComponentData, ModelSkyboxOptions } from '../index';
4
4
  import { PEntity } from './object';
5
5
  import { PMaterialBase } from './material';
6
6
  import type { PSceneManager } from './scene';
@@ -68,10 +68,10 @@ export declare class PSkybox extends PEntity {
68
68
  /**
69
69
  * 构造函数
70
70
  * @param name - 名称
71
- * @param options - 天空盒参数
71
+ * @param data - 天空盒参数
72
72
  * @param owner - 所属天空盒组件元素
73
73
  */
74
- constructor(name: string, options: ModelSkyboxOptions, owner?: ModelSkyboxComponent);
74
+ constructor(name: string, data: ModelSkyboxComponentData, owner?: ModelSkyboxComponent);
75
75
  /**
76
76
  * 设置 BRDF 查询纹理
77
77
  * @param brdfLUT - 纹理
@@ -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,13 +304,21 @@ 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 - 引擎
299
314
  * @param params - 天空盒参数
300
315
  * @returns 纹理或未定义
301
316
  */
302
- static createDiffuseCubeMap(engine: Engine, params: PSkyboxParams): Promise<Texture | undefined>;
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 - 天空盒类型