@codexo/exojs-particles 0.15.2 → 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 +7 -14
  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 +1 @@
1
- {"version":3,"file":"WebGpuParticleRenderer.js","sources":["../../../../src/renderers/WebGpuParticleRenderer.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAWA,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE5B;AAED,MAAM,uBAAuB,GAAG,CAAC;AACjC,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,mBAAmB,GAAG,EAAE;AAC9B,MAAM,kBAAkB,GAAG,CAAC;AAC5B,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,uBAAuB,GAAG,CAAC;AACjC,MAAM,gBAAgB,GA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CAAA,cAAc,EAAE,CAAC;AACjB,gCAAA,MAAM,EAAE,EAAE;AACV,gCAAA,MAAM,EAAE,UAAU;AACnB,6BAAA;AACD,4BAAA;AACE,gCAAA,cAAc,EAAE,CAAC;AACjB,gCAAA,MAAM,EAAE,EAAE;AACV,gCAAA,MAAM,EAAE,WAAW;AACpB,6BAAA;AACD,4BAAA;AACE,gCAAA,cAAc,EAAE,CAAC;AACjB,gCAAA,MAAM,EAAE,EAAE;AACV,gCAAA,MAAM,EAAE,WAAW;AACpB,6BAAA;AACF,yBAAA;AACF,qBAAA;AACF,iBAAA;AACF,aAAA;AACD,YAAA,QAAQ,EAAE;gBACR,MAAM,EAAE,IAAI,CAAC,aAAc;AAC3B,gBAAA,UAAU,EAAE,cAAc;AAC1B,gBAAA,OAAO,EAAE;AACP,oBAAA;wBACE,MAAM;AACN,wBAAA,KAAK,EAAE,mBAAmB,CAAC,SAAS,CAAC;wBACrC,SAAS,EAAE,aAAa,CAAC,GAAG;AAC7B,qBAAA;AACF,iBAAA;AACF,aAAA;AACD,YAAA,SAAS,EAAE;AACT,gBAAA,QAAQ,EAAE,eAAe;AAC1B,aAAA;SACF;QAED,IAAI,OAAO,EAAE;AACX,YAAA,UAAU,CAAC,YAAY,GAAG,+BAA+B,EAAE;QAC7D;QAEA,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC;QAE/D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC;AAE1C,QAAA,OAAO,QAAQ;IACjB;AACD;;;;"}
1
+ {"version":3,"file":"WebGpuParticleRenderer.js","names":[],"sources":["../../../src/renderers/WebGpuParticleRenderer.ts"],"sourcesContent":["/// <reference types=\"@webgpu/types\" />\n\nimport type { GeometryAttribute, Material } from '@codexo/exojs';\nimport type { BlendModes } from '@codexo/exojs/renderer-sdk';\nimport type { WebGpuActiveRenderPass, WebGpuBackend } from '@codexo/exojs/renderer-sdk';\nimport { DataTexture } from '@codexo/exojs/renderer-sdk';\nimport { Texture } from '@codexo/exojs/renderer-sdk';\nimport { AbstractWebGpuRenderer } from '@codexo/exojs/renderer-sdk';\nimport { getWebGpuBlendState } from '@codexo/exojs/renderer-sdk';\nimport { stencilContentDepthStencilState } from '@codexo/exojs/renderer-sdk';\n\nimport type { ParticleSystem } from '#ParticleSystem';\nimport { assertVertexGeometryCompatible } from '#renderModes/ParticleBufferLayout';\nimport type { ParticleRenderMode } from '#renderModes/ParticleRenderMode';\n\nconst uniformByteLength = 176;\n/**\n * Stride of one draw call's slot in the uniform ring. `setBindGroup`'s dynamic\n * offset must be a multiple of the device's `minUniformBufferOffsetAlignment`,\n * whose spec-mandated maximum is 256 - so a fixed 256 is valid on every device\n * and needs no limit query.\n */\nconst uniformSlotStride = 256;\n\n/**\n * WebGPU vertex formats by `<n?><type>x<size>` key, where the leading `n`\n * marks a normalised integer attribute. WebGPU has no 1- or 3-component 8/16-bit\n * formats, so those combinations are deliberately absent and reported as an\n * error rather than silently widened.\n */\nconst vertexFormatsByKey: Record<string, GPUVertexFormat> = {\n f32x1: 'float32',\n f32x2: 'float32x2',\n f32x3: 'float32x3',\n f32x4: 'float32x4',\n u8x2: 'uint8x2',\n u8x4: 'uint8x4',\n nu8x2: 'unorm8x2',\n nu8x4: 'unorm8x4',\n u16x2: 'uint16x2',\n u16x4: 'uint16x4',\n nu16x2: 'unorm16x2',\n nu16x4: 'unorm16x4',\n u32x1: 'uint32',\n u32x2: 'uint32x2',\n u32x3: 'uint32x3',\n u32x4: 'uint32x4',\n i32x1: 'sint32',\n i32x2: 'sint32x2',\n i32x3: 'sint32x3',\n i32x4: 'sint32x4',\n};\n\nconst resolveVertexFormat = (attribute: GeometryAttribute): GPUVertexFormat => {\n // `normalized` is meaningless for floats - WebGL2 ignores it for GL_FLOAT\n // too, so the two backends agree on what such a declaration means.\n const normalized = attribute.normalized && attribute.type !== 'f32';\n const format = vertexFormatsByKey[`${normalized ? 'n' : ''}${attribute.type}x${attribute.size}`];\n\n if (format === undefined) {\n throw new Error(`WebGpuParticleRenderer: attribute \"${attribute.name}\" (${attribute.type} x${attribute.size}) has no WebGPU vertex format.`);\n }\n\n return format;\n};\n\n/**\n * The WebGPU-side realisation of one render mode: its compiled shader module,\n * the vertex layouts it declares, its index buffer and the buffers its data is\n * uploaded into. Cached per {@link Material} - the mode's material is its\n * stable identity, and its `destroy()` evicts the entry.\n */\ninterface ParticleModeResources {\n readonly shaderModule: GPUShaderModule;\n readonly vertexLayout: GPUVertexBufferLayout;\n /** Per-vertex layout for a mode that supplies its own geometry, else null. */\n readonly meshLayout: GPUVertexBufferLayout | null;\n /** Buffer behind {@link meshLayout}. */\n meshBuffer: GPUBuffer | null;\n /** Geometry version last written into {@link meshBuffer}; -1 when there is none. */\n meshVersion: number;\n readonly stride: number;\n readonly topology: GPUPrimitiveTopology;\n readonly stripIndexFormat: GPUIndexFormat | undefined;\n readonly indexBuffer: GPUBuffer | null;\n readonly indexFormat: GPUIndexFormat;\n /** Indices (or vertices, when the geometry carries none) per drawn element. */\n readonly indexCount: number;\n readonly instanced: boolean;\n readonly pipelines: Map<string, GPURenderPipeline>;\n vertexBuffer: GPUBuffer | null;\n vertexBufferByteLength: number;\n /**\n * The render pass {@link vertexPassBytes} is scoped to, compared by identity\n * against the coordinator's active pass. Anything else (a different pass, or\n * none open) means this mode holds no draws in the open pass and its cursor\n * restarts at 0. The mode's buffers are renderer-owned, so this is the local\n * answer to \"would writing them now alias a draw already recorded\" - the\n * coordinator's `passHasDraws` answers that only for SHARED resources.\n */\n passRef: WebGpuActiveRenderPass | null;\n /** Bytes of {@link vertexBuffer} the open pass has consumed. */\n vertexPassBytes: number;\n}\n\ninterface WebGpuParticleDrawCall {\n system: ParticleSystem;\n texture: Texture;\n blendMode: BlendModes;\n}\n\n/**\n * Particle renderer for WebGPU.\n *\n * One ParticleSystem = one draw call. The system's {@link ParticleRenderMode}\n * owns the *how* - vertex layout, shader, draw model and the loop that fills\n * the buffer - and this renderer is the executor: it holds the system-level\n * uniforms (projection, transform, local bounds, texture flags), uploads what\n * the mode built and issues the draw the mode declares.\n *\n * Everything mode-specific is read off the mode's `dataLayout`/`Material`\n * rather than hard-coded: the render pipeline's vertex layout comes from the\n * layout's attributes and stride, its shader from the material's WGSL, and the\n * draw is instanced or plain per `ParticleRenderMode.instanced`. A mode\n * declaring a `vertexGeometry` gets a second buffer stepping per vertex, and\n * that geometry supplies the topology and indices instead.\n *\n * WGSL binds vertex inputs by number rather than by name, and `GeometryAttribute`\n * carries no location, so the binding rule is positional: `@location(i)` is\n * `dataLayout.attributes[i]`, with any per-vertex attributes taking the\n * locations after them. This is the WebGPU counterpart of the WebGL2 renderer's\n * name lookup through the compiled program.\n *\n * A system running in GPU compute mode bypasses the mode's builder entirely:\n * its compute pipeline has already written the interleaved instance data\n * GPU-side, so that buffer is bound directly.\n */\nexport class WebGpuParticleRenderer extends AbstractWebGpuRenderer<ParticleSystem> {\n /**\n * The particle system's transform is bound as a uniform and each particle is\n * positioned system-locally, so this renderer never reads the shared transform\n * storage; the plan player skips writing transform records for particle draws.\n * @internal\n */\n public readonly _consumesSharedTransform = false;\n\n private readonly _drawCalls: WebGpuParticleDrawCall[] = [];\n private _drawCallCount = 0;\n private readonly _uniformData = new Float32Array(uniformByteLength / Float32Array.BYTES_PER_ELEMENT);\n\n private _device: GPUDevice | null = null;\n private _uniformBindGroupLayout: GPUBindGroupLayout | null = null;\n private _textureBindGroupLayout: GPUBindGroupLayout | null = null;\n private _pipelineLayout: GPUPipelineLayout | null = null;\n private _uniformBuffer: GPUBuffer | null = null;\n private _uniformBindGroup: GPUBindGroup | null = null;\n private _uniformBufferCapacity = 0;\n /**\n * Slots of the uniform ring the open pass has consumed, and the pass they are\n * scoped to. One draw call takes one slot; the base is added as the bind\n * group's dynamic offset, so consecutive flushes append instead of all\n * rewriting slot 0. Same identity-comparison rule as\n * {@link ParticleModeResources.passRef}, one level up: the ring is shared by\n * every mode this renderer draws.\n */\n private _uniformPassSlots = 0;\n private _ownDrawsPass: WebGpuActiveRenderPass | null = null;\n private readonly _resources = new Map<Material, ParticleModeResources>();\n /**\n * Materials this renderer already registered a dispose listener on.\n *\n * `Material` has no unsubscribe, and a disconnect clears {@link _resources}\n * without clearing the material's callback set - so registering on every\n * resource creation would leave one dead closure per material behind on\n * every device-loss/reconnect cycle. The listener stays valid across those\n * cycles (it resolves the entry through the map when it fires), so it is\n * registered once and this set remembers that. Weak, so a material dropped\n * without `destroy()` stays collectable.\n */\n private readonly _disposeListenerRegistered = new WeakSet<Material>();\n\n public render(system: ParticleSystem): void {\n const backend = this._backend;\n const texture = system.texture;\n\n // A null `source` means a Texture still waiting on its image - but\n // DataTexture extends Texture and keeps its pixels in a CPU buffer, so it\n // has none by design. Without the exemption every procedurally-generated\n // particle texture renders as nothing here while WebGL2, which has no such\n // guard, draws it.\n const awaitingImage = texture instanceof Texture && !(texture instanceof DataTexture) && texture.source === null;\n\n if (backend === null || !(texture instanceof Texture) || awaitingImage || texture.width === 0 || texture.height === 0 || system.liveCount === 0) {\n return;\n }\n\n backend.setBlendMode(system.blendMode);\n const drawCallIndex = this._drawCallCount++;\n const drawCall = this._drawCalls[drawCallIndex];\n\n if (drawCall) {\n drawCall.system = system;\n drawCall.texture = texture;\n drawCall.blendMode = system.blendMode;\n } else {\n this._drawCalls.push({\n system,\n texture,\n blendMode: system.blendMode,\n });\n }\n }\n\n public flush(): void {\n const backend = this._backend;\n const device = this._device;\n\n if (!backend || !device || this._uniformBuffer === null || this._uniformBindGroup === null) {\n return;\n }\n\n if (this._drawCallCount === 0 && !backend.clearRequested) {\n return;\n }\n\n const scissor = backend.getScissorRect();\n const maskClipsAll = scissor !== null && (scissor.width <= 0 || scissor.height <= 0);\n\n // If no drawcalls will actually render (none queued, or the scissor\n // clips everything), but a clear is pending, open a single empty\n // pass so createColorAttachment consumes the clear state.\n if (this._drawCallCount === 0 || maskClipsAll) {\n if (backend.clearRequested) {\n backend._passCoordinator.acquirePass();\n backend._passCoordinator.endPass();\n }\n this._drawCallCount = 0;\n return;\n }\n\n // Every draw call APPENDS at the cursors the open pass has reached - a byte\n // offset into the mode's vertex buffer, a slot in the uniform ring - and\n // adds the base at bind time, so N particle draws cost ONE pass and ONE\n // submit instead of N of each. Rewriting either buffer from offset 0 (which\n // this loop used to do, hence its pass per draw call) cannot work with the\n // pass left open: `queue.writeBuffer` is ordered against the submit, not\n // against the individual draws inside it, so draw k+1's write would land\n // under draw k's already-recorded read of the same bytes.\n for (let drawCallIndex = 0; drawCallIndex < this._drawCallCount; drawCallIndex++) {\n const drawCall = this._drawCalls[drawCallIndex]!;\n\n if (drawCall.system.liveCount === 0) {\n continue;\n }\n\n this._drawSystem(backend, device, drawCall);\n }\n\n this._drawCallCount = 0;\n }\n\n public destroy(): void {\n this.disconnect();\n }\n\n protected onConnect(backend: WebGpuBackend): void {\n this._backend = backend;\n this._device = this._backend.device;\n this._uniformBindGroupLayout = this._device.createBindGroupLayout({\n entries: [\n {\n binding: 0,\n visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,\n // One ring slot per draw call, selected by the dynamic offset.\n buffer: {\n type: 'uniform',\n hasDynamicOffset: true,\n },\n },\n ],\n });\n this._textureBindGroupLayout = this._device.createBindGroupLayout({\n entries: [\n {\n binding: 0,\n visibility: GPUShaderStage.FRAGMENT,\n texture: {\n sampleType: 'float',\n },\n },\n {\n binding: 1,\n visibility: GPUShaderStage.FRAGMENT,\n sampler: {\n type: 'filtering',\n },\n },\n ],\n });\n this._pipelineLayout = this._device.createPipelineLayout({\n bindGroupLayouts: [this._uniformBindGroupLayout, this._textureBindGroupLayout],\n });\n this._createUniformResources(this._device, uniformSlotStride);\n }\n\n protected onDisconnect(): void {\n this.flush();\n\n for (const resources of this._resources.values()) {\n this._destroyResources(resources);\n }\n\n this._resources.clear();\n this._uniformBuffer?.destroy();\n\n this._uniformBindGroup = null;\n this._uniformBuffer = null;\n this._uniformBufferCapacity = 0;\n this._uniformPassSlots = 0;\n this._ownDrawsPass = null;\n this._pipelineLayout = null;\n this._textureBindGroupLayout = null;\n this._uniformBindGroupLayout = null;\n this._device = null;\n this._backend = null;\n this._drawCallCount = 0;\n }\n\n /**\n * Append one system's draw at the open pass's cursors and record it, leaving\n * the pass open. Ends (submits) the pass first only where appending cannot\n * cover the hazard - see {@link _appendWouldAlias}.\n */\n private _drawSystem(backend: WebGpuBackend, device: GPUDevice, drawCall: WebGpuParticleDrawCall): void {\n const system = drawCall.system;\n const mode = system.renderMode;\n const resources = this._getOrCreateResources(mode, device);\n const coordinator = backend._passCoordinator;\n\n // GPU mode: the system's compute pipeline already wrote the interleaved\n // instance data into its own buffer - from its own encoder and its own\n // submit, in the system's update, so that compute pass is finished and\n // ordered ahead of this render pass no matter when the render pass ends.\n // Bind it directly: no CPU build, no writeBuffer, no cursor, since the\n // buffer belongs to that one system and is never appended to.\n // CPU mode: the mode builds from CPU SoA into its scratch buffer, which is\n // uploaded into the buffer this renderer owns for the mode - shared by every\n // system drawing that mode, so that one takes the cursor. The build is pure\n // CPU work, so it runs up front and gives the checks below the byte count\n // this draw will append.\n const gpuState = system.gpuMode ? system.gpuState : null;\n let drawCount = system.liveCount;\n let appendBytes = 0;\n\n if (gpuState === null) {\n mode.build(system, system._storage);\n drawCount = mode.count;\n // At least one stride, so a zero-element build still leaves the cursor on\n // the 4-byte boundary `setVertexBuffer` and `writeBuffer` require.\n appendBytes = Math.max(drawCount, 1) * resources.stride;\n }\n\n const meshGeometry = mode.vertexGeometry;\n const meshSyncRequired = resources.meshBuffer !== null && meshGeometry !== null && resources.meshVersion !== meshGeometry.version;\n\n // Pass totals appending would reach, resolved BEFORE the split below. They\n // size the buffers even when the split does happen: sizing to the lone draw\n // that remains after it would peg both buffers at one draw forever - the\n // split shrinks the requirement back, the capacity never ratchets, and every\n // draw call opens its own pass again, which is the state this discipline\n // exists to remove.\n const targetVertexBytes = this._modePassBytes(coordinator.activePass, resources) + appendBytes;\n const targetUniformSlots = this._uniformPassBase(coordinator.activePass) + 1;\n\n if (this._appendWouldAlias(backend, drawCall, resources, meshSyncRequired, targetVertexBytes, targetUniformSlots)) {\n coordinator.endPass();\n }\n\n // Re-resolved after the split: an ended pass restarts every cursor at 0,\n // while the draws it held keep reading the bytes already written at their\n // own base offsets.\n const vertexByteOffset = this._modePassBytes(coordinator.activePass, resources);\n const uniformSlot = this._uniformPassBase(coordinator.activePass);\n\n // Sized to the pre-split pass totals, not to what remains after it.\n this._ensureUniformCapacity(device, targetUniformSlots);\n\n const pipeline = this._getPipeline(resources, drawCall.blendMode, backend.renderTargetFormat, coordinator.stencilActive);\n const textureBinding = backend.getTextureBinding(drawCall.texture, mode.material.sampler);\n const textureBindGroup = device.createBindGroup({\n layout: this._textureBindGroupLayout!,\n entries: [\n {\n binding: 0,\n resource: textureBinding.view,\n },\n {\n binding: 1,\n resource: textureBinding.sampler,\n },\n ],\n });\n\n this._writeUniformData(backend, system, drawCall.texture);\n\n const vertexBuffer =\n gpuState !== null ? gpuState.instanceBuffer : this._uploadModeData(device, resources, mode, targetVertexBytes, vertexByteOffset, drawCount);\n\n device.queue.writeBuffer(\n this._uniformBuffer!,\n uniformSlot * uniformSlotStride,\n this._uniformData.buffer,\n this._uniformData.byteOffset,\n this._uniformData.byteLength,\n );\n\n if (meshSyncRequired) {\n this._syncMeshBuffer(device, resources, mode);\n }\n\n const active = coordinator.acquirePass();\n const pass = active.pass;\n\n pass.setBindGroup(0, this._uniformBindGroup, [uniformSlot * uniformSlotStride]);\n pass.setPipeline(pipeline);\n pass.setBindGroup(1, textureBindGroup);\n pass.setVertexBuffer(0, vertexBuffer, gpuState !== null ? 0 : vertexByteOffset);\n\n if (resources.meshBuffer !== null) {\n pass.setVertexBuffer(1, resources.meshBuffer);\n }\n\n // `mode.count` is instance count for an instanced mode and vertex count\n // otherwise, so it drives exactly one of the two draw arguments.\n const instanceCount = resources.instanced ? drawCount : 1;\n\n if (resources.indexBuffer !== null) {\n pass.setIndexBuffer(resources.indexBuffer, resources.indexFormat);\n pass.drawIndexed(resources.indexCount, instanceCount, 0, 0, 0);\n } else {\n pass.draw(resources.instanced ? resources.indexCount : drawCount, instanceCount, 0, 0);\n }\n\n coordinator.markPassDraws();\n backend.stats.batches++;\n backend.stats.drawCalls++;\n\n // The pass stays open. Its cursors carry this draw's consumption forward so\n // the next draw - this flush's or a later one's - appends AFTER the slices\n // this one reads instead of overwriting them. The backend ends the pass at\n // the frame boundary and at every genuine boundary in between.\n this._ownDrawsPass = active;\n this._uniformPassSlots = uniformSlot + 1;\n resources.passRef = active;\n resources.vertexPassBytes = vertexByteOffset + appendBytes;\n }\n\n /**\n * Whether appending this draw would retroactively change what a draw already\n * recorded into the open pass reads - in which case the caller ends (submits)\n * that pass first, which restarts every cursor at 0.\n */\n private _appendWouldAlias(\n backend: WebGpuBackend,\n drawCall: WebGpuParticleDrawCall,\n resources: ParticleModeResources,\n meshSyncRequired: boolean,\n targetVertexBytes: number,\n targetUniformSlots: number,\n ): boolean {\n const coordinator = backend._passCoordinator;\n const active = coordinator.activePass;\n\n // The texture cache is SHARED, and resolving the binding syncs dirty content\n // on the queue timeline ahead of the deferred submit. The pass survives a\n // renderer switch, so the endangered draw need not be one of ours - hence\n // the coordinator-side question rather than a local cursor.\n if (coordinator.passHasDraws && backend._textureUploadWouldMutate(drawCall.texture)) {\n return true;\n }\n\n if (active === null) {\n return false;\n }\n\n // The viewport is baked into the pass at `acquirePass` and cannot be\n // rewritten on an open one, so a view invalidated since then would render\n // this draw through the rectangle the pass was opened with. That makes it a\n // PASS property rather than a resource of ours: whoever opened the pass -\n // any renderer - carried the stale viewport into it, so unlike the cursor\n // checks below this one asks nothing about who owns the recorded draws.\n if (active.viewUpdateId !== backend.view.updateId) {\n return true;\n }\n\n // The rest are renderer-OWNED buffers, so they ask this renderer's own\n // cursors instead: only draws of ours read them. Re-writing the mode's\n // per-vertex geometry from 0 aliases the draws already bound to it, and\n // growing either the mode's vertex buffer or the uniform ring frees the\n // buffer those draws read. Appending covers neither.\n if (resources.passRef === active && (meshSyncRequired || targetVertexBytes > resources.vertexBufferByteLength)) {\n return true;\n }\n\n return this._ownDrawsPass === active && targetUniformSlots * uniformSlotStride > this._uniformBufferCapacity;\n }\n\n /**\n * Bytes of the mode's vertex buffer `active` has consumed, or 0 when it holds\n * none of that mode's draws (a different pass, or none open).\n */\n private _modePassBytes(active: WebGpuActiveRenderPass | null, resources: ParticleModeResources): number {\n return active !== null && resources.passRef === active ? resources.vertexPassBytes : 0;\n }\n\n /** Uniform ring slots `active` has consumed, or 0 when it holds no draws of ours. */\n private _uniformPassBase(active: WebGpuActiveRenderPass | null): number {\n return active !== null && this._ownDrawsPass === active ? this._uniformPassSlots : 0;\n }\n\n /**\n * Upload what the mode just built into this draw's sub-range of the mode's\n * vertex buffer, growing it to the pass total first. Returns the buffer to\n * bind, since growth replaces it.\n */\n private _uploadModeData(\n device: GPUDevice,\n resources: ParticleModeResources,\n mode: ParticleRenderMode,\n targetByteLength: number,\n byteOffset: number,\n elementCount: number,\n ): GPUBuffer {\n const buffer = this._ensureCapacity(device, resources, targetByteLength);\n\n device.queue.writeBuffer(buffer, byteOffset, mode.data, 0, elementCount * resources.stride);\n\n return buffer;\n }\n\n private _getOrCreateResources(mode: ParticleRenderMode, device: GPUDevice): ParticleModeResources {\n const material = mode.material;\n const cached = this._resources.get(material);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const created = this._createResources(mode, material, device);\n\n this._resources.set(material, created);\n\n if (!this._disposeListenerRegistered.has(material)) {\n this._disposeListenerRegistered.add(material);\n\n // A destroyed mode takes its GPU resources with it: `ParticleSystem.destroy`\n // destroys a mode it owns, which destroys the material.\n material._onDispose(() => {\n // `Material.destroy` drops its callbacks after firing them, so this\n // registration is gone - forget it, and the next creation re-registers.\n this._disposeListenerRegistered.delete(material);\n\n const stored = this._resources.get(material);\n\n if (stored === undefined) {\n return;\n }\n\n this._destroyResources(stored);\n this._resources.delete(material);\n });\n }\n\n return created;\n }\n\n private _createResources(mode: ParticleRenderMode, material: Material, device: GPUDevice): ParticleModeResources {\n const wgsl = material.shader.wgsl;\n\n if (wgsl === null) {\n throw new Error('Particle material shader has no `wgsl` source; cannot render through the WebGPU backend.');\n }\n\n const layout = mode.dataLayout;\n const meshGeometry = mode.vertexGeometry;\n\n assertVertexGeometryCompatible(layout, meshGeometry, mode.instanced, mode.constructor.name);\n\n // A mode with its own per-vertex geometry draws that geometry's topology\n // and indices; one without derives its vertices in the shader and carries\n // both on its layout instead.\n const indices = meshGeometry !== null ? meshGeometry.indices : layout.indices;\n let indexBuffer: GPUBuffer | null = null;\n\n if (indices !== null) {\n // Padded to a 4-byte multiple, which `queue.writeBuffer` requires and a\n // 16-bit index list of odd length does not satisfy on its own.\n const indexData = new Uint8Array(Math.ceil(indices.byteLength / 4) * 4);\n\n indexData.set(new Uint8Array(indices.buffer, indices.byteOffset, indices.byteLength));\n\n indexBuffer = device.createBuffer({\n size: indexData.byteLength,\n usage: GPUBufferUsage.INDEX | GPUBufferUsage.COPY_DST,\n });\n device.queue.writeBuffer(indexBuffer, 0, indexData.buffer, indexData.byteOffset, indexData.byteLength);\n }\n\n const topology: GPUPrimitiveTopology = meshGeometry !== null ? meshGeometry.topology : layout.topology;\n const indexFormat: GPUIndexFormat = indices instanceof Uint32Array ? 'uint32' : 'uint16';\n const indexedStrip = topology === 'triangle-strip' && indexBuffer !== null;\n\n // Instance attributes keep locations 0..n-1 so the compute-emitted layout\n // and the modes that derive their vertices in the shader stay untouched;\n // the mesh's own attributes take the locations after them.\n let meshBuffer: GPUBuffer | null = null;\n let meshLayout: GPUVertexBufferLayout | null = null;\n\n if (meshGeometry !== null) {\n const meshData = meshGeometry.vertexData;\n\n meshLayout = {\n arrayStride: meshGeometry.stride,\n stepMode: 'vertex',\n attributes: meshGeometry.attributes.map((attribute, index) => ({\n shaderLocation: layout.attributes.length + index,\n offset: attribute.offset,\n format: resolveVertexFormat(attribute),\n })),\n };\n\n meshBuffer = device.createBuffer({\n size: Math.ceil(meshData.byteLength / 4) * 4,\n usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,\n });\n device.queue.writeBuffer(meshBuffer, 0, meshData instanceof Float32Array ? meshData.buffer : meshData, 0, meshData.byteLength);\n }\n\n return {\n shaderModule: device.createShaderModule({ code: wgsl }),\n vertexLayout: {\n arrayStride: layout.stride,\n // Per-instance for an instanced mode, per-vertex otherwise - the same\n // interleaved layout serves both draw models.\n stepMode: mode.instanced ? 'instance' : 'vertex',\n attributes: layout.attributes.map((attribute, location) => ({\n shaderLocation: location,\n offset: attribute.offset,\n format: resolveVertexFormat(attribute),\n })),\n },\n meshLayout,\n meshBuffer,\n meshVersion: meshGeometry?.version ?? -1,\n stride: layout.stride,\n topology,\n // Required by WebGPU for indexed strip draws, and forbidden otherwise.\n stripIndexFormat: indexedStrip ? indexFormat : undefined,\n indexBuffer,\n indexFormat,\n indexCount: meshGeometry !== null ? meshGeometry.indexCount : layout.indexCount,\n instanced: mode.instanced,\n pipelines: new Map<string, GPURenderPipeline>(),\n vertexBuffer: null,\n vertexBufferByteLength: 0,\n passRef: null,\n vertexPassBytes: 0,\n };\n }\n\n /**\n * Re-write the mode's own geometry only when it was mutated since the last\n * draw. One integer comparison keeps an unchanging mesh off the bus.\n */\n private _syncMeshBuffer(device: GPUDevice, resources: ParticleModeResources, mode: ParticleRenderMode): void {\n const meshGeometry = mode.vertexGeometry;\n\n if (meshGeometry === null || resources.meshBuffer === null || resources.meshVersion === meshGeometry.version) {\n return;\n }\n\n const meshData = meshGeometry.vertexData;\n\n resources.meshVersion = meshGeometry.version;\n device.queue.writeBuffer(resources.meshBuffer, 0, meshData instanceof Float32Array ? meshData.buffer : meshData, 0, meshData.byteLength);\n }\n\n private _destroyResources(resources: ParticleModeResources): void {\n resources.vertexBuffer?.destroy();\n resources.meshBuffer?.destroy();\n resources.indexBuffer?.destroy();\n resources.pipelines.clear();\n resources.vertexBuffer = null;\n resources.meshBuffer = null;\n resources.vertexBufferByteLength = 0;\n resources.passRef = null;\n resources.vertexPassBytes = 0;\n }\n\n /**\n * Grow the mode's vertex buffer to `requiredByteLength`, which is the whole\n * open pass's consumption of it (this draw's append plus everything already\n * written for the draws it holds), not just this draw's own bytes. Grow-only\n * and doubling, matching the mode's own scratch-buffer policy; the returned\n * buffer is the one this draw must bind, since growth replaces it.\n */\n private _ensureCapacity(device: GPUDevice, resources: ParticleModeResources, requiredByteLength: number): GPUBuffer {\n const stride = resources.stride;\n const required = Math.max(requiredByteLength, stride);\n\n if (resources.vertexBuffer !== null && required <= resources.vertexBufferByteLength) {\n return resources.vertexBuffer;\n }\n\n let byteLength = resources.vertexBufferByteLength || stride;\n\n while (byteLength < required) {\n byteLength *= 2;\n }\n\n resources.vertexBuffer?.destroy();\n resources.vertexBuffer = device.createBuffer({\n size: byteLength,\n usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,\n });\n resources.vertexBufferByteLength = byteLength;\n\n return resources.vertexBuffer;\n }\n\n /**\n * Grow the uniform ring to `slots` draw-call slots - again the open pass's\n * total, not this draw's one slot. Doubling and grow-only; growth frees the\n * current buffer, so the caller must have ended any pass holding draws of\n * ours that read it.\n */\n private _ensureUniformCapacity(device: GPUDevice, slots: number): void {\n const requiredBytes = slots * uniformSlotStride;\n\n if (requiredBytes <= this._uniformBufferCapacity) {\n return;\n }\n\n this._uniformBuffer?.destroy();\n this._createUniformResources(device, Math.max(requiredBytes, this._uniformBufferCapacity * 2));\n }\n\n /** (Re-)create the uniform ring and its bind group at `capacityBytes`. */\n private _createUniformResources(device: GPUDevice, capacityBytes: number): void {\n this._uniformBufferCapacity = capacityBytes;\n this._uniformBuffer = device.createBuffer({\n label: 'particles:uniform-ring',\n size: capacityBytes,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n this._uniformBindGroup = device.createBindGroup({\n label: 'particles:uniform-bind-group',\n layout: this._uniformBindGroupLayout!,\n entries: [\n {\n binding: 0,\n // Explicit size: the dynamic offset addresses one slot, so the binding\n // must span one slot's worth of uniforms rather than the whole ring.\n resource: {\n buffer: this._uniformBuffer,\n size: uniformByteLength,\n },\n },\n ],\n });\n }\n\n private _writeUniformData(backend: WebGpuBackend, system: ParticleSystem, texture: Texture): void {\n const projection = backend.view.getTransform().toArray(false);\n const transform = system.getGlobalTransform().toArray(false);\n const shouldPremultiplySample = backend.shouldPremultiplyTextureSample(texture);\n const vertices = system.vertices;\n const texCoords = system.texCoords;\n const quadMinX = vertices[0]!;\n const quadMinY = vertices[1]!;\n const quadSizeX = vertices[2]! - vertices[0]!;\n const quadSizeY = vertices[3]! - vertices[1]!;\n const uvMinX = (texCoords[0]! & 0xffff) / 0xffff;\n const uvMinY = ((texCoords[0]! >>> 16) & 0xffff) / 0xffff;\n const uvMaxX = (texCoords[2]! & 0xffff) / 0xffff;\n const uvMaxY = ((texCoords[2]! >>> 16) & 0xffff) / 0xffff;\n\n const u = this._uniformData;\n\n // projection mat4 (col-major, padded to 4×4)\n u[0] = projection[0]!;\n u[1] = projection[1]!;\n u[2] = 0;\n u[3] = 0;\n u[4] = projection[3]!;\n u[5] = projection[4]!;\n u[6] = 0;\n u[7] = 0;\n u[8] = 0;\n u[9] = 0;\n u[10] = 1;\n u[11] = 0;\n u[12] = projection[6]!;\n u[13] = projection[7]!;\n u[14] = 0;\n u[15] = projection[8]!;\n\n // transform mat4 (col-major, padded to 4×4)\n u[16] = transform[0]!;\n u[17] = transform[1]!;\n u[18] = 0;\n u[19] = 0;\n u[20] = transform[3]!;\n u[21] = transform[4]!;\n u[22] = 0;\n u[23] = 0;\n u[24] = 0;\n u[25] = 0;\n u[26] = 1;\n u[27] = 0;\n u[28] = transform[6]!;\n u[29] = transform[7]!;\n u[30] = 0;\n u[31] = transform[8]!;\n\n // flags vec4\n u[32] = shouldPremultiplySample ? 1 : 0;\n u[33] = 0;\n u[34] = 0;\n u[35] = 0;\n\n // localBounds vec4\n u[36] = quadMinX;\n u[37] = quadMinY;\n u[38] = quadSizeX;\n u[39] = quadSizeY;\n\n // uvBounds vec4\n u[40] = uvMinX;\n u[41] = uvMinY;\n u[42] = uvMaxX;\n u[43] = uvMaxY;\n }\n\n private _getPipeline(resources: ParticleModeResources, blendMode: BlendModes, format: GPUTextureFormat, stencil: boolean): GPURenderPipeline {\n const pipelineKey = `${blendMode}:${format}:${stencil ? 's' : 'n'}`;\n const existingPipeline = resources.pipelines.get(pipelineKey);\n\n if (existingPipeline) {\n return existingPipeline;\n }\n\n const descriptor: GPURenderPipelineDescriptor = {\n layout: this._pipelineLayout!,\n vertex: {\n module: resources.shaderModule,\n entryPoint: 'vertexMain',\n // Instance data stays at slot 0: a GPU-mode system binds its compute\n // pipeline's own instance buffer straight into it.\n buffers: resources.meshLayout !== null ? [resources.vertexLayout, resources.meshLayout] : [resources.vertexLayout],\n },\n fragment: {\n module: resources.shaderModule,\n entryPoint: 'fragmentMain',\n targets: [\n {\n format,\n blend: getWebGpuBlendState(blendMode),\n writeMask: GPUColorWrite.ALL,\n },\n ],\n },\n // `stripIndexFormat` is required for an indexed strip and forbidden\n // otherwise, so it is omitted rather than set to `undefined`.\n primitive:\n resources.stripIndexFormat === undefined\n ? { topology: resources.topology }\n : { topology: resources.topology, stripIndexFormat: resources.stripIndexFormat },\n };\n\n if (stencil) {\n descriptor.depthStencil = stencilContentDepthStencilState();\n }\n\n const pipeline = this._device!.createRenderPipeline(descriptor);\n\n resources.pipelines.set(pipelineKey, pipeline);\n\n return pipeline;\n }\n}\n"],"mappings":";;;;AAeA,MAAM,oBAAoB;;;;;;;AAO1B,MAAM,oBAAoB;;;;;;;AAQ1B,MAAM,qBAAsD;CAC1D,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;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AAuB,QAA0B,SAAqC;EAC3I,MAAM,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,MAAM;EAC9D,MAAM,mBAAmB,UAAU,UAAU,IAAI,WAAW;EAE5D,IAAI,kBACF,OAAO;EAGT,MAAM,aAA0C;GAC9C,QAAQ,KAAK;GACb,QAAQ;IACN,QAAQ,UAAU;IAClB,YAAY;IAGZ,SAAS,UAAU,eAAe,OAAO,CAAC,UAAU,cAAc,UAAU,UAAU,IAAI,CAAC,UAAU,YAAY;GACnH;GACA,UAAU;IACR,QAAQ,UAAU;IAClB,YAAY;IACZ,SAAS,CACP;KACE;KACA,OAAO,oBAAoB,SAAS;KACpC,WAAW,cAAc;IAC3B,CACF;GACF;GAGA,WACE,UAAU,qBAAqB,SAC3B,EAAE,UAAU,UAAU,SAAS,IAC/B;IAAE,UAAU,UAAU;IAAU,kBAAkB,UAAU;GAAiB;EACrF;EAEA,IAAI,SACF,WAAW,eAAe,gCAAgC;EAG5D,MAAM,WAAW,KAAK,QAAS,qBAAqB,UAAU;EAE9D,UAAU,UAAU,IAAI,aAAa,QAAQ;EAE7C,OAAO;CACT;AACF"}
@@ -0,0 +1,6 @@
1
+ //#region src/renderers/shaders/particle.frag
2
+ var particle_default = "#version 300 es\nprecision lowp float;\n\nuniform sampler2D u_texture;\n\n// UVs need full precision on mobile GLES (the lowp default would quantise\n// them); the color varying stays lowp for 8-bit output.\nin highp vec2 v_texcoord;\nin vec4 v_color;\n\nlayout(location = 0) out vec4 fragColor;\n\nvoid main(void) {\n fragColor = texture(u_texture, v_texcoord) * v_color;\n}\n";
3
+
4
+ //#endregion
5
+ export { particle_default as default };
6
+ //# sourceMappingURL=particle.frag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particle.frag.js","names":[],"sources":["../../../../src/renderers/shaders/particle.frag"],"sourcesContent":["export default \"#version 300 es\\nprecision lowp float;\\n\\nuniform sampler2D u_texture;\\n\\n// UVs need full precision on mobile GLES (the lowp default would quantise\\n// them); the color varying stays lowp for 8-bit output.\\nin highp vec2 v_texcoord;\\nin vec4 v_color;\\n\\nlayout(location = 0) out vec4 fragColor;\\n\\nvoid main(void) {\\n fragColor = texture(u_texture, v_texcoord) * v_color;\\n}\\n\";"],"mappings":";AAAA,uBAAe"}
@@ -0,0 +1,6 @@
1
+ //#region src/renderers/shaders/particle.vert
2
+ var particle_default = "#version 300 es\nprecision highp float;\nprecision lowp int;\n\n// Per-instance attributes (one entry per particle, 40 bytes total).\nlayout(location = 0) in vec2 a_position; // particle position in system-local space\nlayout(location = 1) in vec2 a_scale; // particle scale\nlayout(location = 2) in float a_rotation; // particle rotation in degrees\nlayout(location = 3) in vec4 a_color; // RGBA tint\nlayout(location = 4) in vec2 a_uvMin; // top-left UV (u, v) — pre-resolved per instance\nlayout(location = 5) in vec2 a_uvMax; // bottom-right UV (u, v) — pre-resolved per instance\n\nuniform mat3 u_projection;\nuniform mat3 u_systemTransform;\nuniform vec4 u_localBounds; // left, top, right, bottom (system.vertices)\n\nout vec2 v_texcoord;\nout vec4 v_color;\n\nvoid main(void) {\n // Static index buffer is [0,1,2,0,2,3] (triangle-list), so gl_VertexID 0..3\n // maps to TL, TR, BR, BL via the same bit math the sprite renderer uses.\n int vid = gl_VertexID;\n int cornerX = ((vid + 1) >> 1) & 1;\n int cornerY = vid >> 1;\n\n float localX = (cornerX == 0) ? u_localBounds.x : u_localBounds.z;\n float localY = (cornerY == 0) ? u_localBounds.y : u_localBounds.w;\n\n // Per-particle scale + rotation.\n vec2 rotation = vec2(sin(radians(a_rotation)), cos(radians(a_rotation)));\n vec2 transformed = vec2(\n (localX * (a_scale.x * rotation.y)) + (localY * (a_scale.y * rotation.x)),\n (localX * (a_scale.x * -rotation.x)) + (localY * (a_scale.y * rotation.y))\n );\n\n vec3 worldPos = vec3(transformed + a_position, 1.0);\n\n gl_Position = vec4((u_projection * u_systemTransform * worldPos).xy, 0.0, 1.0);\n\n float u = (cornerX == 0) ? a_uvMin.x : a_uvMax.x;\n float v = (cornerY == 0) ? a_uvMin.y : a_uvMax.y;\n v_texcoord = vec2(u, v);\n\n v_color = vec4(a_color.rgb * a_color.a, a_color.a);\n}\n";
3
+
4
+ //#endregion
5
+ export { particle_default as default };
6
+ //# sourceMappingURL=particle.vert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particle.vert.js","names":[],"sources":["../../../../src/renderers/shaders/particle.vert"],"sourcesContent":["export default \"#version 300 es\\nprecision highp float;\\nprecision lowp int;\\n\\n// Per-instance attributes (one entry per particle, 40 bytes total).\\nlayout(location = 0) in vec2 a_position; // particle position in system-local space\\nlayout(location = 1) in vec2 a_scale; // particle scale\\nlayout(location = 2) in float a_rotation; // particle rotation in degrees\\nlayout(location = 3) in vec4 a_color; // RGBA tint\\nlayout(location = 4) in vec2 a_uvMin; // top-left UV (u, v) — pre-resolved per instance\\nlayout(location = 5) in vec2 a_uvMax; // bottom-right UV (u, v) — pre-resolved per instance\\n\\nuniform mat3 u_projection;\\nuniform mat3 u_systemTransform;\\nuniform vec4 u_localBounds; // left, top, right, bottom (system.vertices)\\n\\nout vec2 v_texcoord;\\nout vec4 v_color;\\n\\nvoid main(void) {\\n // Static index buffer is [0,1,2,0,2,3] (triangle-list), so gl_VertexID 0..3\\n // maps to TL, TR, BR, BL via the same bit math the sprite renderer uses.\\n int vid = gl_VertexID;\\n int cornerX = ((vid + 1) >> 1) & 1;\\n int cornerY = vid >> 1;\\n\\n float localX = (cornerX == 0) ? u_localBounds.x : u_localBounds.z;\\n float localY = (cornerY == 0) ? u_localBounds.y : u_localBounds.w;\\n\\n // Per-particle scale + rotation.\\n vec2 rotation = vec2(sin(radians(a_rotation)), cos(radians(a_rotation)));\\n vec2 transformed = vec2(\\n (localX * (a_scale.x * rotation.y)) + (localY * (a_scale.y * rotation.x)),\\n (localX * (a_scale.x * -rotation.x)) + (localY * (a_scale.y * rotation.y))\\n );\\n\\n vec3 worldPos = vec3(transformed + a_position, 1.0);\\n\\n gl_Position = vec4((u_projection * u_systemTransform * worldPos).xy, 0.0, 1.0);\\n\\n float u = (cornerX == 0) ? a_uvMin.x : a_uvMax.x;\\n float v = (cornerY == 0) ? a_uvMin.y : a_uvMax.y;\\n v_texcoord = vec2(u, v);\\n\\n v_color = vec4(a_color.rgb * a_color.a, a_color.a);\\n}\\n\";"],"mappings":";AAAA,uBAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexo/exojs-particles",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "description": "Particle system extension for ExoJS.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,9 +8,7 @@
8
8
  "directory": "packages/exojs-particles"
9
9
  },
