@3driseai/3drise-viewer 0.1.26 → 0.1.28

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 (476) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts +3 -0
  2. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  3. package/dist/animationsV2/ClipPlayer.js +67 -8
  4. package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
  5. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  6. package/dist/animationsV2/ClipsRuntime.js +245 -14
  7. package/dist/animationsV2/appliers.d.ts +5 -0
  8. package/dist/animationsV2/appliers.d.ts.map +1 -1
  9. package/dist/animationsV2/appliers.js +25 -7
  10. package/dist/animationsV2/index.d.ts +1 -1
  11. package/dist/animationsV2/index.d.ts.map +1 -1
  12. package/dist/animationsV2/normalize.d.ts.map +1 -1
  13. package/dist/animationsV2/normalize.js +18 -7
  14. package/dist/animationsV2/sequenceUtils.d.ts +42 -1
  15. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  16. package/dist/animationsV2/sequenceUtils.js +103 -3
  17. package/dist/animationsV2/types.d.ts +20 -0
  18. package/dist/animationsV2/types.d.ts.map +1 -1
  19. package/dist/components/AdvancedGrid.d.ts +8 -2
  20. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  21. package/dist/components/AdvancedGrid.js +31 -14
  22. package/dist/components/AnimatedObject.d.ts.map +1 -1
  23. package/dist/components/AnimatedObject.js +7 -5
  24. package/dist/components/ApollonianGrid.d.ts +25 -0
  25. package/dist/components/ApollonianGrid.d.ts.map +1 -0
  26. package/dist/components/ApollonianGrid.js +80 -0
  27. package/dist/components/Bubbles.d.ts +7 -1
  28. package/dist/components/Bubbles.d.ts.map +1 -1
  29. package/dist/components/Bubbles.js +42 -22
  30. package/dist/components/ChladniGrid.d.ts +8 -4
  31. package/dist/components/ChladniGrid.d.ts.map +1 -1
  32. package/dist/components/ChladniGrid.js +31 -13
  33. package/dist/components/CircuitGrid.d.ts +8 -11
  34. package/dist/components/CircuitGrid.d.ts.map +1 -1
  35. package/dist/components/CircuitGrid.js +31 -13
  36. package/dist/components/CloudsGenerator.d.ts +1 -1
  37. package/dist/components/CloudsGenerator.js +1 -1
  38. package/dist/components/ConformalGrid.d.ts +25 -0
  39. package/dist/components/ConformalGrid.d.ts.map +1 -0
  40. package/dist/components/ConformalGrid.js +97 -0
  41. package/dist/components/ContourGrid.d.ts +8 -14
  42. package/dist/components/ContourGrid.d.ts.map +1 -1
  43. package/dist/components/ContourGrid.js +31 -13
  44. package/dist/components/EffectsGenerator.d.ts +7 -1
  45. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  46. package/dist/components/EffectsGenerator.js +39 -38
  47. package/dist/components/EnvironmentManager.d.ts +4 -4
  48. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  49. package/dist/components/FlowNetGrid.d.ts +8 -4
  50. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  51. package/dist/components/FlowNetGrid.js +31 -13
  52. package/dist/components/FractalGrid.d.ts +8 -12
  53. package/dist/components/FractalGrid.d.ts.map +1 -1
  54. package/dist/components/FractalGrid.js +31 -13
  55. package/dist/components/GirihGrid.d.ts +8 -1
  56. package/dist/components/GirihGrid.d.ts.map +1 -1
  57. package/dist/components/GirihGrid.js +31 -13
  58. package/dist/components/Glyphs.d.ts +7 -1
  59. package/dist/components/Glyphs.d.ts.map +1 -1
  60. package/dist/components/Glyphs.js +40 -34
  61. package/dist/components/GravWaveGrid.d.ts +8 -1
  62. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  63. package/dist/components/GravWaveGrid.js +31 -13
  64. package/dist/components/GridsGenerator.d.ts +9 -3
  65. package/dist/components/GridsGenerator.d.ts.map +1 -1
  66. package/dist/components/GridsGenerator.js +41 -18
  67. package/dist/components/HexGrid.d.ts +8 -10
  68. package/dist/components/HexGrid.d.ts.map +1 -1
  69. package/dist/components/HexGrid.js +31 -13
  70. package/dist/components/HilbertGrid.d.ts +25 -0
  71. package/dist/components/HilbertGrid.d.ts.map +1 -0
  72. package/dist/components/HilbertGrid.js +93 -0
  73. package/dist/components/HyperbolicGrid.d.ts +8 -4
  74. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  75. package/dist/components/HyperbolicGrid.js +31 -13
  76. package/dist/components/LandscapeBuilder.d.ts +1 -1
  77. package/dist/components/LandscapeBuilder.d.ts.map +1 -1
  78. package/dist/components/LandscapeBuilder.js +1 -1
  79. package/dist/components/LandscapeObject.d.ts +1 -1
  80. package/dist/components/LandscapeObject.d.ts.map +1 -1
  81. package/dist/components/LandscapeObject.js +1 -1
  82. package/dist/components/LensingGrid.d.ts +25 -0
  83. package/dist/components/LensingGrid.d.ts.map +1 -0
  84. package/dist/components/LensingGrid.js +81 -0
  85. package/dist/components/MoireGrid.d.ts +8 -12
  86. package/dist/components/MoireGrid.d.ts.map +1 -1
  87. package/dist/components/MoireGrid.js +31 -13
  88. package/dist/components/ObjectNode.d.ts.map +1 -1
  89. package/dist/components/ObjectNode.js +2 -2
  90. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  91. package/dist/components/ObjectsRenderer.js +37 -3
  92. package/dist/components/OceanBuilder.d.ts +1 -1
  93. package/dist/components/OceanBuilder.js +1 -1
  94. package/dist/components/ParastichyGrid.d.ts +25 -0
  95. package/dist/components/ParastichyGrid.d.ts.map +1 -0
  96. package/dist/components/ParastichyGrid.js +82 -0
  97. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  98. package/dist/components/ParticlesGenerator.js +6 -0
  99. package/dist/components/PhyllotaxisGrid.d.ts +25 -0
  100. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
  101. package/dist/components/PhyllotaxisGrid.js +95 -0
  102. package/dist/components/QuasiGrid.d.ts +8 -11
  103. package/dist/components/QuasiGrid.d.ts.map +1 -1
  104. package/dist/components/QuasiGrid.js +31 -13
  105. package/dist/components/RadarGrid.d.ts +8 -13
  106. package/dist/components/RadarGrid.d.ts.map +1 -1
  107. package/dist/components/RadarGrid.js +31 -13
  108. package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
  109. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  110. package/dist/components/ReactionDiffusionGrid.js +33 -139
  111. package/dist/components/SceneBuilder.js +1 -1
  112. package/dist/components/SkySystem.d.ts +1 -1
  113. package/dist/components/SparklesBurst.d.ts +7 -1
  114. package/dist/components/SparklesBurst.d.ts.map +1 -1
  115. package/dist/components/SparklesBurst.js +31 -28
  116. package/dist/components/TerrainBuilder.d.ts +1 -1
  117. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  118. package/dist/components/TerrainBuilder.js +1 -1
  119. package/dist/components/TruchetGrid.d.ts +25 -0
  120. package/dist/components/TruchetGrid.d.ts.map +1 -0
  121. package/dist/components/TruchetGrid.js +82 -0
  122. package/dist/components/VoronoiGrid.d.ts +8 -10
  123. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  124. package/dist/components/VoronoiGrid.js +31 -13
  125. package/dist/components/WallpaperGrid.d.ts +8 -1
  126. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  127. package/dist/components/WallpaperGrid.js +33 -210
  128. package/dist/components/effects/AuraEffect.d.ts +8 -3
  129. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  130. package/dist/components/effects/AuraEffect.js +49 -24
  131. package/dist/components/effects/AuroraEffect.d.ts +8 -3
  132. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  133. package/dist/components/effects/AuroraEffect.js +45 -25
  134. package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
  135. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  136. package/dist/components/effects/BlackHoleEffect.js +42 -21
  137. package/dist/components/effects/ConstellationEffect.d.ts +8 -3
  138. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  139. package/dist/components/effects/ConstellationEffect.js +49 -23
  140. package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
  141. package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
  142. package/dist/components/effects/DandelionSeedsEffect.js +19 -9
  143. package/dist/components/effects/DataStreamEffect.d.ts +8 -3
  144. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  145. package/dist/components/effects/DataStreamEffect.js +54 -26
  146. package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
  147. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  148. package/dist/components/effects/DnaHelixEffect.js +62 -30
  149. package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
  150. package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
  151. package/dist/components/effects/FallingLeavesEffect.js +19 -9
  152. package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
  153. package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
  154. package/dist/components/effects/FieldLinesEffect.js +30 -20
  155. package/dist/components/effects/Fire.d.ts +8 -3
  156. package/dist/components/effects/Fire.d.ts.map +1 -1
  157. package/dist/components/effects/Fire.js +47 -10
  158. package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
  159. package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
  160. package/dist/components/effects/FireflySwarmEffect.js +19 -9
  161. package/dist/components/effects/Flares.d.ts +10 -3
  162. package/dist/components/effects/Flares.d.ts.map +1 -1
  163. package/dist/components/effects/Flares.js +53 -56
  164. package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
  165. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  166. package/dist/components/effects/ForcefieldEffect.js +52 -33
  167. package/dist/components/effects/GalaxyEffect.d.ts +7 -2
  168. package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
  169. package/dist/components/effects/GalaxyEffect.js +19 -9
  170. package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
  171. package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
  172. package/dist/components/effects/HarmonicShellEffect.js +30 -22
  173. package/dist/components/effects/HologramEffect.d.ts +8 -3
  174. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  175. package/dist/components/effects/HologramEffect.js +52 -23
  176. package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
  177. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  178. package/dist/components/effects/IceCrystalsEffect.js +36 -21
  179. package/dist/components/effects/IceHaloEffect.d.ts +7 -2
  180. package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
  181. package/dist/components/effects/IceHaloEffect.js +19 -9
  182. package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
  183. package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
  184. package/dist/components/effects/LichtenbergEffect.js +19 -9
  185. package/dist/components/effects/LightningEffect.d.ts +8 -3
  186. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  187. package/dist/components/effects/LightningEffect.js +54 -32
  188. package/dist/components/effects/MoleculesEffect.d.ts +8 -3
  189. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  190. package/dist/components/effects/MoleculesEffect.js +31 -21
  191. package/dist/components/effects/MurmurationEffect.d.ts +7 -2
  192. package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
  193. package/dist/components/effects/MurmurationEffect.js +19 -9
  194. package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
  195. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  196. package/dist/components/effects/NeuralNetworkEffect.js +66 -33
  197. package/dist/components/effects/OrbEffect.d.ts +8 -3
  198. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  199. package/dist/components/effects/OrbEffect.js +89 -42
  200. package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
  201. package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
  202. package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
  203. package/dist/components/effects/PortalEffect.d.ts +8 -3
  204. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  205. package/dist/components/effects/PortalEffect.js +41 -25
  206. package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
  207. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  208. package/dist/components/effects/ShockwaveEffect.js +19 -9
  209. package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
  210. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  211. package/dist/components/effects/SmokePlumeEffect.js +30 -20
  212. package/dist/components/effects/SmokeRibbon.d.ts +8 -2
  213. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  214. package/dist/components/effects/SmokeRibbon.js +34 -24
  215. package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
  216. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  217. package/dist/components/effects/SmokeRingEffect.js +33 -21
  218. package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
  219. package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
  220. package/dist/components/effects/StrangeAttractorEffect.js +30 -20
  221. package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
  222. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  223. package/dist/components/effects/VolumetricFogEffect.js +38 -20
  224. package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
  225. package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
  226. package/dist/components/effects/WaterCausticsEffect.js +19 -9
  227. package/dist/components/effects/index.d.ts +0 -1
  228. package/dist/components/effects/index.d.ts.map +1 -1
  229. package/dist/components/effects/index.js +0 -1
  230. package/dist/components/index.d.ts +14 -1
  231. package/dist/components/index.d.ts.map +1 -1
  232. package/dist/components/index.js +7 -1
  233. package/dist/components/landscape/LandscapeMesh.js +1 -1
  234. package/dist/components/landscape/types.d.ts +1 -1
  235. package/dist/components/landscape/types.d.ts.map +1 -1
  236. package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
  237. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
  238. package/dist/components/particles/MagneticBottleParticles.js +618 -0
  239. package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
  240. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
  241. package/dist/components/particles/ShapeBurstParticles.js +588 -0
  242. package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
  243. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
  244. package/dist/components/particles/ShapeFlowParticles.js +755 -0
  245. package/dist/components/particles/index.d.ts +6 -0
  246. package/dist/components/particles/index.d.ts.map +1 -1
  247. package/dist/components/particles/index.js +3 -0
  248. package/dist/components/terrain/types.d.ts +1 -1
  249. package/dist/components/terrain/types.d.ts.map +1 -1
  250. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
  251. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  252. package/dist/components/volumetricClouds/types.d.ts +1 -1
  253. package/dist/components/volumetricClouds/types.d.ts.map +1 -1
  254. package/dist/components/water/types.d.ts +1 -1
  255. package/dist/components/water/types.d.ts.map +1 -1
  256. package/dist/hooks/index.d.ts +2 -0
  257. package/dist/hooks/index.d.ts.map +1 -1
  258. package/dist/hooks/index.js +1 -0
  259. package/dist/hooks/useConfigDriver.d.ts +22 -0
  260. package/dist/hooks/useConfigDriver.d.ts.map +1 -0
  261. package/dist/hooks/useConfigDriver.js +43 -0
  262. package/dist/hooks/useConfigLive.d.ts +1 -1
  263. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  264. package/dist/hooks/useLandscapeMaps.d.ts +1 -1
  265. package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
  266. package/dist/hooks/useOceanMaterial.d.ts +1 -1
  267. package/dist/hooks/useThunder.d.ts +1 -1
  268. package/dist/index.d.ts +1 -2
  269. package/dist/index.d.ts.map +1 -1
  270. package/dist/index.js +1 -2
  271. package/dist/interactions/index.d.ts +2 -1
  272. package/dist/interactions/index.d.ts.map +1 -1
  273. package/dist/interactions/index.js +1 -1
  274. package/dist/interactions/runner.d.ts +18 -3
  275. package/dist/interactions/runner.d.ts.map +1 -1
  276. package/dist/interactions/runner.js +25 -2
  277. package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
  278. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
  279. package/dist/operations/catalogue/curlSmoke.js +178 -0
  280. package/dist/operations/catalogue/displayImage.d.ts.map +1 -1
  281. package/dist/operations/catalogue/displayImage.js +1 -0
  282. package/dist/operations/catalogue/dissolve.d.ts +3 -0
  283. package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
  284. package/dist/operations/catalogue/dissolve.js +57 -0
  285. package/dist/operations/catalogue/emberAsh.d.ts +3 -0
  286. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
  287. package/dist/operations/catalogue/emberAsh.js +171 -0
  288. package/dist/operations/catalogue/fade.d.ts.map +1 -1
  289. package/dist/operations/catalogue/fade.js +1 -0
  290. package/dist/operations/catalogue/flip.d.ts +3 -0
  291. package/dist/operations/catalogue/flip.d.ts.map +1 -0
  292. package/dist/operations/catalogue/flip.js +69 -0
  293. package/dist/operations/catalogue/flock.d.ts +3 -0
  294. package/dist/operations/catalogue/flock.d.ts.map +1 -0
  295. package/dist/operations/catalogue/flock.js +163 -0
  296. package/dist/operations/catalogue/focus.d.ts.map +1 -1
  297. package/dist/operations/catalogue/focus.js +1 -0
  298. package/dist/operations/catalogue/frame.d.ts +3 -0
  299. package/dist/operations/catalogue/frame.d.ts.map +1 -0
  300. package/dist/operations/catalogue/frame.js +44 -0
  301. package/dist/operations/catalogue/frost.d.ts +3 -0
  302. package/dist/operations/catalogue/frost.d.ts.map +1 -0
  303. package/dist/operations/catalogue/frost.js +111 -0
  304. package/dist/operations/catalogue/fxInstances.d.ts +21 -0
  305. package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
  306. package/dist/operations/catalogue/fxInstances.js +47 -0
  307. package/dist/operations/catalogue/fxPoints.d.ts +22 -0
  308. package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
  309. package/dist/operations/catalogue/fxPoints.js +70 -0
  310. package/dist/operations/catalogue/glow.d.ts.map +1 -1
  311. package/dist/operations/catalogue/glow.js +2 -1
  312. package/dist/operations/catalogue/heatCracks.d.ts +3 -0
  313. package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
  314. package/dist/operations/catalogue/heatCracks.js +134 -0
  315. package/dist/operations/catalogue/hologram.d.ts +3 -0
  316. package/dist/operations/catalogue/hologram.d.ts.map +1 -0
  317. package/dist/operations/catalogue/hologram.js +118 -0
  318. package/dist/operations/catalogue/inkBloom.d.ts +3 -0
  319. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
  320. package/dist/operations/catalogue/inkBloom.js +156 -0
  321. package/dist/operations/catalogue/ivy.d.ts +13 -0
  322. package/dist/operations/catalogue/ivy.d.ts.map +1 -0
  323. package/dist/operations/catalogue/ivy.js +469 -0
  324. package/dist/operations/catalogue/jelly.d.ts +3 -0
  325. package/dist/operations/catalogue/jelly.d.ts.map +1 -0
  326. package/dist/operations/catalogue/jelly.js +50 -0
  327. package/dist/operations/catalogue/kintsugi.d.ts +3 -0
  328. package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
  329. package/dist/operations/catalogue/kintsugi.js +173 -0
  330. package/dist/operations/catalogue/lidarScan.d.ts +3 -0
  331. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
  332. package/dist/operations/catalogue/lidarScan.js +240 -0
  333. package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
  334. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
  335. package/dist/operations/catalogue/liquidMetal.js +122 -0
  336. package/dist/operations/catalogue/metalize.d.ts +3 -0
  337. package/dist/operations/catalogue/metalize.d.ts.map +1 -0
  338. package/dist/operations/catalogue/metalize.js +135 -0
  339. package/dist/operations/catalogue/moveToFront.d.ts.map +1 -1
  340. package/dist/operations/catalogue/moveToFront.js +1 -0
  341. package/dist/operations/catalogue/orbit.d.ts +3 -0
  342. package/dist/operations/catalogue/orbit.d.ts.map +1 -0
  343. package/dist/operations/catalogue/orbit.js +29 -0
  344. package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
  345. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
  346. package/dist/operations/catalogue/particleSwarm.js +138 -0
  347. package/dist/operations/catalogue/petalPeel.d.ts +3 -0
  348. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
  349. package/dist/operations/catalogue/petalPeel.js +137 -0
  350. package/dist/operations/catalogue/petrify.d.ts +3 -0
  351. package/dist/operations/catalogue/petrify.d.ts.map +1 -0
  352. package/dist/operations/catalogue/petrify.js +94 -0
  353. package/dist/operations/catalogue/portal.d.ts +3 -0
  354. package/dist/operations/catalogue/portal.d.ts.map +1 -0
  355. package/dist/operations/catalogue/portal.js +224 -0
  356. package/dist/operations/catalogue/print3d.d.ts +3 -0
  357. package/dist/operations/catalogue/print3d.d.ts.map +1 -0
  358. package/dist/operations/catalogue/print3d.js +275 -0
  359. package/dist/operations/catalogue/rainBeads.d.ts +3 -0
  360. package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
  361. package/dist/operations/catalogue/rainBeads.js +223 -0
  362. package/dist/operations/catalogue/restPose.d.ts +21 -0
  363. package/dist/operations/catalogue/restPose.d.ts.map +1 -0
  364. package/dist/operations/catalogue/restPose.js +55 -0
  365. package/dist/operations/catalogue/rimLight.d.ts +3 -0
  366. package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
  367. package/dist/operations/catalogue/rimLight.js +72 -0
  368. package/dist/operations/catalogue/sandErosion.d.ts +3 -0
  369. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
  370. package/dist/operations/catalogue/sandErosion.js +167 -0
  371. package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
  372. package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
  373. package/dist/operations/catalogue/shaderLayers.js +322 -0
  374. package/dist/operations/catalogue/shatter.d.ts +3 -0
  375. package/dist/operations/catalogue/shatter.d.ts.map +1 -0
  376. package/dist/operations/catalogue/shatter.js +267 -0
  377. package/dist/operations/catalogue/silkDrape.d.ts +3 -0
  378. package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
  379. package/dist/operations/catalogue/silkDrape.js +340 -0
  380. package/dist/operations/catalogue/spin.d.ts +3 -0
  381. package/dist/operations/catalogue/spin.d.ts.map +1 -0
  382. package/dist/operations/catalogue/spin.js +42 -0
  383. package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
  384. package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
  385. package/dist/operations/catalogue/surfaceSample.js +187 -0
  386. package/dist/operations/catalogue/swirl.d.ts +3 -0
  387. package/dist/operations/catalogue/swirl.d.ts.map +1 -0
  388. package/dist/operations/catalogue/swirl.js +69 -0
  389. package/dist/operations/catalogue/teleport.d.ts +3 -0
  390. package/dist/operations/catalogue/teleport.d.ts.map +1 -0
  391. package/dist/operations/catalogue/teleport.js +213 -0
  392. package/dist/operations/catalogue/transitionField.d.ts +124 -0
  393. package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
  394. package/dist/operations/catalogue/transitionField.js +278 -0
  395. package/dist/operations/catalogue/unweave.d.ts +3 -0
  396. package/dist/operations/catalogue/unweave.d.ts.map +1 -0
  397. package/dist/operations/catalogue/unweave.js +233 -0
  398. package/dist/operations/catalogue/visibility.d.ts.map +1 -1
  399. package/dist/operations/catalogue/visibility.js +1 -0
  400. package/dist/operations/catalogue/voxelize.d.ts +3 -0
  401. package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
  402. package/dist/operations/catalogue/voxelize.js +148 -0
  403. package/dist/operations/catalogue/warmup.d.ts +22 -0
  404. package/dist/operations/catalogue/warmup.d.ts.map +1 -0
  405. package/dist/operations/catalogue/warmup.js +106 -0
  406. package/dist/operations/catalogue/zoom.d.ts.map +1 -1
  407. package/dist/operations/catalogue/zoom.js +1 -0
  408. package/dist/operations/index.d.ts +4 -2
  409. package/dist/operations/index.d.ts.map +1 -1
  410. package/dist/operations/index.js +4 -2
  411. package/dist/operations/objectEffects.d.ts +46 -0
  412. package/dist/operations/objectEffects.d.ts.map +1 -0
  413. package/dist/operations/objectEffects.js +136 -0
  414. package/dist/operations/registry.d.ts +7 -2
  415. package/dist/operations/registry.d.ts.map +1 -1
  416. package/dist/operations/registry.js +45 -3
  417. package/dist/operations/runtime.d.ts +40 -2
  418. package/dist/operations/runtime.d.ts.map +1 -1
  419. package/dist/operations/runtime.js +164 -8
  420. package/dist/operations/types.d.ts +29 -3
  421. package/dist/operations/types.d.ts.map +1 -1
  422. package/dist/operations/types.js +6 -0
  423. package/dist/operations/useObjectEffectLayers.d.ts +4 -0
  424. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
  425. package/dist/operations/useObjectEffectLayers.js +42 -0
  426. package/dist/operations/useOperationsRuntime.d.ts.map +1 -1
  427. package/dist/operations/useOperationsRuntime.js +42 -4
  428. package/dist/presets/landscapePresets.d.ts +1 -1
  429. package/dist/presets/landscapePresets.d.ts.map +1 -1
  430. package/dist/presets/landscapePresets.js +1 -1
  431. package/dist/presets/landscapeTypes.d.ts +1 -1
  432. package/dist/presets/landscapeTypes.d.ts.map +1 -1
  433. package/dist/presets/landscapeTypes.js +1 -1
  434. package/dist/presets/oceanSurfacePresets.d.ts +1 -1
  435. package/dist/presets/terrainPresets.d.ts +1 -1
  436. package/dist/presets/terrainPresets.d.ts.map +1 -1
  437. package/dist/presets/volumetricCloudPresets.d.ts +1 -1
  438. package/dist/types/cloudConfigs.d.ts +2 -309
  439. package/dist/types/cloudConfigs.d.ts.map +1 -1
  440. package/dist/types/cloudConfigs.js +2 -339
  441. package/dist/types/gridConfigs.d.ts +103 -0
  442. package/dist/types/gridConfigs.d.ts.map +1 -1
  443. package/dist/types/index.d.ts +9 -9
  444. package/dist/types/index.d.ts.map +1 -1
  445. package/dist/types/index.js +4 -4
  446. package/dist/types/landscapeConfigs.d.ts +2 -217
  447. package/dist/types/landscapeConfigs.d.ts.map +1 -1
  448. package/dist/types/landscapeConfigs.js +2 -256
  449. package/dist/types/oceanConfigs.d.ts +2 -289
  450. package/dist/types/oceanConfigs.d.ts.map +1 -1
  451. package/dist/types/oceanConfigs.js +2 -380
  452. package/dist/types/terrainConfigs.d.ts +2 -250
  453. package/dist/types/terrainConfigs.d.ts.map +1 -1
  454. package/dist/types/terrainConfigs.js +2 -292
  455. package/dist/utils/cloudUniforms.d.ts +1 -1
  456. package/dist/utils/configAnimations.d.ts +6 -0
  457. package/dist/utils/configAnimations.d.ts.map +1 -1
  458. package/dist/utils/configAnimations.js +14 -0
  459. package/dist/utils/gridConfig.d.ts +19 -0
  460. package/dist/utils/gridConfig.d.ts.map +1 -0
  461. package/dist/utils/gridConfig.js +52 -0
  462. package/dist/utils/handleCloudsAnimations.d.ts +1 -1
  463. package/dist/utils/handleCloudsAnimations.js +1 -1
  464. package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
  465. package/dist/utils/hasHoverAnimation.js +0 -2
  466. package/dist/utils/landscapeUniforms.d.ts +1 -1
  467. package/dist/utils/landscapeUniforms.d.ts.map +1 -1
  468. package/dist/utils/oceanUniforms.d.ts +1 -1
  469. package/dist/utils/particleShape.d.ts +33 -0
  470. package/dist/utils/particleShape.d.ts.map +1 -0
  471. package/dist/utils/particleShape.js +207 -0
  472. package/dist/utils/particleTrails.d.ts.map +1 -1
  473. package/dist/utils/particleTrails.js +29 -14
  474. package/dist/utils/terrainUniforms.d.ts +1 -1
  475. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  476. package/package.json +2 -2
