@codexo/exojs-particles 0.15.3 → 0.16.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 (211) hide show
  1. package/README.md +21 -43
  2. package/dist/esm/ParticleStorage.d.ts +188 -0
  3. package/dist/esm/ParticleStorage.d.ts.map +1 -0
  4. package/dist/esm/ParticleStorage.js +208 -0
  5. package/dist/esm/ParticleStorage.js.map +1 -0
  6. package/dist/esm/ParticleSystem.d.ts +189 -60
  7. package/dist/esm/ParticleSystem.d.ts.map +1 -0
  8. package/dist/esm/ParticleSystem.js +660 -560
  9. package/dist/esm/ParticleSystem.js.map +1 -1
  10. package/dist/esm/distributions/BoxArea.d.ts +1 -0
  11. package/dist/esm/distributions/BoxArea.d.ts.map +1 -0
  12. package/dist/esm/distributions/BoxArea.js +38 -44
  13. package/dist/esm/distributions/BoxArea.js.map +1 -1
  14. package/dist/esm/distributions/CircleArea.d.ts +1 -0
  15. package/dist/esm/distributions/CircleArea.d.ts.map +1 -0
  16. package/dist/esm/distributions/CircleArea.js +30 -28
  17. package/dist/esm/distributions/CircleArea.js.map +1 -1
  18. package/dist/esm/distributions/ColorGradient.d.ts +3 -2
  19. package/dist/esm/distributions/ColorGradient.d.ts.map +1 -0
  20. package/dist/esm/distributions/ColorGradient.js +70 -75
  21. package/dist/esm/distributions/ColorGradient.js.map +1 -1
  22. package/dist/esm/distributions/ConeDirection.d.ts +2 -1
  23. package/dist/esm/distributions/ConeDirection.d.ts.map +1 -0
  24. package/dist/esm/distributions/ConeDirection.js +41 -39
  25. package/dist/esm/distributions/ConeDirection.js.map +1 -1
  26. package/dist/esm/distributions/Constant.d.ts +1 -0
  27. package/dist/esm/distributions/Constant.d.ts.map +1 -0
  28. package/dist/esm/distributions/Constant.js +32 -32
  29. package/dist/esm/distributions/Constant.js.map +1 -1
  30. package/dist/esm/distributions/Curve.d.ts +2 -1
  31. package/dist/esm/distributions/Curve.d.ts.map +1 -0
  32. package/dist/esm/distributions/Curve.js +46 -55
  33. package/dist/esm/distributions/Curve.js.map +1 -1
  34. package/dist/esm/distributions/Distribution.d.ts +4 -3
  35. package/dist/esm/distributions/Distribution.d.ts.map +1 -0
  36. package/dist/esm/distributions/LineSegment.d.ts +1 -0
  37. package/dist/esm/distributions/LineSegment.d.ts.map +1 -0
  38. package/dist/esm/distributions/LineSegment.js +25 -23
  39. package/dist/esm/distributions/LineSegment.js.map +1 -1
  40. package/dist/esm/distributions/Range.d.ts +1 -0
  41. package/dist/esm/distributions/Range.d.ts.map +1 -0
  42. package/dist/esm/distributions/Range.js +18 -16
  43. package/dist/esm/distributions/Range.js.map +1 -1
  44. package/dist/esm/distributions/VectorRange.d.ts +1 -0
  45. package/dist/esm/distributions/VectorRange.d.ts.map +1 -0
  46. package/dist/esm/distributions/VectorRange.js +29 -27
  47. package/dist/esm/distributions/VectorRange.js.map +1 -1
  48. package/dist/esm/distributions/index.d.ts +1 -0
  49. package/dist/esm/distributions/index.d.ts.map +1 -0
  50. package/dist/esm/gpu/ParticleGpuState.d.ts +143 -18
  51. package/dist/esm/gpu/ParticleGpuState.d.ts.map +1 -0
  52. package/dist/esm/gpu/ParticleGpuState.js +655 -497
  53. package/dist/esm/gpu/ParticleGpuState.js.map +1 -1
  54. package/dist/esm/gpu/shaders/particle-simulate.wgsl.js +6 -0
  55. package/dist/esm/gpu/shaders/particle-simulate.wgsl.js.map +1 -0
  56. package/dist/esm/index.d.ts +1 -0
  57. package/dist/esm/index.d.ts.map +1 -0
  58. package/dist/esm/index.js +39 -32
  59. package/dist/esm/modules/AlphaFadeOverLifetime.d.ts +4 -3
  60. package/dist/esm/modules/AlphaFadeOverLifetime.d.ts.map +1 -0
  61. package/dist/esm/modules/AlphaFadeOverLifetime.js +68 -55
  62. package/dist/esm/modules/AlphaFadeOverLifetime.js.map +1 -1
  63. package/dist/esm/modules/ApplyForce.d.ts +4 -3
  64. package/dist/esm/modules/ApplyForce.d.ts.map +1 -0
  65. package/dist/esm/modules/ApplyForce.js +49 -43
  66. package/dist/esm/modules/ApplyForce.js.map +1 -1
  67. package/dist/esm/modules/AttractToPoint.d.ts +4 -3
  68. package/dist/esm/modules/AttractToPoint.d.ts.map +1 -0
  69. package/dist/esm/modules/AttractToPoint.js +73 -62
  70. package/dist/esm/modules/AttractToPoint.js.map +1 -1
  71. package/dist/esm/modules/BurstSpawn.d.ts +6 -18
  72. package/dist/esm/modules/BurstSpawn.d.ts.map +1 -0
  73. package/dist/esm/modules/BurstSpawn.js +56 -91
  74. package/dist/esm/modules/BurstSpawn.js.map +1 -1
  75. package/dist/esm/modules/ColorOverLifetime.d.ts +4 -3
  76. package/dist/esm/modules/ColorOverLifetime.d.ts.map +1 -0
  77. package/dist/esm/modules/ColorOverLifetime.js +65 -53
  78. package/dist/esm/modules/ColorOverLifetime.js.map +1 -1
  79. package/dist/esm/modules/ColorOverSpeed.d.ts +5 -4
  80. package/dist/esm/modules/ColorOverSpeed.d.ts.map +1 -0
  81. package/dist/esm/modules/ColorOverSpeed.js +90 -75
  82. package/dist/esm/modules/ColorOverSpeed.js.map +1 -1
  83. package/dist/esm/modules/DeathModule.d.ts +26 -10
  84. package/dist/esm/modules/DeathModule.d.ts.map +1 -0
  85. package/dist/esm/modules/DeathModule.js +38 -22
  86. package/dist/esm/modules/DeathModule.js.map +1 -1
  87. package/dist/esm/modules/Drag.d.ts +3 -2
  88. package/dist/esm/modules/Drag.d.ts.map +1 -0
  89. package/dist/esm/modules/Drag.js +43 -37
  90. package/dist/esm/modules/Drag.js.map +1 -1
  91. package/dist/esm/modules/OrbitalForce.d.ts +4 -3
  92. package/dist/esm/modules/OrbitalForce.d.ts.map +1 -0
  93. package/dist/esm/modules/OrbitalForce.js +70 -58
  94. package/dist/esm/modules/OrbitalForce.js.map +1 -1
  95. package/dist/esm/modules/RateSpawn.d.ts +7 -22
  96. package/dist/esm/modules/RateSpawn.d.ts.map +1 -0
  97. package/dist/esm/modules/RateSpawn.js +39 -71
  98. package/dist/esm/modules/RateSpawn.js.map +1 -1
  99. package/dist/esm/modules/RepelFromPoint.d.ts +4 -3
  100. package/dist/esm/modules/RepelFromPoint.d.ts.map +1 -0
  101. package/dist/esm/modules/RepelFromPoint.js +72 -62
  102. package/dist/esm/modules/RepelFromPoint.js.map +1 -1
  103. package/dist/esm/modules/RotateOverLifetime.d.ts +3 -2
  104. package/dist/esm/modules/RotateOverLifetime.d.ts.map +1 -0
  105. package/dist/esm/modules/RotateOverLifetime.js +40 -36
  106. package/dist/esm/modules/RotateOverLifetime.js.map +1 -1
  107. package/dist/esm/modules/ScaleOverLifetime.d.ts +5 -4
  108. package/dist/esm/modules/ScaleOverLifetime.d.ts.map +1 -0
  109. package/dist/esm/modules/ScaleOverLifetime.js +60 -50
  110. package/dist/esm/modules/ScaleOverLifetime.js.map +1 -1
  111. package/dist/esm/modules/SpawnModule.d.ts +15 -12
  112. package/dist/esm/modules/SpawnModule.d.ts.map +1 -0
  113. package/dist/esm/modules/SpawnModule.js +32 -28
  114. package/dist/esm/modules/SpawnModule.js.map +1 -1
  115. package/dist/esm/modules/SpawnOnDeath.d.ts +13 -9
  116. package/dist/esm/modules/SpawnOnDeath.d.ts.map +1 -0
  117. package/dist/esm/modules/SpawnOnDeath.js +41 -43
  118. package/dist/esm/modules/SpawnOnDeath.js.map +1 -1
  119. package/dist/esm/modules/Turbulence.d.ts +4 -3
  120. package/dist/esm/modules/Turbulence.d.ts.map +1 -0
  121. package/dist/esm/modules/Turbulence.js +101 -89
  122. package/dist/esm/modules/Turbulence.js.map +1 -1
  123. package/dist/esm/modules/UpdateModule.d.ts +21 -13
  124. package/dist/esm/modules/UpdateModule.d.ts.map +1 -0
  125. package/dist/esm/modules/UpdateModule.js +65 -63
  126. package/dist/esm/modules/UpdateModule.js.map +1 -1
  127. package/dist/esm/modules/VelocityOverLifetime.d.ts +7 -6
  128. package/dist/esm/modules/VelocityOverLifetime.d.ts.map +1 -0
  129. package/dist/esm/modules/VelocityOverLifetime.js +75 -73
  130. package/dist/esm/modules/VelocityOverLifetime.js.map +1 -1
  131. package/dist/esm/modules/WgslContribution.d.ts +16 -15
  132. package/dist/esm/modules/WgslContribution.d.ts.map +1 -0
  133. package/dist/esm/modules/WgslContribution.js +37 -29
  134. package/dist/esm/modules/WgslContribution.js.map +1 -1
  135. package/dist/esm/modules/index.d.ts +3 -1
  136. package/dist/esm/modules/index.d.ts.map +1 -0
  137. package/dist/esm/modules/spawnFields.d.ts +32 -0
  138. package/dist/esm/modules/spawnFields.d.ts.map +1 -0
  139. package/dist/esm/modules/spawnFields.js +31 -0
  140. package/dist/esm/modules/spawnFields.js.map +1 -0
  141. package/dist/esm/particlesBuildInfo.d.ts +1 -0
  142. package/dist/esm/particlesBuildInfo.d.ts.map +1 -0
  143. package/dist/esm/particlesBuildInfo.js +6 -4
  144. package/dist/esm/particlesBuildInfo.js.map +1 -1
  145. package/dist/esm/particlesExtension.d.ts +13 -5
  146. package/dist/esm/particlesExtension.d.ts.map +1 -0
  147. package/dist/esm/particlesExtension.js +38 -42
  148. package/dist/esm/particlesExtension.js.map +1 -1
  149. package/dist/esm/public.d.ts +11 -0
  150. package/dist/esm/public.d.ts.map +1 -0
  151. package/dist/esm/renderModes/MeshParticles.d.ts +128 -0
  152. package/dist/esm/renderModes/MeshParticles.d.ts.map +1 -0
  153. package/dist/esm/renderModes/MeshParticles.js +263 -0
  154. package/dist/esm/renderModes/MeshParticles.js.map +1 -0
  155. package/dist/esm/renderModes/ParticleBufferLayout.d.ts +59 -0
  156. package/dist/esm/renderModes/ParticleBufferLayout.d.ts.map +1 -0
  157. package/dist/esm/renderModes/ParticleBufferLayout.js +99 -0
  158. package/dist/esm/renderModes/ParticleBufferLayout.js.map +1 -0
  159. package/dist/esm/renderModes/ParticleInstanceWriter.d.ts +58 -0
  160. package/dist/esm/renderModes/ParticleInstanceWriter.d.ts.map +1 -0
  161. package/dist/esm/renderModes/ParticleInstanceWriter.js +173 -0
  162. package/dist/esm/renderModes/ParticleInstanceWriter.js.map +1 -0
  163. package/dist/esm/renderModes/ParticleMaterial.d.ts +18 -0
  164. package/dist/esm/renderModes/ParticleMaterial.d.ts.map +1 -0
  165. package/dist/esm/renderModes/ParticleMaterial.js +24 -0
  166. package/dist/esm/renderModes/ParticleMaterial.js.map +1 -0
  167. package/dist/esm/renderModes/ParticleRenderMode.d.ts +114 -0
  168. package/dist/esm/renderModes/ParticleRenderMode.d.ts.map +1 -0
  169. package/dist/esm/renderModes/ParticleRenderMode.js +99 -0
  170. package/dist/esm/renderModes/ParticleRenderMode.js.map +1 -0
  171. package/dist/esm/renderModes/QuadParticles.d.ts +55 -0
  172. package/dist/esm/renderModes/QuadParticles.d.ts.map +1 -0
  173. package/dist/esm/renderModes/QuadParticles.js +95 -0
  174. package/dist/esm/renderModes/QuadParticles.js.map +1 -0
  175. package/dist/esm/renderModes/RibbonParticles.d.ts +96 -0
  176. package/dist/esm/renderModes/RibbonParticles.d.ts.map +1 -0
  177. package/dist/esm/renderModes/RibbonParticles.js +202 -0
  178. package/dist/esm/renderModes/RibbonParticles.js.map +1 -0
  179. package/dist/esm/renderModes/shaders/mesh-particles.wgsl.js +6 -0
  180. package/dist/esm/renderModes/shaders/mesh-particles.wgsl.js.map +1 -0
  181. package/dist/esm/renderModes/shaders/mesh.vert.js +6 -0
  182. package/dist/esm/renderModes/shaders/mesh.vert.js.map +1 -0
  183. package/dist/esm/renderModes/shaders/quad-particles.wgsl.js +6 -0
  184. package/dist/esm/renderModes/shaders/quad-particles.wgsl.js.map +1 -0
  185. package/dist/esm/renderModes/shaders/ribbon-particles.wgsl.js +6 -0
  186. package/dist/esm/renderModes/shaders/ribbon-particles.wgsl.js.map +1 -0
  187. package/dist/esm/renderModes/shaders/ribbon.frag.js +6 -0
  188. package/dist/esm/renderModes/shaders/ribbon.frag.js.map +1 -0
  189. package/dist/esm/renderModes/shaders/ribbon.vert.js +6 -0
  190. package/dist/esm/renderModes/shaders/ribbon.vert.js.map +1 -0
  191. package/dist/esm/renderers/WebGl2ParticleRenderer.d.ts +48 -20
  192. package/dist/esm/renderers/WebGl2ParticleRenderer.d.ts.map +1 -0
  193. package/dist/esm/renderers/WebGl2ParticleRenderer.js +317 -321
  194. package/dist/esm/renderers/WebGl2ParticleRenderer.js.map +1 -1
  195. package/dist/esm/renderers/WebGpuParticleRenderer.d.ts +99 -18
  196. package/dist/esm/renderers/WebGpuParticleRenderer.d.ts.map +1 -0
  197. package/dist/esm/renderers/WebGpuParticleRenderer.js +542 -551
  198. package/dist/esm/renderers/WebGpuParticleRenderer.js.map +1 -1
  199. package/dist/esm/renderers/shaders/particle.frag.js +6 -0
  200. package/dist/esm/renderers/shaders/particle.frag.js.map +1 -0
  201. package/dist/esm/renderers/shaders/particle.vert.js +6 -0
  202. package/dist/esm/renderers/shaders/particle.vert.js.map +1 -0
  203. package/package.json +8 -15
  204. package/dist/esm/index.js.map +0 -1
  205. package/dist/esm/register.d.ts +0 -1
  206. package/dist/esm/register.js +0 -43
  207. package/dist/esm/register.js.map +0 -1
  208. package/dist/esm/renderers/glsl/particle.frag.js +0 -4
  209. package/dist/esm/renderers/glsl/particle.frag.js.map +0 -1
  210. package/dist/esm/renderers/glsl/particle.vert.js +0 -4
  211. package/dist/esm/renderers/glsl/particle.vert.js.map +0 -1