10
10
  "type": "module",
11
- "sideEffects": [
12
- "./dist/esm/register.js"
13
- ],
11
+ "sideEffects": false,
14
12
  "main": "./dist/esm/index.js",
15
13
  "module": "./dist/esm/index.js",
16
14
  "types": "./dist/esm/index.d.ts",
@@ -20,11 +18,6 @@
20
18
  "import": "./dist/esm/index.js",
21
19
  "default": "./dist/esm/index.js"
22
20
  },
23
- "./register": {
24
- "types": "./dist/esm/register.d.ts",
25
- "import": "./dist/esm/register.js",
26
- "default": "./dist/esm/register.js"
27
- },
28
21
  "./package.json": "./package.json"
29
22
  },
30
23
  "imports": {
@@ -40,20 +33,20 @@
40
33
  "LICENSE"
41
34
  ],
42
35
  "peerDependencies": {
43
- "@codexo/exojs": "0.15.x"
36
+ "@codexo/exojs": "0.16.x"
44
37
  },
45
38
  "devDependencies": {
46
39
  "@codexo/exojs-config": "0.0.0",
47
- "@codexo/exojs": "0.15.2"
40
+ "@codexo/exojs": "0.16.0"
48
41
  },
49
42
  "license": "MIT",
50
43
  "publishConfig": {
51
44
  "access": "public"
52
45
  },
