@galacean/engine-core 2.0.0-alpha.55 → 2.0.0-alpha.57

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.
@@ -0,0 +1,415 @@
1
+ import type { Vector2 } from "@galacean/engine-math";
2
+ import type { PrimitiveMeshCapMode } from "./enums/PrimitiveMeshCapMode";
3
+ /**
4
+ * Settings shared by all primitive meshes.
5
+ */
6
+ export interface PrimitiveMeshOptions {
7
+ /**
8
+ * Whether to retain readable vertex attributes and indices after mesh creation.
9
+ * @defaultValue `false`
10
+ */
11
+ keepMeshData?: boolean;
12
+ }
13
+ /**
14
+ * A polygon in the XY plane, optionally containing holes.
15
+ * Either winding order is accepted for the outer contour and holes.
16
+ */
17
+ export interface PolygonShape {
18
+ /**
19
+ * The outer contour, with at least three distinct points. The closing point need not be repeated.
20
+ */
21
+ points: readonly Vector2[];
22
+ /**
23
+ * Contours cut out of the polygon, each with at least three distinct points.
24
+ * Closing points need not be repeated.
25
+ * @defaultValue No holes.
26
+ */
27
+ holes?: readonly (readonly Vector2[])[];
28
+ }
29
+ /**
30
+ * Settings for a sphere or an open spherical section generated from a subdivided cube.
31
+ */
32
+ export interface SphereMeshOptions extends PrimitiveMeshOptions {
33
+ /**
34
+ * The subdivision level, rounded down and clamped to 1 through 6.
35
+ * @defaultValue `3`
36
+ */
37
+ subdivisionLevel?: number;
38
+ /**
39
+ * The start (`x`) and end (`y`) horizontal angles in degrees, measured from -X towards +Z.
40
+ * The span is limited to 360 degrees. Section boundaries remain open.
41
+ * @defaultValue `new Vector2(0, 360)`
42
+ */
43
+ horizontalAngleRange?: Vector2;
44
+ /**
45
+ * The start (`x`) and end (`y`) polar angles in degrees, measured from +Y towards -Y.
46
+ * The interval is clipped to [0, 180].
47
+ * Section boundaries remain open.
48
+ * @defaultValue `new Vector2(0, 180)`
49
+ */
50
+ verticalAngleRange?: Vector2;
51
+ }
52
+ /**
53
+ * Settings for an axis-aligned cuboid centered at the origin.
54
+ */
55
+ export interface CuboidMeshOptions extends PrimitiveMeshOptions {
56
+ /**
57
+ * The number of subdivisions along X, rounded down with a minimum of 1.
58
+ * @defaultValue `1`
59
+ */
60
+ widthSegments?: number;
61
+ /**
62
+ * The number of subdivisions along Y, rounded down with a minimum of 1.
63
+ * @defaultValue The value of `widthSegments`.
64
+ */
65
+ heightSegments?: number;
66
+ /**
67
+ * The number of subdivisions along Z, rounded down with a minimum of 1.
68
+ * @defaultValue The value of `widthSegments`.
69
+ */
70
+ depthSegments?: number;
71
+ /**
72
+ * Whether to create one sub-mesh per face, ordered +Y, -Y, -X, +X, +Z, -Z.
73
+ * @defaultValue `false`
74
+ */
75
+ separateMaterialSlots?: boolean;
76
+ }
77
+ /**
78
+ * Settings for a plane in XZ facing +Y, centered at the origin.
79
+ */
80
+ export interface PlaneMeshOptions extends PrimitiveMeshOptions {
81
+ /**
82
+ * The number of subdivisions along X, rounded down with a minimum of 1.
83
+ * @defaultValue `1`
84
+ */
85
+ widthSegments?: number;
86
+ /**
87
+ * The number of subdivisions along Z, rounded down with a minimum of 1.
88
+ * @defaultValue The value of `widthSegments`.
89
+ */
90
+ depthSegments?: number;
91
+ }
92
+ /**
93
+ * Settings for a cylinder centered on Y with equal end radii.
94
+ */
95
+ export interface CylinderMeshOptions extends PrimitiveMeshOptions {
96
+ /**
97
+ * The number of segments around the circumference, rounded down with a minimum of 3.
98
+ * @defaultValue `20`
99
+ */
100
+ radialSegments?: number;
101
+ /**
102
+ * The number of subdivisions along Y, rounded down with a minimum of 1.
103
+ * @defaultValue `1`
104
+ */
105
+ heightSegments?: number;
106
+ /**
107
+ * The ends to cap. Zero-radius ends and angular cut boundaries remain open.
108
+ * @defaultValue `PrimitiveMeshCapMode.Both`
109
+ */
110
+ caps?: PrimitiveMeshCapMode;
111
+ /**
112
+ * The start (`x`) and end (`y`) angles in degrees around Y, measured from -Z towards -X.
113
+ * @defaultValue `new Vector2(0, 360)`
114
+ */
115
+ angleRange?: Vector2;
116
+ /**
117
+ * Whether to create separate sub-meshes for the side, top and bottom, in that order.
118
+ * Omitted or zero-radius caps do not occupy slots.
119
+ * @defaultValue `false`
120
+ */
121
+ separateMaterialSlots?: boolean;
122
+ }
123
+ /**
124
+ * Settings for a truncated cone centered on Y with independently sized ends.
125
+ */
126
+ export interface TruncatedConeMeshOptions extends PrimitiveMeshOptions {
127
+ /**
128
+ * The number of segments around the circumference, rounded down with a minimum of 3.
129
+ * @defaultValue `20`
130
+ */
131
+ radialSegments?: number;
132
+ /**
133
+ * The number of subdivisions along Y, rounded down with a minimum of 1.
134
+ * @defaultValue `1`
135
+ */
136
+ heightSegments?: number;
137
+ /**
138
+ * The ends to cap. Zero-radius ends have no caps, and angular cut boundaries remain open.
139
+ * @defaultValue `PrimitiveMeshCapMode.Both`
140
+ */
141
+ caps?: PrimitiveMeshCapMode;
142
+ /**
143
+ * The start (`x`) and end (`y`) angles in degrees around Y, measured from -Z towards -X.
144
+ * @defaultValue `new Vector2(0, 360)`
145
+ */
146
+ angleRange?: Vector2;
147
+ /**
148
+ * Whether to create separate sub-meshes for the side, top and bottom, in that order.
149
+ * Omitted or zero-radius caps do not occupy slots.
150
+ * @defaultValue `false`
151
+ */
152
+ separateMaterialSlots?: boolean;
153
+ }
154
+ /**
155
+ * Settings for a cone centered on Y with its tip at the top.
156
+ */
157
+ export interface ConeMeshOptions extends PrimitiveMeshOptions {
158
+ /**
159
+ * The number of segments around the circumference, rounded down with a minimum of 3.
160
+ * @defaultValue `20`
161
+ */
162
+ radialSegments?: number;
163
+ /**
164
+ * The number of subdivisions along Y, rounded down with a minimum of 1.
165
+ * @defaultValue `1`
166
+ */
167
+ heightSegments?: number;
168
+ /**
169
+ * Whether to cap the bottom. A zero-radius bottom and angular cut boundaries remain open.
170
+ * @defaultValue `true`
171
+ */
172
+ cap?: boolean;
173
+ /**
174
+ * The start (`x`) and end (`y`) angles in degrees around Y, measured from -Z towards -X.
175
+ * @defaultValue `new Vector2(0, 360)`
176
+ */
177
+ angleRange?: Vector2;
178
+ /**
179
+ * Whether to create separate sub-meshes for the side and bottom, in that order.
180
+ * An omitted or zero-radius bottom cap does not occupy a slot.
181
+ * @defaultValue `false`
182
+ */
183
+ separateMaterialSlots?: boolean;
184
+ }
185
+ /**
186
+ * Settings for a capsule centered on Y.
187
+ */
188
+ export interface CapsuleMeshOptions extends PrimitiveMeshOptions {
189
+ /**
190
+ * The number of segments around the circumference, rounded down with a minimum of 3.
191
+ * @defaultValue `6`
192
+ */
193
+ radialSegments?: number;
194
+ /**
195
+ * The number of subdivisions from each pole to the cylinder, rounded down with a minimum of 1.
196
+ * @defaultValue The value of `radialSegments`.
197
+ */
198
+ capSegments?: number;
199
+ /**
200
+ * The number of subdivisions along the cylinder, rounded down with a minimum of 1.
201
+ * @defaultValue `1`
202
+ */
203
+ heightSegments?: number;
204
+ }
205
+ /**
206
+ * Settings for a torus centered in XY around Z.
207
+ */
208
+ export interface TorusMeshOptions extends PrimitiveMeshOptions {
209
+ /**
210
+ * The number of segments around the torus, rounded down with a minimum of 1.
211
+ * @defaultValue `30`
212
+ */
213
+ ringSegments?: number;
214
+ /**
215
+ * The number of segments around the tube cross-section, rounded down with a minimum of 3.
216
+ * @defaultValue `30`
217
+ */
218
+ radialSegments?: number;
219
+ /**
220
+ * The start (`x`) and end (`y`) angles in degrees around Z, measured from +X towards +Y.
221
+ * Cut ends remain open.
222
+ * @defaultValue `new Vector2(0, 360)`
223
+ */
224
+ ringAngleRange?: Vector2;
225
+ /**
226
+ * The start (`x`) and end (`y`) tube cross-section angles in degrees, measured from the outward radial direction towards +Z.
227
+ * Cut boundaries remain open.
228
+ * @defaultValue `new Vector2(0, 360)`
229
+ */
230
+ tubeAngleRange?: Vector2;
231
+ }
232
+ /**
233
+ * Settings for a filled disk or sector in XY facing +Z.
234
+ */
235
+ export interface CircleMeshOptions extends PrimitiveMeshOptions {
236
+ /**
237
+ * The number of segments along the arc, rounded down with a minimum of 3.
238
+ * @defaultValue `32`
239
+ */
240
+ segments?: number;
241
+ /**
242
+ * The start (`x`) and end (`y`) angles in degrees, measured from +X towards +Y.
243
+ * @defaultValue `new Vector2(0, 360)`
244
+ */
245
+ angleRange?: Vector2;
246
+ }
247
+ /**
248
+ * Settings for a ring or ring sector in XY facing +Z.
249
+ */
250
+ export interface RingMeshOptions extends PrimitiveMeshOptions {
251
+ /**
252
+ * The number of segments along the arc, rounded down with a minimum of 3.
253
+ * @defaultValue `32`
254
+ */
255
+ ringSegments?: number;
256
+ /**
257
+ * The number of subdivisions between the inner and outer edges, rounded down with a minimum of 1.
258
+ * @defaultValue `1`
259
+ */
260
+ widthSegments?: number;
261
+ /**
262
+ * The start (`x`) and end (`y`) angles in degrees, measured from +X towards +Y.
263
+ * @defaultValue `new Vector2(0, 360)`
264
+ */
265
+ angleRange?: Vector2;
266
+ }
267
+ /**
268
+ * Settings shared by tetrahedra, octahedra, icosahedra and dodecahedra.
269
+ */
270
+ export interface RegularPolyhedronMeshOptions extends PrimitiveMeshOptions {
271
+ /**
272
+ * The number of subdivisions per triangle edge, rounded down with a minimum of 1.
273
+ * Values above 1 project the new vertices onto the sphere and use smooth normals.
274
+ * @defaultValue `1`
275
+ */
276
+ edgeSegments?: number;
277
+ }
278
+ /**
279
+ * Settings for a surface of revolution generated from a radius-height profile around Y.
280
+ */
281
+ export interface RevolvedSurfaceMeshOptions extends PrimitiveMeshOptions {
282
+ /**
283
+ * The number of segments along the revolution, rounded down with a minimum of 1.
284
+ * @defaultValue `12`
285
+ */
286
+ segments?: number;
287
+ /**
288
+ * The start (`x`) and end (`y`) angles in degrees around Y, measured from +Z towards +X.
289
+ * Cut boundaries remain open.
290
+ * @defaultValue `new Vector2(0, 360)`
291
+ */
292
+ angleRange?: Vector2;
293
+ }
294
+ /**
295
+ * Settings for sweeping a circular cross-section along a polyline.
296
+ */
297
+ export interface TubeMeshOptions extends PrimitiveMeshOptions {
298
+ /**
299
+ * The number of segments along the resampled path, rounded down with a minimum of 1.
300
+ * @defaultValue `64`
301
+ */
302
+ pathSegments?: number;
303
+ /**
304
+ * The number of segments around the cross-section, rounded down with a minimum of 3.
305
+ * @defaultValue `8`
306
+ */
307
+ radialSegments?: number;
308
+ /**
309
+ * Whether to join the path ends with matching cross-sections. The closing point need not be repeated.
310
+ * Open tubes have no end caps.
311
+ * @defaultValue `false`
312
+ */
313
+ closedPath?: boolean;
314
+ }
315
+ /**
316
+ * Settings for a zero-thickness polygon mesh in XY facing +Z.
317
+ */
318
+ export interface PolygonMeshOptions extends PrimitiveMeshOptions {
319
+ /**
320
+ * Whether to create one sub-mesh per polygon in input order. Holes share their outer contour's sub-mesh.
321
+ * @defaultValue `false`
322
+ */
323
+ separateMaterialSlots?: boolean;
324
+ }
325
+ /**
326
+ * Settings for extruding polygon contours along +Z.
327
+ */
328
+ export interface LinearExtrudedPolygonMeshOptions extends PrimitiveMeshOptions {
329
+ /**
330
+ * The number of subdivisions along the extrusion, rounded down with a minimum of 1.
331
+ * @defaultValue `1`
332
+ */
333
+ depthSegments?: number;
334
+ /**
335
+ * The inset of each end cap relative to the side wall in local units. Zero disables bevels.
336
+ * @defaultValue `0`
337
+ */
338
+ bevelWidth?: number;
339
+ /**
340
+ * The bevel depth at each end in local units, limited to half the extrusion depth.
341
+ * @defaultValue The value of `bevelWidth`.
342
+ */
343
+ bevelDepth?: number;
344
+ /**
345
+ * The side-wall contour offset in local units. Positive values expand the solid and contract holes.
346
+ * Applies even when bevels are disabled.
347
+ * @defaultValue `0`
348
+ */
349
+ contourOffset?: number;
350
+ /**
351
+ * The number of subdivisions per bevel, rounded down with a minimum of 1.
352
+ * @defaultValue `3`
353
+ */
354
+ bevelSegments?: number;
355
+ /**
356
+ * Whether each polygon contributes a cap sub-mesh followed by a wall sub-mesh, in input order.
357
+ * Both end caps share one slot; outer walls, hole walls and bevels share the next.
358
+ * @defaultValue `false`
359
+ */
360
+ separateMaterialSlots?: boolean;
361
+ }
362
+ /**
363
+ * Settings for sweeping polygon contours along a polyline, without bevels.
364
+ * Polygon X and Y coordinates become offsets along the moving cross-section's axes.
365
+ */
366
+ export interface PathExtrudedPolygonMeshOptions extends PrimitiveMeshOptions {
367
+ /**
368
+ * The number of subdivisions along the resampled path, rounded down with a minimum of 1, or 3 for closed paths.
369
+ * @defaultValue `1`, increased to `3` when `closedPath` is true.
370
+ */
371
+ pathSegments?: number;
372
+ /**
373
+ * Whether to join the path ends with matching cross-sections and omit end caps.
374
+ * The closing point need not be repeated.
375
+ * @defaultValue `false`
376
+ */
377
+ closedPath?: boolean;
378
+ /**
379
+ * Whether each polygon contributes a cap sub-mesh followed by a wall sub-mesh, in input order.
380
+ * Both end caps share one slot; outer and hole walls share the next. Closed paths use only the wall slot.
381
+ * @defaultValue `false`
382
+ */
383
+ separateMaterialSlots?: boolean;
384
+ }
385
+ /**
386
+ * Settings for a closed torus knot.
387
+ */
388
+ export interface TorusKnotMeshOptions extends PrimitiveMeshOptions {
389
+ /**
390
+ * The number of segments along the knot, rounded down with a minimum of 1.
391
+ * @defaultValue `64`
392
+ */
393
+ pathSegments?: number;
394
+ /**
395
+ * The number of segments around the tube cross-section, rounded down with a minimum of 3.
396
+ * @defaultValue `8`
397
+ */
398
+ radialSegments?: number;
399
+ }
400
+ /**
401
+ * Settings for an axis-aligned cuboid with rounded edges and corners.
402
+ */
403
+ export interface RoundedCuboidMeshOptions extends PrimitiveMeshOptions {
404
+ /**
405
+ * The rounding subdivision count, rounded down with a minimum of 1.
406
+ * When `cornerRadius` is positive, each face uses `2 * roundingSegments + 1` subdivisions per axis.
407
+ * @defaultValue `2`
408
+ */
409
+ roundingSegments?: number;
410
+ /**
411
+ * Whether to create one sub-mesh per face, ordered +Y, -Y, -X, +X, +Z, -Z.
412
+ * @defaultValue `false`
413
+ */
414
+ separateMaterialSlots?: boolean;
415
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * End caps generated for cylinders and truncated cones.
3
+ */
4
+ export declare enum PrimitiveMeshCapMode {
5
+ /**
6
+ * Generate both the top and bottom caps.
7
+ */
8
+ Both = "both",
9
+ /**
10
+ * Generate only the top cap, facing +Y.
11
+ */
12
+ Top = "top",
13
+ /**
14
+ * Generate only the bottom cap, facing -Y.
15
+ */
16
+ Bottom = "bottom",
17
+ /**
18
+ * Leave both ends open.
19
+ */
20
+ None = "none"
21
+ }
@@ -4,6 +4,8 @@ export { BufferMesh } from "./BufferMesh";
4
4
  export { MeshRenderer } from "./MeshRenderer";
5
5
  export { ModelMesh } from "./ModelMesh";
6
6
  export { PrimitiveMesh } from "./PrimitiveMesh";
7
+ export type { PrimitiveMeshOptions, SphereMeshOptions, CuboidMeshOptions, PlaneMeshOptions, CylinderMeshOptions, TruncatedConeMeshOptions, ConeMeshOptions, CapsuleMeshOptions, TorusMeshOptions, CircleMeshOptions, RingMeshOptions, RegularPolyhedronMeshOptions, RevolvedSurfaceMeshOptions, TubeMeshOptions, PolygonMeshOptions, TorusKnotMeshOptions, RoundedCuboidMeshOptions, PolygonShape, LinearExtrudedPolygonMeshOptions, PathExtrudedPolygonMeshOptions } from "./PrimitiveMeshOptions";
7
8
  export { Skin } from "./Skin";
8
9
  export { SkinnedMeshRenderer } from "./SkinnedMeshRenderer";
10
+ export { PrimitiveMeshCapMode } from "./enums/PrimitiveMeshCapMode";
9
11
  export { VertexAttribute } from "./enums/VertexAttribute";
@@ -0,0 +1,13 @@
1
+ import { Vector3 } from "@galacean/engine-math";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare class MeshPathUtils {
6
+ static sample(path: readonly Vector3[], divisions: number, closed: boolean, tangents?: Vector3[]): Vector3[];
7
+ static computeFrames(points: readonly Vector3[], closed: boolean, fallbackTangents?: readonly Vector3[]): {
8
+ normals: Vector3[];
9
+ binormals: Vector3[];
10
+ };
11
+ private static _normalize;
12
+ private static _rotate;
13
+ }
@@ -0,0 +1,44 @@
1
+ import { Vector2 } from "@galacean/engine-math";
2
+ import type { PolygonShape } from "../PrimitiveMeshOptions";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class PolygonUtils {
7
+ static prepareContours(shape: PolygonShape): Vector2[][];
8
+ static triangulateContours(contours: Vector2[][]): {
9
+ points: Vector2[];
10
+ indices: number[];
11
+ };
12
+ static triangulate(data: ArrayLike<number>, holeIndices?: ArrayLike<number>): number[];
13
+ private static _linkedList;
14
+ private static _filterPoints;
15
+ private static _earcutLinked;
16
+ private static _isEar;
17
+ private static _isEarHashed;
18
+ private static _cureLocalIntersections;
19
+ private static _splitEarcut;
20
+ private static _eliminateHoles;
21
+ private static _compareXYSlope;
22
+ private static _eliminateHole;
23
+ private static _findHoleBridge;
24
+ private static _sectorContainsSector;
25
+ private static _indexCurve;
26
+ private static _sortLinked;
27
+ private static _zOrder;
28
+ private static _getLeftmost;
29
+ private static _pointInTriangle;
30
+ private static _pointInTriangleExceptFirst;
31
+ private static _isValidDiagonal;
32
+ private static _area;
33
+ private static _equals;
34
+ private static _intersects;
35
+ private static _onSegment;
36
+ private static _sign;
37
+ private static _intersectsPolygon;
38
+ private static _locallyInside;
39
+ private static _middleInside;
40
+ private static _splitPolygon;
41
+ private static _insertNode;
42
+ private static _removeNode;
43
+ private static _signedArea;
44
+ }
@@ -0,0 +1,25 @@
1
+ import { Vector2, Vector3 } from "@galacean/engine-math";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare class PrimitiveMeshBuilder {
6
+ vertices: Float32Array;
7
+ indices: Uint16Array | Uint32Array;
8
+ vertexCount: number;
9
+ indexCount: number;
10
+ groups: {
11
+ start: number;
12
+ count: number;
13
+ }[];
14
+ boundsExtent?: Vector3;
15
+ constructor(vertexCapacity?: number, indexCapacity?: number);
16
+ addVertex(x: number, y: number, z: number, nx: number, ny: number, nz: number, u: number, v: number): number;
17
+ addTriangle(a: number, b: number, c: number): void;
18
+ addIndex(index: number): void;
19
+ addGroup(start: number): void;
20
+ addFace(a: Vector3, b: Vector3, c: Vector3, uvA: Vector2, uvB: Vector2, uvC: Vector2): void;
21
+ setData(vertices: Float32Array, indices: Uint16Array | Uint32Array): void;
22
+ trim(): void;
23
+ private _ensureVertexCapacity;
24
+ private _ensureIndexCapacity;
25
+ }
@@ -0,0 +1,15 @@
1
+ import { ContentRestorer } from "../../asset/ContentRestorer";
2
+ import { ModelMesh } from "../ModelMesh";
3
+ import { PrimitiveMeshBuilder } from "./PrimitiveMeshBuilder";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare class PrimitiveMeshRestorer<T extends unknown[]> extends ContentRestorer<ModelMesh> {
8
+ private _generate;
9
+ private _args;
10
+ private _vertexBuffer;
11
+ private _tangentBuffer;
12
+ private _indexBuffer;
13
+ constructor(mesh: ModelMesh, _generate: (...args: T) => PrimitiveMeshBuilder, _args: T);
14
+ restoreContent(): void;
15
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare class SubdivisionUtils {
5
+ static subdivideQuads(positions: ArrayLike<number>, quads: ArrayLike<number>, iterations: number): {
6
+ positions: Float32Array;
7
+ quads: Uint32Array;
8
+ };
9
+ }
@@ -1,6 +1,7 @@
1
1
  import type { Engine } from "../Engine";
2
2
  import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
3
3
  import type { ElementRangeMapping } from "../graphic/ElementRangeMapping";
4
+ import type { Shader } from "../shader/Shader";
4
5
  /**
5
6
  * Maintains parent trajectory state aligned with sub-emitted particle slots.
6
7
  * @internal
@@ -22,7 +23,7 @@ export declare class ParticleSubEmitterSpawnState {
22
23
  private _activeGatherProgram;
23
24
  get simulationBinding(): VertexBufferBinding;
24
25
  get renderBinding(): VertexBufferBinding;
25
- constructor(engine: Engine, particleCapacity: number, needsRenderBinding: boolean);
26
+ constructor(engine: Engine, shader: Shader, particleCapacity: number, needsRenderBinding: boolean);
26
27
  resize(particleCapacity: number, mappings: ReadonlyArray<ElementRangeMapping>): void;
27
28
  copyActiveRangeForRendering(firstActiveIndex: number, firstFreeIndex: number): void;
28
29
  enqueueParentTrajectory(parentTrajectoryBinding: VertexBufferBinding, parentIndex: number, firstChildIndex: number, childCount: number): void;
@@ -1,6 +1,7 @@
1
1
  import type { Engine } from "../Engine";
2
2
  import type { ElementRangeMapping } from "../graphic/ElementRangeMapping";
3
3
  import type { VertexBufferBinding } from "../graphic/VertexBufferBinding";
4
+ import type { Shader } from "../shader/Shader";
4
5
  import type { ShaderData } from "../shader/ShaderData";
5
6
  /**
6
7
  * @internal
@@ -22,12 +23,7 @@ export declare class ParticleTransformFeedbackSimulator {
22
23
  * The current read buffer binding for the render pass.
23
24
  */
24
25
  get readBinding(): VertexBufferBinding;
25
- /**
26
- * @param engine - Engine instance
27
- * @param trajectoryEnabled - Whether parent trajectory data is captured for sub-emitters
28
- * @param particleCount - Number of particle slots to allocate
29
- */
30
- constructor(engine: Engine, trajectoryEnabled: boolean, particleCount: number);
26
+ constructor(engine: Engine, shader: Shader, trajectoryEnabled: boolean, particleCount: number);
31
27
  /**
32
28
  * Resize feedback buffers.
33
29
  * @param particleCount - Number of particles to allocate
@@ -2,6 +2,7 @@ import { Camera } from "../Camera";
2
2
  import { Engine } from "../Engine";
3
3
  import { PipelinePass } from "../RenderPipeline/PipelinePass";
4
4
  import { RenderContext } from "../RenderPipeline/RenderContext";
5
+ import { Shader } from "../shader";
5
6
  import { RenderTarget } from "../texture";
6
7
  /**
7
8
  * @internal
@@ -12,7 +13,7 @@ export declare class FinalPass extends PipelinePass {
12
13
  private _srgbRenderTarget;
13
14
  private _antiAliasingMaterial;
14
15
  private _sRGBmaterial;
15
- constructor(engine: Engine);
16
+ constructor(engine: Engine, sRGBShader: Shader, antiAliasingShader: Shader);
16
17
  onConfig(camera: Camera, inputRenderTarget: RenderTarget): void;
17
18
  onRender(context: RenderContext): void;
18
19
  release(): void;
@@ -0,0 +1,27 @@
1
+ import type { Shader } from "./Shader";
2
+ /**
3
+ * @internal
4
+ */
5
+ export interface BuiltinShaders {
6
+ readonly blit: Shader;
7
+ readonly blitScreen: Shader;
8
+ readonly pbr: Shader;
9
+ readonly blinnPhong: Shader;
10
+ readonly unlit: Shader;
11
+ readonly skybox: Shader;
12
+ readonly skyProcedural: Shader;
13
+ readonly backgroundTexture: Shader;
14
+ readonly sprite: Shader;
15
+ readonly spriteMask: Shader;
16
+ readonly text: Shader;
17
+ readonly trail: Shader;
18
+ readonly ui: Shader;
19
+ readonly spine: Shader;
20
+ readonly particle: Shader;
21
+ readonly particleFeedback: Shader;
22
+ readonly uber: Shader;
23
+ readonly finalSRGB: Shader;
24
+ readonly finalAntiAliasing: Shader;
25
+ readonly bloom: Shader;
26
+ readonly scalableAmbientOcclusion: Shader;
27
+ }
@@ -71,8 +71,6 @@ export declare class Shader implements IReferable {
71
71
  */
72
72
  static find(name: string): Shader | undefined;
73
73
  /**
74
- * Create a shader from precompiled instructions.
75
- * @param data - Precompiled shader data
76
74
  * @internal
77
75
  */
78
76
  static _createFromPrecompiled(data: IPrecompiledShader): Shader;
@@ -29,6 +29,7 @@ export declare class ShaderPass extends ShaderPart {
29
29
  _renderStateDataMap: Record<number, ShaderProperty>;
30
30
  /** @internal */
31
31
  _shaderProgramMaps: ShaderProgramMap[];
32
+ private readonly _vertexOutputNames?;
32
33
  /**
33
34
  * Create a shader pass from precompiled instructions.
34
35
  * @param name - Shader pass name
@@ -36,8 +37,9 @@ export declare class ShaderPass extends ShaderPart {
36
37
  * @param fragmentShaderInstructions - Precompiled fragment instruction array
37
38
  * @param platformTarget - Target shader language
38
39
  * @param tags - Tags
40
+ * @param vertexOutputNames - Source output names mapped to generated GLSL names
39
41
  */
40
- constructor(name: string, vertexShaderInstructions: ShaderInstruction[], fragmentShaderInstructions: ShaderInstruction[], platformTarget: ShaderLanguage, tags?: Record<string, number | string | boolean>);
42
+ constructor(name: string, vertexShaderInstructions: ShaderInstruction[], fragmentShaderInstructions: ShaderInstruction[], platformTarget: ShaderLanguage, tags?: Record<string, number | string | boolean>, vertexOutputNames?: Readonly<Record<string, string>>);
41
43
  /**
42
44
  * @internal
43
45
  */
@@ -1,4 +1,5 @@
1
1
  export { BlendFactor } from "./enums/BlendFactor";
2
+ export type { BuiltinShaders } from "./BuiltinShaders";
2
3
  export { BlendOperation } from "./enums/BlendOperation";
3
4
  export { ColorWriteMask } from "./enums/ColorWriteMask";
4
5
  export { CompareFunction } from "./enums/CompareFunction";