@@ -1,7 +1,24 @@
1
1
  import type { Rectangle } from '@codexo/exojs';
2
2
  import type { Texture } from '@codexo/exojs';
3
- import type { UpdateModule } from "#modules/UpdateModule";
4
- import type { ParticleSystem } from "#ParticleSystem";
3
+ import type { UpdateModule } from '#modules/UpdateModule';
4
+ import type { ParticleSystem } from '#ParticleSystem';
5
+ /**
6
+ * One particle's state as the compute shader captured it at death, plus the
7
+ * slot it occupied. The slot orders the records; it never leaves the package.
8
+ * @internal
9
+ */
10
+ export interface ParticleDeathRecord {
11
+ readonly x: number;
12
+ readonly y: number;
13
+ readonly velocityX: number;
14
+ readonly velocityY: number;
15
+ readonly rotation: number;
16
+ readonly scaleX: number;
17
+ readonly scaleY: number;
18
+ readonly elapsed: number;
19
+ readonly color: number;
20
+ readonly slot: number;
21
+ }
5
22
  export declare class ParticleGpuState {
6
23
  readonly device: GPUDevice;
7
24
  readonly capacity: number;
@@ -13,14 +30,45 @@ export declare class ParticleGpuState {
13
30
  private readonly _rotInfo;
14
31
  private readonly _timing;
15
32
  private readonly _color;
16
- private readonly _textureIndex;
33
+ private readonly _instanceStorageBuffer;
34
+ /**
35
+ * Death records the compute shader appended, plus the atomic append counter
36
+ * in its first four bytes. Allocated only while the system has death modules,
37
+ * so a system without them pays neither the memory nor the copy.
38
+ *
39
+ * Detecting a death and reporting one have separate lifetimes, and the path
40
+ * between them has four stages: the shader appends here; records the copy has
41
+ * not taken yet stay here as a device-side backlog; a copy moves a batch into
42
+ * a staging slot; and the mapped batches are handed on in submission order.
43
+ */
44
+ private _deathBuffer;
45
+ private readonly _deathCounterReset;
46
+ /**
47
+ * Readback slots for the death buffer. A slot stays unavailable from the
48
+ * submit that copies into it until its map resolves, so a single slot would
49
+ * make every death that happens while a readback is in flight either a
50
+ * validation error or a lost record. Three slots cover the queue depth a
51
+ * frame loop runs at; a fourth death batch waits on the device instead.
52
+ */
53
+ private readonly _deathStaging;
54
+ /** Copies submitted into a staging slot, oldest first, awaiting delivery. */
55
+ private readonly _stagedDeaths;
56
+ /**
57
+ * Whether the death buffer holds records no readback has claimed yet. The
58
+ * append counter is reset only once a copy has taken them, so a step that
59
+ * finds no free staging slot leaves its records in place and the next step
60
+ * appends behind them.
61
+ */
62
+ private _deathBufferDirty;
63
+ /** Tail of the delivery chain, so batches are reported in submission order. */
64
+ private _deathDelivery;
17
65
  private readonly _simUniformBuffer;
18
66
  private readonly _simUniformData;
19
67
  private readonly _simUniformView;
20
- private readonly _moduleUniformBuffer;
21
- private readonly _moduleUniformData;
22
- private readonly _moduleUniformView;
23
- private readonly _moduleSlots;
68
+ private _moduleUniformBuffer;
69
+ private _moduleUniformData;
70
+ private _moduleUniformView;
71
+ private _moduleSlots;
24
72
  private readonly _framesUniformBuffer;
25
73
  private readonly _framesUniformData;
26
74
  private readonly _framesUniformView;
@@ -28,30 +76,107 @@ export declare class ParticleGpuState {
28
76
  private readonly _moduleTextures;
29
77
  private readonly _samplerFiltering;
30
78
  private readonly _samplerNonFiltering;
31
- private readonly _pipeline;
32
- private readonly _bindGroup0;
33
- private readonly _bindGroup1;
34
- constructor(device: GPUDevice, capacity: number, modules: readonly UpdateModule[], frames: readonly Rectangle[], texture: Texture);
35
- dispatch(system: ParticleSystem, dt: number): void;
79
+ private _pipelineWrapper;
80
+ private _bindGroup0;
81
+ private _bindGroup1;
82
+ private _reportsDeaths;
83
+ private _destroyed;
84
+ constructor(device: GPUDevice, capacity: number, modules: readonly UpdateModule[], frames: readonly Rectangle[], texture: Texture, reportsDeaths?: boolean);
85
+ /**
86
+ * Compiles the pipeline for `modules` and binds it to the buffers this state
87
+ * already owns.
88
+ *
89
+ * The simulation lives in those buffers, not in the program, so changing the
90
+ * module list rebuilds the shader, its uniforms and its lookup textures while
91
+ * every live particle keeps the position and velocity the GPU last integrated.
92
+ */
93
+ setProgram(modules: readonly UpdateModule[], reportsDeaths: boolean): void;
94
+ /** Releases everything the current program owns, leaving the simulation buffers untouched. */
95
+ private _destroyProgram;
96
+ /**
97
+ * Runs one simulation step over `[0, dispatchCount)`.
98
+ *
99
+ * `pendingDeaths` is how many expired particles the caller is still holding,
100
+ * including the ones it marked for this step. The shader appends exactly one
101
+ * record per marked particle, so the readback copies the used prefix of the
102
+ * death buffer without first having to read its counter back - the count is
103
+ * already known on this side.
104
+ *
105
+ * Returns whether a death batch was staged for readback. Deaths stay on the
106
+ * device while every staging slot is in flight, so a step can report deaths
107
+ * without staging any, and a later step can stage a batch spanning several
108
+ * steps. A caller keeping per-death state has to hold it, and keep counting it
109
+ * into `pendingDeaths`, until a step stages - then hand over all of it.
110
+ */
111
+ dispatch(dt: number, dispatchCount: number, pendingDeaths?: number): boolean;
112
+ /**
113
+ * Resolves the oldest staged death batch and hands its records to `receive`
114
+ * once the copy has landed.
115
+ *
116
+ * The mapping is asynchronous by nature, so a death is delivered no earlier
117
+ * than the frame after it happened. Batches are delivered in the order they
118
+ * were submitted, and nothing blocks on a map: further steps keep staging
119
+ * into other slots while one is in flight. A device that goes away mid-map
120
+ * resolves to nothing rather than throwing: the deaths are lost with the
121
+ * simulation that produced them.
122
+ */
123
+ readDeaths(receive: (records: readonly ParticleDeathRecord[]) => void): Promise<void>;
124
+ private _deliverDeaths;
125
+ /**
126
+ * Claims a staging slot able to hold `records`, or null while every slot of
127
+ * the ring is still in flight.
128
+ */
129
+ private _acquireDeathStaging;
130
+ private _releaseDeathStaging;
36
131
  destroy(): void;
37
132
  private _writeFrames;
38
133
  /**
39
134
  * Push the listed CPU SoA slots to the GPU. Called by `ParticleSystem`
40
135
  * with newly-spawned slots and just-expired slots (lifetime sentinel).
41
- * Slots not in the dirty set are left alone GPU keeps the integrated
136
+ * Slots not in the dirty set are left alone - GPU keeps the integrated
42
137
  * state from previous compute dispatches.
43
138
  *
44
- * Each dirty slot triggers 7 small `queue.writeBuffer` calls (one per
45
- * SoA channel). For typical spawn rates (≤200/s) this is negligible
46
- * (≤1400 calls/s); contiguous-range batching is a future optimisation.
139
+ * Each dirty slot triggers 7 small writes (one per SoA channel, via
140
+ * {@link WebGpuStorageBuffer.write}). For typical spawn rates (≤200/s)
141
+ * this is negligible (≤1400 calls/s); contiguous-range batching is a
142
+ * future optimisation.
47
143
  */
48
144
  uploadDirty(system: ParticleSystem, slots: Iterable<number>): void;
145
+ /**
146
+ * Marks `slot` expired for the device without touching anything else about
147
+ * it. Only the lifetime lane is written: a full slot upload would push the
148
+ * CPU's stale position and velocity over the values the device integrated,
149
+ * and those are exactly what the death record is supposed to carry.
150
+ */
151
+ uploadExpiry(slot: number): void;
152
+ private readonly _expiryScratch;
49
153
  private readonly _dirtyScratchVec2;
154
+ private readonly _dirtyScratchVec4;
50
155
  private readonly _dirtyScratchU32;
51
156
  private _writeSimUniforms;
52
157
  private _writeModuleUniforms;
53
- private _buildBindGroup0Layout;
54
- private _buildBindGroup0;
158
+ /**
159
+ * WGSL variable names of module lookup textures/samplers whose format isn't natively
160
+ * filterable (`r32float` Curve LUTs) - fed to {@link reflectComputeBindings} so it declares
161
+ * `'unfilterable-float'`/`'non-filtering'` for those specific bindings instead of the default
162
+ * `'float'`/`'filtering'`, an ambiguity the WGSL text itself can't resolve (see that
163
+ * function's doc comment).
164
+ */
165
+ private _nonFilteringResourceNames;
166
+ /** Group-0 bind-group entries, matching group 0's bindings (reflected from the shader text) one-to-one. */
167
+ private _buildBindGroup0Entries;
168
+ /** Group-1 bind-group entries: the 8 SoA storage buffers, matching group 1's bindings (reflected from the shader text) one-to-one. */
169
+ private _buildSoaBindGroupEntries;
55
170
  private _buildShader;
171
+ /**
172
+ * The block that captures a particle's state the first time the shader sees
173
+ * its expiry sentinel, or nothing when the system has no death modules.
174
+ *
175
+ * The CPU marks an expired particle with `lifetime = -1` and the shader
176
+ * rewrites that to `-2` once captured, so exactly one record is appended per
177
+ * death even though a dead slot is visited every frame until it is reused.
178
+ */
179
+ private _deathReportSource;
56
180
  private _renderModuleStruct;
57
181
  }
182
+ //# sourceMappingURL=ParticleGpuState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleGpuState.d.ts","sourceRoot":"","sources":["../../../src/gpu/ParticleGpuState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAwDtD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,SAAS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