53
46
  "scripts": {
54
- "build": "tsx ../../node_modules/rollup/dist/bin/rollup -c --environment EXOJS_ENV:production",
55
- "build:dev": "tsx ../../node_modules/rollup/dist/bin/rollup -c --environment EXOJS_ENV:development",
56
- "typecheck": "tsc --noEmit",
47
+ "build": "tsx ../../scripts/build-extension.ts",
48
+ "build:dev": "tsx ../../scripts/build-extension.ts --dev",
49
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
57
50
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
58
51
  "test": "vitest run --root ../.. --project=exojs-particles"
59
52
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- export * from './public';
@@ -1,43 +0,0 @@
1
- import { ExtensionRegistry } from '@codexo/exojs/extensions';
2
- import { particlesExtension } from './particlesExtension.js';
3
- export { createParticlesExtension } from './particlesExtension.js';
4
- export { BoxArea } from './distributions/BoxArea.js';
5
- export { CircleArea } from './distributions/CircleArea.js';
6
- export { ColorGradient } from './distributions/ColorGradient.js';
7
- export { ConeDirection } from './distributions/ConeDirection.js';
8
- export { Constant } from './distributions/Constant.js';
9
- export { Curve } from './distributions/Curve.js';
10
- export { LineSegment } from './distributions/LineSegment.js';
11
- export { Range } from './distributions/Range.js';
12
- export { VectorRange } from './distributions/VectorRange.js';
13
- export { AlphaFadeOverLifetime } from './modules/AlphaFadeOverLifetime.js';
14
- export { ApplyForce } from './modules/ApplyForce.js';
15
- export { AttractToPoint } from './modules/AttractToPoint.js';
16
- export { BurstSpawn } from './modules/BurstSpawn.js';
17
- export { ColorOverLifetime } from './modules/ColorOverLifetime.js';
18
- export { ColorOverSpeed } from './modules/ColorOverSpeed.js';
19
- export { DeathModule } from './modules/DeathModule.js';
20
- export { Drag } from './modules/Drag.js';
21
- export { OrbitalForce } from './modules/OrbitalForce.js';
22
- export { RateSpawn } from './modules/RateSpawn.js';
23
- export { RepelFromPoint } from './modules/RepelFromPoint.js';
24
- export { RotateOverLifetime } from './modules/RotateOverLifetime.js';
25
- export { ScaleOverLifetime } from './modules/ScaleOverLifetime.js';
26
- export { SpawnModule } from './modules/SpawnModule.js';
27
- export { SpawnOnDeath } from './modules/SpawnOnDeath.js';
28
- export { Turbulence } from './modules/Turbulence.js';
29
- export { UpdateModule } from './modules/UpdateModule.js';
30
- export { VelocityOverLifetime } from './modules/VelocityOverLifetime.js';
31
- export { wgslFieldLayout, wgslUniformByteSize } from './modules/WgslContribution.js';
32
- export { particlesBuildInfo } from './particlesBuildInfo.js';
33
- export { ParticleSystem } from './ParticleSystem.js';
34
-
35
- // @codexo/exojs-particles/register — explicit registration entry.
36
- // Importing this entry registers the default particlesExtension descriptor
37
- // in the global ExtensionRegistry. Subsequently constructed Applications
38
- // that use global defaults will receive the Particles extension.
39
- // This is the only side-effectful entry in this package.
40
- ExtensionRegistry.register(particlesExtension);
41
-
42
- export { particlesExtension };
43
- //# sourceMappingURL=register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.js","sources":["../../../src/register.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,iBAAiB,CAAC,QAAQ,CAAC,kBAAkB,CAAC;;;;"}
@@ -1,4 +0,0 @@
1
- var fragmentSource = "#version 300 es\nprecision lowp float;\n\nuniform sampler2D u_texture;\n\nin vec2 v_texcoord;\nin vec4 v_color;\n\nlayout(location = 0) out vec4 fragColor;\n\nvoid main(void) {\n fragColor = texture(u_texture, v_texcoord) * v_color;\n}\n";
2
-
3
- export { fragmentSource as default };
4
- //# sourceMappingURL=particle.frag.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"particle.frag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var vertexSource = "#version 300 es\nprecision lowp float;\nprecision lowp int;\n\n// Per-instance attributes (one entry per particle, 40 bytes total).\nlayout(location = 0) in vec2 a_translation; // particle position in system-local space\nlayout(location = 1) in vec2 a_scale; // particle scale\nlayout(location = 2) in float a_rotation; // particle rotation in degrees\nlayout(location = 3) in vec4 a_color; // RGBA tint\nlayout(location = 4) in vec2 a_uvMin; // top-left UV (u, v) — pre-resolved per instance\nlayout(location = 5) in vec2 a_uvMax; // bottom-right UV (u, v) — pre-resolved per instance\n\nuniform mat3 u_projection;\nuniform mat3 u_systemTransform;\nuniform vec4 u_localBounds; // left, top, right, bottom (system.vertices)\n\nout vec2 v_texcoord;\nout vec4 v_color;\n\nvoid main(void) {\n // Static index buffer is [0,1,2,0,2,3] (triangle-list), so gl_VertexID 0..3\n // maps to TL, TR, BR, BL via the same bit math the sprite renderer uses.\n int vid = gl_VertexID;\n int cornerX = ((vid + 1) >> 1) & 1;\n int cornerY = vid >> 1;\n\n float localX = (cornerX == 0) ? u_localBounds.x : u_localBounds.z;\n float localY = (cornerY == 0) ? u_localBounds.y : u_localBounds.w;\n\n // Per-particle scale + rotation.\n vec2 rotation = vec2(sin(radians(a_rotation)), cos(radians(a_rotation)));\n vec2 transformed = vec2(\n (localX * (a_scale.x * rotation.y)) + (localY * (a_scale.y * rotation.x)),\n (localX * (a_scale.x * -rotation.x)) + (localY * (a_scale.y * rotation.y))\n );\n\n vec3 worldPos = vec3(transformed + a_translation, 1.0);\n\n gl_Position = vec4((u_projection * u_systemTransform * worldPos).xy, 0.0, 1.0);\n\n float u = (cornerX == 0) ? a_uvMin.x : a_uvMax.x;\n float v = (cornerY == 0) ? a_uvMin.y : a_uvMax.y;\n v_texcoord = vec2(u, v);\n\n v_color = vec4(a_color.rgb * a_color.a, a_color.a);\n}\n";
2
-
3
- export { vertexSource as default };
4
- //# sourceMappingURL=particle.vert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"particle.vert.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}