@@ -0,0 +1,135 @@
1
+ // Metalize — the object turns to metal, the way a pour of molten metal would
2
+ // coat it: a bright molten front sweeps over the surface (white-hot at the lip,
3
+ // cooling to orange), a liquid ripple settles just behind it, and what it leaves
4
+ // is polished metal. Presets for gold, silver, chrome, copper, bronze, rose gold,
5
+ // anodised titanium (thin-film iridescence) and gunmetal, or a custom tint;
6
+ // polish blurs the reflection from mirror to brushed.
7
+ //
8
+ // The reflection is the same procedural studio environment as Liquid metal, so
9
+ // the metal reads in any scene, with or without an environment map.
10
+ // A state, not an exit: it stays metal while on; reverting melts it back off.
11
+ import { Color } from 'three';
12
+ import { defineOperation } from '../types.js';
13
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
14
+ import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams } from './transitionField.js';
15
+ const P = 'Mtl';
16
+ const KEY = 'metalize';
17
+ const STATE = '__opMetalize';
18
+ /** Metal base colours (linear-ish F0 tints). Titanium is special-cased (iridescent). */
19
+ const METALS = {
20
+ gold: '#ffc766', silver: '#e8ecf0', chrome: '#dfe6ee', copper: '#f0936a', bronze: '#c8955a',
21
+ roseGold: '#f2b0a0', titanium: '#b8bfc8', gunmetal: '#5c6068',
22
+ };
23
+ const DEFAULT_CUSTOM = '#9fd0ff';
24
+ function layerFor(st) {
25
+ return {
26
+ uniforms: { ...fieldUniforms(P, st.field), uMtlTint: st.tint, uMtlRough: st.rough, uMtlIrid: st.irid, uMtlLip: st.lip, uMtlCool: st.cool },
27
+ common: `varying vec3 vMtlQ;\nvarying vec3 vMtlR;\nvarying vec3 vMtlView;\n${fieldGlsl(P)}`,
28
+ vertex: /* glsl */ `
29
+ vMtlR = (uMtlRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
30
+ vMtlQ = MtlNorm(vMtlR);
31
+ vMtlView = (modelViewMatrix * vec4(transformed, 1.0)).xyz;`,
32
+ fragment: /* glsl */ `
33
+ {
34
+ float d = MtlThreshold() - MtlField(vMtlQ); // > 0 behind the front
35
+ float m = smoothstep(0.0, uMtlEdgeWidth, d);
36
+ if (m > 0.0 || d > -0.05) {
37
+ vec3 nv = normalize(cross(dFdx(vMtlView), dFdy(vMtlView)));
38
+ #if defined( STANDARD ) || defined( PHONG ) || defined( LAMBERT ) || defined( TOON )
39
+ vec3 n = normalize(normal);
40
+ #else
41
+ vec3 n = nv;
42
+ #endif
43
+ // liquid settling just behind the front: a fading ripple in the normal
44
+ float wet = 1.0 - smoothstep(0.0, 0.18, d);
45
+ vec3 rp = vMtlR / uMtlExtent * 40.0;
46
+ n = normalize(n + wet * m * 0.25 * vec3(sin(rp.x + d * 60.0), 0.0, cos(rp.z + d * 60.0)));
47
+ vec3 v = normalize(vMtlView);
48
+ vec3 rw = normalize((vec4(reflect(v, n), 0.0) * viewMatrix).xyz);
49
+ float up = rw.y;
50
+ vec3 env = mix(vec3(0.05), vec3(0.85, 0.9, 1.0), smoothstep(-0.15, 0.6, up));
51
+ env += vec3(1.4) * exp(-abs(up - 0.02) * 40.0);
52
+ env += vec3(2.2) * smoothstep(0.92, 0.99, dot(rw, normalize(vec3(0.6, 0.55, 0.6))));
53
+ env += vec3(1.2) * smoothstep(0.9, 0.98, dot(rw, normalize(vec3(-0.7, 0.35, -0.3))));
54
+ // polish: rough metal sees a blurred, flatter studio
55
+ env = mix(env, vec3(0.55, 0.57, 0.6), uMtlRough * 0.85);
56
+ float ndv = abs(dot(n, -v));
57
+ vec3 tint = uMtlTint;
58
+ // anodised titanium: thin-film interference, hue shifts with the viewing angle
59
+ vec3 film = 0.5 + 0.5 * cos(6.2832 * (ndv * 1.4 + vec3(0.0, 0.33, 0.67) + 0.15));
60
+ tint = mix(tint, film * 0.9 + 0.1, uMtlIrid);
61
+ float fres = 0.7 + 0.3 * pow(1.0 - ndv, 4.0);
62
+ vec3 metal = tint * env * fres;
63
+ outgoingLight = mix(outgoingLight, metal, m);
64
+ // the molten lip: white-hot at the edge, cooling to orange just behind
65
+ float lip = exp(-abs(d) / 0.012) * step(0.0001, uMtlProgress) * step(uMtlProgress, 0.9999);
66
+ float cooling = exp(-max(d, 0.0) / 0.05) * m * step(uMtlProgress, 0.9999);
67
+ outgoingLight += uMtlLip * lip * 2.2 + uMtlCool * cooling * 0.9;
68
+ }
69
+ }`,
70
+ };
71
+ }
72
+ export default defineOperation({
73
+ value: 'metalize',
74
+ label: 'Metalize',
75
+ description: 'Pour molten metal over the targets and leave them polished gold, chrome, copper… — reverting melts it off',
76
+ channel: 'visual',
77
+ multi: true,
78
+ toggles: true,
79
+ usableIn: ['interaction', 'action', 'object'],
80
+ stack: 'surface',
81
+ params: {
82
+ metal: {
83
+ type: 'select', label: 'Metal', default: 'gold',
84
+ options: [
85
+ { value: 'gold', label: 'Gold' }, { value: 'silver', label: 'Silver' }, { value: 'chrome', label: 'Chrome' },
86
+ { value: 'copper', label: 'Copper' }, { value: 'bronze', label: 'Bronze' }, { value: 'roseGold', label: 'Rose gold' },
87
+ { value: 'titanium', label: 'Anodised titanium' }, { value: 'gunmetal', label: 'Gunmetal' }, { value: 'custom', label: 'Custom colour' },
88
+ ],
89
+ },
90
+ color: { type: 'color', label: 'Custom colour', default: DEFAULT_CUSTOM, hint: 'Pick a colour to tint the metal (overrides the preset)' },
91
+ lipColor: { type: 'color', label: 'Molten edge', default: '#ffd9a6', hint: 'Colour of the pouring front' },
92
+ coolColor: { type: 'color', label: 'Cooling glow', default: '#ff6a1a', hint: 'Glow just behind the front as it cools' },
93
+ polish: { type: 'number', label: 'Polish', default: 0.85, min: 0, max: 1, step: 0.01, hint: '1 = mirror, 0 = brushed' },
94
+ direction: { type: 'select', label: 'Pour direction', default: 'down', options: DIRECTION_OPTIONS },
95
+ scale: { type: 'number', label: 'Front pattern', default: 2, min: 0.5, max: 12, step: 0.1 },
96
+ duration: { type: 'number', label: 'Duration', default: 2.2, min: 0.3, max: 12, step: 0.1, unit: 's' },
97
+ },
98
+ apply(target, p, ctx) {
99
+ let st = target.userData[STATE];
100
+ if (!st) {
101
+ const field = createFieldState(target);
102
+ field.edgeWidth.value = 0.05;
103
+ st = { field, tint: { value: new Color() }, rough: { value: 0.15 }, irid: { value: 0 }, lip: { value: new Color() }, cool: { value: new Color() }, mats: new Set() };
104
+ const own = st;
105
+ const layer = layerFor(own);
106
+ forEachMeshMaterial(target, (mat, mesh) => {
107
+ if (mesh.userData?.__opFxHelper)
108
+ return;
109
+ if (addLayer(mat, KEY, layer))
110
+ own.mats.add(mat);
111
+ });
112
+ target.userData[STATE] = st;
113
+ }
114
+ const s = st;
115
+ setFieldParams(s.field, p, target, ctx);
116
+ // a colour the user picked always wins (choosing "Custom colour" is not required)
117
+ const metal = String(p.metal);
118
+ const custom = metal === 'custom' || String(p.color).toLowerCase() !== DEFAULT_CUSTOM;
119
+ s.tint.value.set(custom ? String(p.color) : (METALS[metal] ?? METALS.gold));
120
+ s.irid.value = metal === 'titanium' && !custom ? 0.85 : 0;
121
+ s.lip.value.set(String(p.lipColor));
122
+ s.cool.value.set(String(p.coolColor));
123
+ s.rough.value = 1 - Number(p.polish);
124
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
125
+ },
126
+ revert(target, p) {
127
+ const s = target.userData[STATE];
128
+ if (!s)
129
+ return;
130
+ return runProgress(target, s.field, 0, {
131
+ duration: Number(p.duration), ease: 'power1.inOut',
132
+ onComplete: () => { s.mats.forEach(m => removeLayer(m, KEY)); delete target.userData[STATE]; },
133
+ });
134
+ },
135
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"moveToFront.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/moveToFront.ts"],"names":[],"mappings":";AAEA,wBAuBG"}
1
+ {"version":3,"file":"moveToFront.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/moveToFront.ts"],"names":[],"mappings":";AAEA,wBAwBG"}
@@ -3,6 +3,7 @@ export default defineOperation({
3
3
  value: 'moveToFront',
4
4
  label: 'Bring to front',
5
5
  description: 'Bring the target in front of the camera',
6
+ channel: 'transform',
6
7
  multi: false,
7
8
  toggles: true,
8
9
  usableIn: ['interaction', 'action'],
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=orbit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orbit.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/orbit.ts"],"names":[],"mappings":";AAMA,wBAuBG"}
@@ -0,0 +1,29 @@
1
+ // Orbit — the camera circles the target at its current distance and height,
2
+ // turning to face it on the way in. A full circle ends where it started;
3
+ // reverting (actions) flies back to where the camera was.
4
+ import { Box3, Vector3 } from 'three';
5
+ import { defineOperation } from '../types.js';
6
+ export default defineOperation({
7
+ value: 'orbit',
8
+ label: 'Orbit',
9
+ description: 'Circle the camera around the target, keeping its distance and height',
10
+ channel: 'camera',
11
+ multi: false,
12
+ toggles: false,
13
+ usableIn: ['interaction', 'action'],
14
+ exclusive: { group: 'camera', release: 'handover' },
15
+ params: {
16
+ angle: { type: 'number', label: 'Angle', default: 360, min: 15, max: 720, step: 15, unit: '°', hint: '360 ends where it started' },
17
+ reverse: { type: 'boolean', label: 'Clockwise', default: false },
18
+ duration: { type: 'number', label: 'Duration', default: 6, min: 0.5, max: 60, step: 0.5, unit: 's' },
19
+ },
20
+ apply(target, p, ctx) {
21
+ ctx.saveCameraHome();
22
+ const c = new Box3().setFromObject(target).getCenter(new Vector3());
23
+ const deg = Number(p.angle) * (p.reverse ? -1 : 1);
24
+ void ctx.tools.orbitCamera([c.x, c.y, c.z], deg, Number(p.duration), 'power1.inOut');
25
+ },
26
+ revert(_target, p, ctx) {
27
+ ctx.restoreCameraHome(Math.min(1.5, Number(p.duration)), 'power2.inOut');
28
+ },
29
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=particleSwarm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleSwarm.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/particleSwarm.ts"],"names":[],"mappings":";AAiCA,wBAsGG"}
@@ -0,0 +1,138 @@
1
+ // Particle swarm — the target comes apart into its own surface, particle by
2
+ // particle (each carries the colour of the spot it left), and the particles
3
+ // sweep up into a slow vortex around the object's centre with differential
4
+ // rotation (inner rings faster, like a disc). While it is on, the swarm keeps
5
+ // turning. Reverting pulls every particle back to its exact spot and the
6
+ // surface closes behind them.
7
+ import { gsap } from 'gsap';
8
+ import { defineOperation } from '../types.js';
9
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
10
+ import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams, surfaceLayer, syncRoot, } from './transitionField.js';
11
+ import { sampleSurfaceCached } from './surfaceSample.js';
12
+ import { GLSL_POINT_SIZE, createFxPoints, disposeFxPoints } from './fxPoints.js';
13
+ const P = 'Swm';
14
+ const KEY = 'particleSwarm';
15
+ const STATE = '__opSwarm';
16
+ /** Flight length in progress units: the tween runs 0 → 1 + FLIGHT. */
17
+ const FLIGHT = 0.5;
18
+ export default defineOperation({
19
+ value: 'particleSwarm',
20
+ label: 'Particle swarm',
21
+ description: 'Break the targets into their own coloured particles that swirl around them — reverting reassembles',
22
+ channel: 'visual',
23
+ multi: true,
24
+ toggles: true,
25
+ usableIn: ['interaction', 'action'],
26
+ params: {
27
+ direction: { type: 'select', label: 'Direction', default: 'up', options: DIRECTION_OPTIONS },
28
+ particles: { type: 'number', label: 'Particles', default: 30000, min: 2000, max: 120000, step: 1000 },
29
+ particleSize: { type: 'number', label: 'Particle size', default: 1, min: 0.2, max: 4, step: 0.1, unit: '×' },
30
+ spread: { type: 'number', label: 'Spread', default: 1, min: 0.3, max: 3, step: 0.05, unit: '×', hint: 'Radius of the vortex' },
31
+ speed: { type: 'number', label: 'Swirl speed', default: 1, min: 0, max: 4, step: 0.05, unit: '×' },
32
+ edgeColor: { type: 'color', label: 'Edge colour', default: '#9fe8ff' },
33
+ glow: { type: 'boolean', label: 'Glow', default: true, hint: 'Additive light — off keeps the true surface colours' },
34
+ duration: { type: 'number', label: 'Duration', default: 2.8, min: 0.3, max: 12, step: 0.1, unit: 's' },
35
+ },
36
+ apply(target, p, ctx) {
37
+ let st = target.userData[STATE];
38
+ if (!st) {
39
+ const field = createFieldState(target);
40
+ field.edgeWidth.value = 0.05;
41
+ field.scale.value = 2.5;
42
+ const flight = { value: FLIGHT }, spread = { value: 1 }, speed = { value: 1 }, size = { value: 1 };
43
+ const sample = sampleSurfaceCached(target, Math.round(Number(p.particles)), 11);
44
+ const points = createFxPoints(target, sample, {
45
+ additive: !!p.glow,
46
+ uniforms: { ...fieldUniforms(P, field), uSwmFlight: flight, uSwmSpread: spread, uSwmSpeed: speed, uSwmPtSize: size },
47
+ vertexPars: fieldGlsl(P) + GLSL_POINT_SIZE,
48
+ vertexMain: /* glsl */ `
49
+ float birth = ${P}BirthOf(${P}Field(${P}Norm(aP)));
50
+ float a = clamp((uSwmProgress - birth) / uSwmFlight, 0.0, 1.0);
51
+ if (a <= 0.0) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); gl_PointSize = 0.0; vColor = vec3(0.0); vAlpha = 0.0; return; }
52
+ float E = uSwmExtent;
53
+ vec3 C = u${P}Min + u${P}Size * 0.5;
54
+ // destination: a tilted two-arm spiral galaxy around the object's centre.
55
+ // The arm pattern turns as one (so it never winds up); each particle adds a small
56
+ // differential drift, and the disc is lens-shaped: thick at the core, thin at the rim.
57
+ float R = 0.5 * max(u${P}Size.x, u${P}Size.z) * uSwmSpread + 0.15 * E;
58
+ float rn = 0.18 + 0.9 * pow(aR.x, 0.75);
59
+ float r = R * rn;
60
+ float arm = step(0.5, aR.z) * 3.14159;
61
+ float scatter = (aR.y + aR.w - 1.0) * (0.35 + 0.5 * rn);
62
+ float th = arm + 2.2 * log(rn + 0.15) + scatter
63
+ + uSwmSpeed * (0.35 * u${P}Time + 0.12 * u${P}Time / (0.3 + rn));
64
+ float h = (aR.y + fract(aR.w * 7.13) - 1.0) * 0.16 * E * (1.0 - 0.7 * rn);
65
+ vec3 disc = vec3(cos(th) * r, h, sin(th) * r);
66
+ // ~20° tilt so the spiral reads from a side view
67
+ float ct = 0.94, stl = 0.34;
68
+ disc = vec3(disc.x, disc.y * ct - disc.z * stl, disc.y * stl + disc.z * ct);
69
+ vec3 D = C + disc;
70
+ // quadratic Bézier: lift off along the normal, then into the slot
71
+ vec3 ctrl = aP + aN * (0.25 * E) + vec3(0.0, 0.12 * E, 0.0);
72
+ float k = a * a * (3.0 - 2.0 * a);
73
+ vec3 local = mix(mix(aP, ctrl, k), mix(ctrl, D, k), k);
74
+ vec4 mv = modelViewMatrix * vec4(local, 1.0);
75
+ gl_Position = projectionMatrix * mv;
76
+ // the colour of the spot it left, brighter in flight, a slow shimmer in the vortex
77
+ float flightGlow = sin(3.14159 * a);
78
+ float shimmer = 0.85 + 0.15 * sin(u${P}Time * (1.0 + 2.0 * aR.w) + aR.z * 6.2832);
79
+ vColor = aC * (1.0 + 0.4 * flightGlow) * shimmer + u${P}EdgeColor * 0.25 * flightGlow * flightGlow;
80
+ vAlpha = smoothstep(0.0, 0.08, a);
81
+ gl_PointSize = clamp(fxPointPx(E * 0.0045 * uSwmPtSize * (0.6 + 0.8 * aR.w), mv), 0.0, 20.0);`,
82
+ });
83
+ const own = {};
84
+ // while the swarm exists it keeps turning, even after the transition finished
85
+ const tick = () => { own.field.time.value += gsap.ticker.deltaRatio() / 60; syncRoot(target, own.field); };
86
+ Object.assign(own, { field, flight, spread, speed, size, points, mats: new Set(), tick });
87
+ st = own;
88
+ const layer = surfaceLayer(P, field, 'tint');
89
+ forEachMeshMaterial(target, (mat, mesh) => {
90
+ if (mesh.userData?.__opFxHelper)
91
+ return;
92
+ if (addLayer(mat, KEY, layer))
93
+ own.mats.add(mat);
94
+ });
95
+ gsap.ticker.add(tick);
96
+ target.userData[STATE] = st;
97
+ }
98
+ const s = st;
99
+ setFieldParams(s.field, p, target, ctx);
100
+ s.spread.value = Number(p.spread);
101
+ s.speed.value = Number(p.speed);
102
+ s.size.value = Number(p.particleSize);
103
+ return runProgress(target, s.field, 1 + FLIGHT, {
104
+ duration: Number(p.duration), ease: 'power1.inOut', clock: false,
105
+ onComplete: () => setMeshesHidden(target, true),
106
+ });
107
+ },
108
+ revert(target, p) {
109
+ const s = target.userData[STATE];
110
+ if (!s)
111
+ return;
112
+ setMeshesHidden(target, false);
113
+ return runProgress(target, s.field, 0, {
114
+ duration: Number(p.duration), ease: 'power1.inOut', clock: false,
115
+ onComplete: () => {
116
+ gsap.ticker.remove(s.tick);
117
+ s.mats.forEach(m => removeLayer(m, KEY));
118
+ disposeFxPoints(s.points);
119
+ delete target.userData[STATE];
120
+ },
121
+ });
122
+ },
123
+ });
124
+ function setMeshesHidden(target, hidden) {
125
+ target.traverse((c) => {
126
+ if (!c.isMesh || c.userData?.__opFxHelper)
127
+ return;
128
+ if (hidden) {
129
+ if (c.userData.__opSwmVis === undefined)
130
+ c.userData.__opSwmVis = c.visible;
131
+ c.visible = false;
132
+ }
133
+ else if (c.userData.__opSwmVis !== undefined) {
134
+ c.visible = c.userData.__opSwmVis;
135
+ delete c.userData.__opSwmVis;
136
+ }
137
+ });
138
+ }
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=petalPeel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"petalPeel.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/petalPeel.ts"],"names":[],"mappings":";AAsBA,wBAqHG"}
@@ -0,0 +1,137 @@
1
+ // Petal peel — the surface lifts off in thin flakes, each carrying the colour of
2
+ // the spot it came from: a flake first hinges up off the surface, then flutters
3
+ // down the way a leaf does — slow terminal-velocity fall, side-to-side sway and
4
+ // rocking tumble — and settles flat on the ground around the base. The flakes
5
+ // are real lit, double-sided instances (one instanced mesh, casting shadows).
6
+ // Reverting lifts them back into place and the surface closes.
7
+ import { CircleGeometry } from 'three';
8
+ import { defineOperation } from '../types.js';
9
+ import { GLSL_ROT, addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
10
+ import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress, setFieldParams, surfaceLayer, } from './transitionField.js';
11
+ import { sampleSurfaceCached } from './surfaceSample.js';
12
+ import { createFxInstances, disposeFxInstances } from './fxInstances.js';
13
+ const P = 'Pdl';
14
+ const KEY = 'petalPeel';
15
+ const STATE = '__opPetal';
16
+ const LIFE = 0.8;
17
+ export default defineOperation({
18
+ value: 'petalPeel',
19
+ label: 'Petal peel',
20
+ description: 'Peel the targets into flakes that flutter down like leaves — reverting lifts them back',
21
+ channel: 'visual',
22
+ multi: true,
23
+ toggles: true,
24
+ usableIn: ['interaction', 'action'],
25
+ params: {
26
+ direction: { type: 'select', label: 'Direction', default: 'down', options: DIRECTION_OPTIONS },
27
+ petals: { type: 'number', label: 'Petals', default: 2600, min: 300, max: 20000, step: 100 },
28
+ petalSize: { type: 'number', label: 'Petal size', default: 1, min: 0.3, max: 4, step: 0.05, unit: '×' },
29
+ drift: { type: 'number', label: 'Drift', default: 1, min: 0, max: 4, step: 0.05, unit: '×', hint: 'How far they sway and scatter' },
30
+ edgeColor: { type: 'color', label: 'Edge colour', default: '#fff1d6' },
31
+ scale: { type: 'number', label: 'Pattern', default: 2.5, min: 0.5, max: 12, step: 0.1 },
32
+ duration: { type: 'number', label: 'Duration', default: 4, min: 0.3, max: 14, step: 0.1, unit: 's' },
33
+ },
34
+ apply(target, p, ctx) {
35
+ let st = target.userData[STATE];
36
+ if (!st) {
37
+ const field = createFieldState(target);
38
+ field.edgeWidth.value = 0.04;
39
+ const life = { value: LIFE }, drift = { value: 1 };
40
+ const count = Math.round(Number(p.petals));
41
+ const sample = sampleSurfaceCached(target, count, 47);
42
+ // petal size from the surface area each one has to cover
43
+ const E = field.extent.value;
44
+ const size = E * 0.034 * Number(p.petalSize) * Math.sqrt(2600 / Math.max(300, count));
45
+ const geo = new CircleGeometry(0.5, 10);
46
+ geo.scale(size, size * 0.62, size);
47
+ const mesh = createFxInstances(target, {
48
+ geometry: geo,
49
+ count: sample.count, positions: sample.position.slice(0, sample.count * 3), colors: sample.color.slice(0, sample.count * 3),
50
+ attributes: {
51
+ aPdlP: [sample.position.slice(0, sample.count * 3), 3],
52
+ aPdlN: [sample.normal.slice(0, sample.count * 3), 3],
53
+ aPdlR: [sample.random.slice(0, sample.count * 4), 4],
54
+ },
55
+ layerKey: 'petalInstances', roughness: 0.7, metalness: 0, doubleSided: true,
56
+ layer: {
57
+ uniforms: { ...fieldUniforms(P, field), uPdlLife: life, uPdlDrift: drift },
58
+ common: fieldGlsl(P) + GLSL_ROT,
59
+ vertexPars: /* glsl */ `
60
+ attribute vec3 aPdlP; attribute vec3 aPdlN; attribute vec4 aPdlR;
61
+ // frame that lays the flake (XY plane) on the surface, facing out
62
+ mat3 pdlFrame() {
63
+ vec3 n = normalize(aPdlN + vec3(1e-4));
64
+ vec3 t = normalize(cross(abs(n.y) < 0.95 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0), n));
65
+ vec3 b = cross(n, t);
66
+ return mat3(t, b, n);
67
+ }
68
+ float pdlAge() { return (uPdlProgress - PdlBirthOf(PdlField(PdlNorm(aPdlP)))) / uPdlLife; }
69
+ // landing time (in age units) for a flake falling from its height at a steady speed
70
+ float pdlLand() { return 0.14 + 0.8 * clamp((aPdlP.y - uPdlMin.y) / max(uPdlSize.y, 1e-4), 0.0, 1.0); }
71
+ mat3 pdlRot(float a) {
72
+ float land = pdlLand();
73
+ float af = min(a, land);
74
+ float hinge = smoothstep(0.0, 0.14, a) * 1.1; // peel up off the surface
75
+ float tumble = max(af - 0.14, 0.0) * (4.0 + 5.0 * aPdlR.w) + sin(af * 14.0 + aPdlR.x * 6.28) * 0.6;
76
+ mat3 inAir = pdlFrame() * fxRot(vec3(1.0, 0.0, 0.0), hinge) * fxRot(normalize(aPdlR.xyz - 0.5 + vec3(1e-3)), tumble);
77
+ // after landing: lie flat, turned at random
78
+ mat3 lying = fxRot(vec3(0.0, 1.0, 0.0), aPdlR.y * 6.28) * mat3(1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);
79
+ float settle = smoothstep(land, land + 0.06, a);
80
+ return mat3(mix(inAir[0], lying[0], settle), mix(inAir[1], lying[1], settle), mix(inAir[2], lying[2], settle));
81
+ }`,
82
+ normal: `{ objectNormal = pdlRot(pdlAge()) * objectNormal; }`,
83
+ vertex: /* glsl */ `
84
+ {
85
+ float a = pdlAge();
86
+ if (a <= 0.0) { transformed *= 0.0; }
87
+ else {
88
+ a = min(a, 1.0);
89
+ float E = uPdlExtent;
90
+ float land = pdlLand();
91
+ float af = min(a, land);
92
+ float fall = max(af - 0.14, 0.0) / max(land - 0.14, 1e-3); // 0 → 1 while airborne
93
+ vec3 C = uPdlMin + uPdlSize * 0.5;
94
+ vec2 away = normalize(aPdlP.xz - C.xz + (aPdlR.xy - 0.5) * 0.3 + vec2(1e-4));
95
+ float sway = sin(af * 11.0 + aPdlR.z * 6.28) * 0.07 * E * uPdlDrift * fall;
96
+ vec3 off = aPdlN * (0.03 * E) * smoothstep(0.0, 0.14, a);
97
+ off.xz += away * (0.06 + 0.14 * aPdlR.x) * E * uPdlDrift * fall + vec2(sway, sway * 0.6);
98
+ off.y += (uPdlMin.y + 0.002 * E * (1.0 + aPdlR.w) - aPdlP.y) * fall;
99
+ transformed = pdlRot(a) * transformed + off;
100
+ }
101
+ }`,
102
+ },
103
+ });
104
+ st = { field, life, drift, mesh, mats: new Set() };
105
+ const own = st;
106
+ const layer = surfaceLayer(P, field, 'tint');
107
+ forEachMeshMaterial(target, (mat, m) => {
108
+ if (m.userData?.__opFxHelper)
109
+ return;
110
+ if (addLayer(mat, KEY, layer))
111
+ own.mats.add(mat);
112
+ });
113
+ target.userData[STATE] = st;
114
+ }
115
+ const s = st;
116
+ setFieldParams(s.field, p, target, ctx);
117
+ s.drift.value = Number(p.drift);
118
+ return runProgress(target, s.field, 1 + LIFE, {
119
+ duration: Number(p.duration), ease: 'none',
120
+ onComplete: () => hideMeshes(target, KEY, true),
121
+ });
122
+ },
123
+ revert(target, p) {
124
+ const s = target.userData[STATE];
125
+ if (!s)
126
+ return;
127
+ hideMeshes(target, KEY, false);
128
+ return runProgress(target, s.field, 0, {
129
+ duration: Number(p.duration), ease: 'none',
130
+ onComplete: () => {
131
+ s.mats.forEach(m => removeLayer(m, KEY));
132
+ disposeFxInstances(s.mesh);
133
+ delete target.userData[STATE];
134
+ },
135
+ });
136
+ },
137
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=petrify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"petrify.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/petrify.ts"],"names":[],"mappings":";AAqDA,wBA0CG"}
@@ -0,0 +1,94 @@
1
+ // Petrify — the object turns to weathered stone along the front, like a statue:
2
+ // the base colour becomes granite (grain, speckle, darker crevices from low-
3
+ // frequency noise, a trace of the original colour's value kept so the texture
4
+ // still reads), and roughness goes to stone — all BEFORE lighting, so the scene
5
+ // lights it as stone. A fine grey line marks the spreading front. A state, not
6
+ // an exit: it stays stone while on; reverting brings it back to life.
7
+ import { Color } from 'three';
8
+ import { defineOperation } from '../types.js';
9
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
10
+ import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams } from './transitionField.js';
11
+ const P = 'Stn';
12
+ const KEY = 'petrify';
13
+ const STATE = '__opPetrify';
14
+ function layerFor(st) {
15
+ const amount = /* glsl */ `
16
+ float stnD = StnThreshold() - StnField(vStnQ);
17
+ float st = smoothstep(0.0, uStnEdgeWidth, stnD);`;
18
+ return {
19
+ uniforms: { ...fieldUniforms(P, st.field), uStnStone: st.stone },
20
+ common: `varying vec3 vStnQ;\nvarying vec3 vStnR;\n${fieldGlsl(P)}`,
21
+ vertex: /* glsl */ `
22
+ vStnR = (uStnRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
23
+ vStnQ = StnNorm(vStnR);`,
24
+ diffuse: /* glsl */ `
25
+ {
26
+ ${amount}
27
+ vec3 p = vStnR / uStnExtent;
28
+ float grain = fxFbm(p * 26.0);
29
+ float speck = step(0.83, fxNoise(p * 140.0)) * 0.35 - step(0.9, fxNoise(p * 90.0 + 7.0)) * 0.25;
30
+ float crevice = smoothstep(0.25, 0.75, fxFbm(p * 5.0));
31
+ float luma = dot(diffuseColor.rgb, vec3(0.299, 0.587, 0.114));
32
+ vec3 stone = uStnStone * (0.62 + 0.55 * grain + speck) * mix(0.6, 1.1, crevice) * (0.75 + 0.5 * luma);
33
+ diffuseColor.rgb = mix(diffuseColor.rgb, stone, st);
34
+ }`,
35
+ material: /* glsl */ `
36
+ {
37
+ ${amount}
38
+ roughnessFactor = mix(roughnessFactor, 0.93, st);
39
+ metalnessFactor = mix(metalnessFactor, 0.0, st);
40
+ }`,
41
+ fragment: /* glsl */ `
42
+ {
43
+ ${amount}
44
+ float line = exp(-abs(stnD) / 0.01) * step(0.0001, uStnProgress) * step(uStnProgress, 0.9999);
45
+ outgoingLight = mix(outgoingLight, outgoingLight * 0.35, line * 0.8);
46
+ }`,
47
+ };
48
+ }
49
+ export default defineOperation({
50
+ value: 'petrify',
51
+ label: 'Petrify',
52
+ description: 'Turn the targets to weathered stone, like a statue — reverting brings them back',
53
+ channel: 'visual',
54
+ multi: true,
55
+ toggles: true,
56
+ usableIn: ['interaction', 'action', 'object'],
57
+ stack: 'surface',
58
+ params: {
59
+ direction: { type: 'select', label: 'Direction', default: 'up', options: DIRECTION_OPTIONS },
60
+ stone: { type: 'color', label: 'Stone', default: '#9a948c' },
61
+ scale: { type: 'number', label: 'Front pattern', default: 3, min: 0.5, max: 12, step: 0.1 },
62
+ duration: { type: 'number', label: 'Duration', default: 2.4, min: 0.3, max: 12, step: 0.1, unit: 's' },
63
+ },
64
+ apply(target, p, ctx) {
65
+ let st = target.userData[STATE];
66
+ if (!st) {
67
+ const field = createFieldState(target);
68
+ field.edgeWidth.value = 0.035;
69
+ st = { field, stone: { value: new Color() }, mats: new Set() };
70
+ const own = st;
71
+ const layer = layerFor(own);
72
+ forEachMeshMaterial(target, (mat, mesh) => {
73
+ if (mesh.userData?.__opFxHelper)
74
+ return;
75
+ if (addLayer(mat, KEY, layer))
76
+ own.mats.add(mat);
77
+ });
78
+ target.userData[STATE] = st;
79
+ }
80
+ const s = st;
81
+ setFieldParams(s.field, p, target, ctx);
82
+ s.stone.value.set(String(p.stone));
83
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
84
+ },
85
+ revert(target, p) {
86
+ const s = target.userData[STATE];
87
+ if (!s)
88
+ return;
89
+ return runProgress(target, s.field, 0, {
90
+ duration: Number(p.duration), ease: 'power1.inOut',
91
+ onComplete: () => { s.mats.forEach(m => removeLayer(m, KEY)); delete target.userData[STATE]; },
92
+ });
93
+ },
94
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/portal.ts"],"names":[],"mappings":";AAoIA,wBAsFG"}