@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,50 @@
1
+ // Jelly — a volume-preserving squash-and-stretch spring, anchored at the base:
2
+ // it squashes first, then rings out like soft rubber (critically tuned so it
3
+ // settles exactly at rest when the duration ends). One-shot.
4
+ import { gsap } from 'gsap';
5
+ import { Quaternion, Vector3 } from 'three';
6
+ import { defineOperation } from '../types.js';
7
+ import { acquireRest, poseAbout, releaseRest } from './restPose.js';
8
+ const KEY = '__opJelly';
9
+ const NO_TURN = new Quaternion();
10
+ export default defineOperation({
11
+ value: 'jelly',
12
+ label: 'Jelly',
13
+ description: 'Squash and wobble like soft rubber, keeping its volume — settles back to rest',
14
+ channel: 'transform',
15
+ multi: true,
16
+ toggles: false,
17
+ usableIn: ['interaction', 'action'],
18
+ params: {
19
+ strength: { type: 'number', label: 'Squash', default: 0.28, min: 0.02, max: 0.7, step: 0.01 },
20
+ wobbles: { type: 'number', label: 'Wobbles', default: 3, min: 1, max: 8, step: 0.5 },
21
+ duration: { type: 'number', label: 'Duration', default: 1.1, min: 0.2, max: 5, step: 0.05, unit: 's' },
22
+ },
23
+ apply(target, p) {
24
+ const running = target.userData[KEY];
25
+ if (running) {
26
+ gsap.killTweensOf(running.proxy);
27
+ releaseRest(target);
28
+ }
29
+ const rest = acquireRest(target);
30
+ const proxy = { t: 0 };
31
+ target.userData[KEY] = { proxy };
32
+ const A = Number(p.strength);
33
+ const D = Number(p.duration);
34
+ const w = 2 * Math.PI * (Number(p.wobbles) / D); // rad/s
35
+ const k = 4.6 / D; // decays to 1% by the end
36
+ const s = new Vector3();
37
+ gsap.to(proxy, {
38
+ t: D, duration: D, ease: 'none',
39
+ onUpdate: () => {
40
+ const t = proxy.t;
41
+ // damped spring, squash first
42
+ const sy = 1 - A * Math.exp(-k * t) * Math.sin(w * t);
43
+ const sxz = 1 / Math.sqrt(Math.max(sy, 0.05)); // keep the volume
44
+ s.set(sxz, sy, sxz);
45
+ poseAbout(target, rest, rest.bottomLocal, NO_TURN, s);
46
+ },
47
+ onComplete: () => { delete target.userData[KEY]; releaseRest(target); },
48
+ });
49
+ },
50
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=kintsugi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kintsugi.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/kintsugi.ts"],"names":[],"mappings":";AAmIA,wBA+CG"}
@@ -0,0 +1,173 @@
1
+ // Kintsugi — the object is mended with gold. A network of cracks opens over the
2
+ // surface (3D cellular seams in the object's own space, domain-warped so they
3
+ // wander like real fractures, with finer hairline branches in patches), and
4
+ // molten gold wicks along them behind a hot, glowing tip. The seams are raised
5
+ // (a bump from the seam profile bends the reflection), so the gold reads as
6
+ // lacquered metal standing proud of the surface, with a fine glitter that keeps
7
+ // moving while it holds. The rest of the surface keeps its own material.
8
+ // A state, not an exit: the gold stays while on; reverting draws it back and the
9
+ // cracks close.
10
+ import { Color } from 'three';
11
+ import { defineOperation } from '../types.js';
12
+ import { GLSL_WORLEY, addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
13
+ import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams } from './transitionField.js';
14
+ const P = 'Kin';
15
+ const KEY = 'kintsugi';
16
+ const STATE = '__opKintsugi';
17
+ /**
18
+ * Distance, measured along the surface, from p to the nearest cell border of a 3D
19
+ * Voronoi lattice (cell units). The exact distance to the bisector plane of the two
20
+ * nearest feature points, divided by how steeply the surface crosses that plane —
21
+ * so a surface running parallel to a border never turns into a wide blob.
22
+ */
23
+ const BORDER = /* glsl */ `
24
+ float kinBorder(vec3 p, vec3 n) {
25
+ vec3 i = floor(p); vec3 f = fract(p);
26
+ float d1 = 8.0, d2 = 8.0; vec3 p1 = vec3(0.0), p2 = vec3(0.0);
27
+ for (int z = -1; z <= 1; z++) for (int y = -1; y <= 1; y++) for (int x = -1; x <= 1; x++) {
28
+ vec3 g = vec3(float(x), float(y), float(z));
29
+ vec3 r = g + fxHash3(i + g) - f;
30
+ float d = dot(r, r);
31
+ if (d < d1) { d2 = d1; p2 = p1; d1 = d; p1 = r; } else if (d < d2) { d2 = d; p2 = r; }
32
+ }
33
+ vec3 m = p2 - p1; float lm = max(length(m), 1e-4);
34
+ float c = dot(m / lm, n);
35
+ return (d2 - d1) / (2.0 * lm) / sqrt(max(1.0 - c * c, 0.16));
36
+ }
37
+ `;
38
+ function layerFor(st) {
39
+ return {
40
+ uniforms: {
41
+ ...fieldUniforms(P, st.field), uKinGold: st.gold, uKinDensity: st.density, uKinWidth: st.width, uKinBranch: st.branch,
42
+ },
43
+ common: `varying vec3 vKinQ;\nvarying vec3 vKinR;\nvarying vec3 vKinN;\nvarying vec3 vKinView;\n${fieldGlsl(P)}\n${GLSL_WORLEY}\n${BORDER}`,
44
+ // computed once in the first anchor (diffuse), shared with the later ones
45
+ fragmentPars: 'float kinG = 0.0; float kinH = 0.0; float kinHot = 0.0; float kinDark = 0.0; float kinW = 0.0;',
46
+ vertex: /* glsl */ `
47
+ vKinR = (uKinRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
48
+ vKinQ = KinNorm(vKinR);
49
+ vKinN = (uKinRootInv * modelMatrix * vec4(normal, 0.0)).xyz;
50
+ vKinView = (modelViewMatrix * vec4(transformed, 1.0)).xyz;`,
51
+ diffuse: /* glsl */ `
52
+ {
53
+ vec3 nq = normalize(vKinN);
54
+ vec3 rr = vKinR / uKinExtent * uKinDensity;
55
+ // domain warp: fractures wander instead of running straight cell to cell
56
+ vec3 wp = rr + 0.5 * (vec3(fxNoise(rr * 0.9), fxNoise(rr * 0.9 + 7.1), fxNoise(rr * 0.9 + 13.7)) - 0.5);
57
+ float e1 = kinBorder(wp, nq);
58
+ float w1 = uKinWidth * 0.028 * (0.45 + 1.1 * fxNoise(rr * 2.3 + 3.0));
59
+ float aa1 = fwidth(e1) + 1e-4;
60
+ float s1 = 1.0 - smoothstep(w1 - aa1, w1 + aa1, e1);
61
+ // hairline branches, only in patches
62
+ float e2 = kinBorder(wp * 2.37 + 5.3, nq);
63
+ float patchy = smoothstep(0.5, 0.62, fxNoise(rr * 1.1 + 9.0)) * uKinBranch;
64
+ float w2 = uKinWidth * 0.03 * (0.5 + fxNoise(rr * 4.1));
65
+ float aa2 = fwidth(e2) + 1e-4;
66
+ float s2 = (1.0 - smoothstep(w2 - aa2, w2 + aa2, e2)) * patchy;
67
+ float seam = max(s1, s2 * 0.9);
68
+ // raised profile across the seam (0 at the lips, 1 on the ridge)
69
+ float h1 = s1 * sqrt(clamp(1.0 - (e1 / max(w1, 1e-4)) * (e1 / max(w1, 1e-4)), 0.0, 1.0));
70
+ float h2 = s2 * sqrt(clamp(1.0 - (e2 / max(w2, 1e-4)) * (e2 / max(w2, 1e-4)), 0.0, 1.0));
71
+ kinH = max(h1, h2 * 0.6);
72
+ kinW = w1;
73
+ // the gold arrives along the front; the crack opens just ahead of it
74
+ float a = KinField(vKinQ);
75
+ float T = KinThreshold();
76
+ float fill = smoothstep(0.0, 0.012, T - a);
77
+ float open = smoothstep(0.0, 0.03, T + 0.09 - a);
78
+ float on = step(0.0001, uKinProgress) * step(uKinProgress, 0.9999);
79
+ kinG = seam * fill;
80
+ kinDark = seam * open * (1.0 - fill);
81
+ kinHot = seam * fill * exp(-max(T - a, 0.0) / 0.035) * on;
82
+ diffuseColor.rgb = mix(diffuseColor.rgb, diffuseColor.rgb * 0.12, kinDark * 0.92);
83
+ diffuseColor.rgb = mix(diffuseColor.rgb, uKinGold, kinG);
84
+ }`,
85
+ material: /* glsl */ `
86
+ roughnessFactor = mix(roughnessFactor, 0.22, kinG);
87
+ metalnessFactor = mix(metalnessFactor, 1.0, kinG);`,
88
+ fragment: /* glsl */ `
89
+ if (kinG > 0.001 || kinHot > 0.001) {
90
+ vec3 pos = vKinView;
91
+ vec3 sx = dFdx(pos), sy = dFdy(pos);
92
+ vec3 nv = normalize(cross(sx, sy));
93
+ #if defined( STANDARD ) || defined( PHONG ) || defined( LAMBERT ) || defined( TOON )
94
+ vec3 n = normalize(normal);
95
+ #else
96
+ vec3 n = nv;
97
+ #endif
98
+ // bump from the seam profile (height in world units): the ridge bends the reflection
99
+ float hs = 0.5 * kinW * uKinExtent / max(uKinDensity, 1e-3);
100
+ vec2 dh = vec2(dFdx(kinH), dFdy(kinH)) * hs;
101
+ vec3 r1 = cross(sy, n), r2 = cross(n, sx);
102
+ float det = dot(sx, r1);
103
+ n = normalize(abs(det) * n - sign(det) * (dh.x * r1 + dh.y * r2));
104
+ vec3 v = normalize(pos);
105
+ vec3 rw = normalize((vec4(reflect(v, n), 0.0) * viewMatrix).xyz);
106
+ float up = rw.y;
107
+ vec3 env = mix(vec3(0.14, 0.11, 0.08), vec3(0.95, 0.92, 0.88), smoothstep(-0.2, 0.65, up));
108
+ env += vec3(1.5) * exp(-abs(up - 0.03) * 36.0);
109
+ env += vec3(2.4) * smoothstep(0.9, 0.99, dot(rw, normalize(vec3(0.6, 0.55, 0.6))));
110
+ env += vec3(1.1) * smoothstep(0.88, 0.98, dot(rw, normalize(vec3(-0.7, 0.35, -0.3))));
111
+ float ndv = abs(dot(n, -v));
112
+ vec3 metal = uKinGold * env * (0.72 + 0.28 * pow(1.0 - ndv, 4.0));
113
+ // fine glitter in the lacquer, drifting slowly while it holds
114
+ float gl = pow(fxNoise(vKinR / uKinExtent * 110.0 + vec3(0.0, uKinTime * 0.35, uKinTime * 0.2)), 18.0);
115
+ metal += uKinGold * gl * 3.0 * kinH;
116
+ outgoingLight = mix(outgoingLight, metal, kinG);
117
+ // the molten tip: white-gold at the very front, cooling to amber behind
118
+ vec3 hot = mix(vec3(1.0, 0.42, 0.1), vec3(1.0, 0.92, 0.72), kinHot);
119
+ outgoingLight += hot * kinHot * 2.6;
120
+ }`,
121
+ };
122
+ }
123
+ export default defineOperation({
124
+ value: 'kintsugi',
125
+ label: 'Kintsugi',
126
+ description: 'Crack the targets and mend them with flowing gold seams — reverting draws the gold back and closes the cracks',
127
+ channel: 'visual',
128
+ multi: true,
129
+ toggles: true,
130
+ usableIn: ['interaction', 'action', 'object'],
131
+ params: {
132
+ direction: { type: 'select', label: 'Flow', default: 'down', options: DIRECTION_OPTIONS },
133
+ gold: { type: 'color', label: 'Gold', default: '#f2c060' },
134
+ density: { type: 'number', label: 'Cracks', default: 4.5, min: 1, max: 16, step: 0.1, hint: 'Fragments across the object' },
135
+ width: { type: 'number', label: 'Seam width', default: 1, min: 0.3, max: 3, step: 0.05, unit: '×' },
136
+ branches: { type: 'boolean', label: 'Hairline branches', default: true },
137
+ scale: { type: 'number', label: 'Front pattern', default: 2, min: 0.5, max: 12, step: 0.1 },
138
+ duration: { type: 'number', label: 'Duration', default: 3.4, min: 0.3, max: 12, step: 0.1, unit: 's' },
139
+ },
140
+ apply(target, p, ctx) {
141
+ let st = target.userData[STATE];
142
+ if (!st) {
143
+ const field = createFieldState(target);
144
+ field.edgeWidth.value = 0.06;
145
+ st = { field, gold: { value: new Color() }, density: { value: 4.5 }, width: { value: 1 }, branch: { value: 1 }, mats: new Set() };
146
+ const own = st;
147
+ const layer = layerFor(own);
148
+ forEachMeshMaterial(target, (mat, mesh) => {
149
+ if (mesh.userData?.__opFxHelper)
150
+ return;
151
+ if (addLayer(mat, KEY, layer))
152
+ own.mats.add(mat);
153
+ });
154
+ target.userData[STATE] = st;
155
+ }
156
+ const s = st;
157
+ setFieldParams(s.field, p, target, ctx);
158
+ s.gold.value.set(String(p.gold));
159
+ s.density.value = Number(p.density);
160
+ s.width.value = Number(p.width);
161
+ s.branch.value = p.branches === false ? 0 : 1;
162
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
163
+ },
164
+ revert(target, p) {
165
+ const s = target.userData[STATE];
166
+ if (!s)
167
+ return;
168
+ return runProgress(target, s.field, 0, {
169
+ duration: Number(p.duration), ease: 'power1.inOut',
170
+ onComplete: () => { s.mats.forEach(m => removeLayer(m, KEY)); delete target.userData[STATE]; },
171
+ });
172
+ },
173
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=lidarScan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lidarScan.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/lidarScan.ts"],"names":[],"mappings":";AAuGA,wBAqJG"}
@@ -0,0 +1,240 @@
1
+ // LiDAR scan — the object is read by a laser. A thin laser sheet sweeps across
2
+ // it (a faint plane of light, and a bright line where it cuts the surface).
3
+ // Behind the sheet the solid is replaced by what a scanner would make of it:
4
+ // first the reconstructed mesh (a triangulated lattice, projected on the surface
5
+ // in the object's own space), then only the raw point cloud (surface samples that
6
+ // fall on the sheet's scan lines, coloured by depth, by the laser, or with the
7
+ // surface's own colours), which finally drops out.
8
+ // Reverting plays it as a capture: points appear under the sheet, the mesh
9
+ // triangulates between them, and the solid object resolves.
10
+ // With Disappear off (always, as an object effect) the laser sweeps the whole
11
+ // object and leaves all of it in scanned mode — the reconstructed mesh plus the
12
+ // point cloud, nothing dissolving. While it holds the points twinkle and a faint
13
+ // re-scan line drifts across now and then. Reverting sweeps the solid back.
14
+ import { AdditiveBlending, Color, DoubleSide, Mesh, PlaneGeometry, Quaternion, ShaderMaterial, Vector3 } from 'three';
15
+ import { defineOperation } from '../types.js';
16
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
17
+ import { SWEEP_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, hideMeshes, localBounds, runProgress, setFieldParams, sweepVector, } from './transitionField.js';
18
+ import { sampleSurfaceCached } from './surfaceSample.js';
19
+ import { GLSL_POINT_SIZE, createFxPoints, disposeFxPoints } from './fxPoints.js';
20
+ import { hideUntilWarm } from './warmup.js';
21
+ const P = 'Ldr';
22
+ const KEY = 'lidarScan';
23
+ const STATE = '__opLidarScan';
24
+ /** The mesh stage trails the laser by MESH; the points stay until POINTS behind it. */
25
+ const MESH = 0.35;
26
+ const POINTS = 0.75;
27
+ const END = 1 + POINTS;
28
+ const PALETTES = [{ value: 'depth', label: 'Depth' }, { value: 'laser', label: 'Laser' }, { value: 'surface', label: 'Surface colours' }];
29
+ /** Where the three stages stand along the sweep (GLSL). The front is a straight plane. */
30
+ const STAGES = /* glsl */ `
31
+ float ldrFront(float lag) {
32
+ if (uLdrKeep > 0.5 && lag > 0.0) return -10.0; // scanned mode: nothing behind the laser goes
33
+ return (uLdrProgress - lag) * 1.1 - 0.05;
34
+ }
35
+ // scanned mode, holding: a faint re-scan line drifting across now and then (-10 = none)
36
+ float ldrRescan() {
37
+ if (uLdrKeep < 0.5 || uLdrProgress < 0.999) return -10.0;
38
+ return fract(uLdrTime * 0.08) * 1.8 - 0.4;
39
+ }
40
+ `;
41
+ /** A triangulated lattice projected on the surface (triplanar), anti-aliased. */
42
+ const LATTICE = /* glsl */ `
43
+ float ldrTri(vec2 u) {
44
+ vec3 k = vec3(u.x, u.x * 0.5 + u.y * 0.8660254, -u.x * 0.5 + u.y * 0.8660254);
45
+ vec3 d = abs(fract(k + 0.5) - 0.5) / max(fwidth(k), vec3(1e-4));
46
+ return 1.0 - clamp(min(d.x, min(d.y, d.z)) - 0.1, 0.0, 1.0);
47
+ }
48
+ float ldrMesh(vec3 r, vec3 n) {
49
+ vec3 w = pow(abs(n), vec3(4.0)); w /= max(w.x + w.y + w.z, 1e-4);
50
+ return ldrTri(r.yz) * w.x + ldrTri(r.zx) * w.y + ldrTri(r.xy) * w.z;
51
+ }
52
+ `;
53
+ function sheetMaterial(laser, alpha) {
54
+ return new ShaderMaterial({
55
+ uniforms: { uLdrSheetColor: laser, uLdrSheetA: alpha },
56
+ vertexShader: /* glsl */ `
57
+ varying vec2 vUv;
58
+ void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
59
+ fragmentShader: /* glsl */ `
60
+ uniform vec3 uLdrSheetColor; uniform float uLdrSheetA;
61
+ varying vec2 vUv;
62
+ void main() {
63
+ vec2 e = smoothstep(vec2(0.0), vec2(0.28), vUv) * smoothstep(vec2(0.0), vec2(0.28), 1.0 - vUv);
64
+ float a = e.x * e.y * uLdrSheetA;
65
+ // fine scan rays across the sheet
66
+ float rays = 0.55 + 0.45 * pow(abs(sin(vUv.y * 180.0)), 6.0);
67
+ gl_FragColor = vec4(uLdrSheetColor * a * rays, a);
68
+ #include <tonemapping_fragment>
69
+ #include <colorspace_fragment>
70
+ }`,
71
+ transparent: true, depthWrite: false, blending: AdditiveBlending, side: DoubleSide,
72
+ });
73
+ }
74
+ function placeSheet(target, st, on) {
75
+ const b = localBounds(target);
76
+ const size = b.getSize(new Vector3()), c = b.getCenter(new Vector3());
77
+ const d = sweepVector(st.field);
78
+ const h = Math.max((Math.abs(d.x) * size.x + Math.abs(d.y) * size.y + Math.abs(d.z) * size.z) * 0.5, 1e-3);
79
+ const s1 = st.field.progress.value * 1.1 - 0.05;
80
+ st.sheet.position.copy(c).addScaledVector(d, (s1 - 0.5) * 2 * h);
81
+ st.sheet.quaternion.copy(new Quaternion().setFromUnitVectors(new Vector3(0, 0, 1), d));
82
+ const span = Math.max(size.x, size.y, size.z) * 1.5;
83
+ st.sheet.scale.set(span, span, 1);
84
+ // the sheet shows only while it crosses the object
85
+ // (the mesh stays "visible" — hidden objects are skipped by the background compile)
86
+ st.sheetA.value = on ? 0.16 * Math.min(1, Math.max(0, Math.min((s1 + 0.05) / 0.1, (1.05 - s1) / 0.1))) : 0;
87
+ }
88
+ export default defineOperation({
89
+ value: 'lidarScan',
90
+ label: 'LiDAR scan',
91
+ description: 'Sweep a laser across the targets, leaving a scanned mesh and point cloud that dissolve (or, Disappear off, stay) — reverting captures them back',
92
+ channel: 'visual',
93
+ multi: true,
94
+ toggles: true,
95
+ usableIn: ['interaction', 'action', 'object'],
96
+ params: {
97
+ direction: { type: 'select', label: 'Sweep', default: 'left', options: SWEEP_OPTIONS },
98
+ laser: { type: 'color', label: 'Laser', default: '#5ef2ff' },
99
+ palette: { type: 'select', label: 'Point colours', default: 'depth', options: PALETTES },
100
+ density: { type: 'number', label: 'Mesh density', default: 16, min: 4, max: 60, step: 1, hint: 'Triangles across the object' },
101
+ points: { type: 'number', label: 'Points', default: 60000, min: 10000, max: 200000, step: 5000 },
102
+ sheet: { type: 'boolean', label: 'Laser sheet', default: true },
103
+ duration: { type: 'number', label: 'Duration', default: 4.2, min: 0.3, max: 14, step: 0.1, unit: 's' },
104
+ disappear: { type: 'boolean', label: 'Disappear', default: true, hint: 'Off: the object stays in scanned mode — mesh and point cloud' },
105
+ },
106
+ objectParams: { disappear: false },
107
+ apply(target, p, ctx) {
108
+ let st = target.userData[STATE];
109
+ if (!st) {
110
+ const field = createFieldState(target);
111
+ field.edgeWidth.value = 0.02;
112
+ const own = {
113
+ field, laser: { value: new Color() }, density: { value: 16 }, palette: { value: 0 }, sheetA: { value: 0 }, mats: new Set(), keep: { value: 0 },
114
+ };
115
+ const sample = sampleSurfaceCached(target, Math.round(Number(p.points)), 53);
116
+ own.points = createFxPoints(target, sample, {
117
+ additive: true,
118
+ uniforms: { ...fieldUniforms(P, field), uLdrLaser: own.laser, uLdrPalette: own.palette, uLdrKeep: own.keep },
119
+ vertexPars: fieldGlsl(P) + GLSL_POINT_SIZE + STAGES,
120
+ vertexMain: /* glsl */ `
121
+ float a = LdrAlong(LdrNorm(aP));
122
+ float s1 = ldrFront(0.0), s3 = ldrFront(${POINTS.toFixed(2)});
123
+ // points fall on the sheet's scan lines (plus a sparse fill between them)
124
+ float lines = abs(fract(a * 90.0 + 0.5) - 0.5);
125
+ float keep = max(step(lines, 0.12), step(0.9, aR.x));
126
+ float since = s1 - a; // how long ago the laser passed
127
+ if (keep < 0.5 || since < 0.0 || a < s3) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); gl_PointSize = 0.0; vColor = vec3(0.0); vAlpha = 0.0; return; }
128
+ float E = uLdrExtent;
129
+ // dropping out: a small drift along the normal as the point fades
130
+ float out_ = clamp((s3 + 0.12 - a) / 0.12, 0.0, 1.0);
131
+ vec3 local = aP + aN * (E * 0.03 * out_ * (0.5 + aR.y));
132
+ vec4 mv = modelViewMatrix * vec4(local, 1.0);
133
+ gl_Position = projectionMatrix * mv;
134
+ vec3 col;
135
+ if (uLdrPalette < 0.5) {
136
+ // depth from the camera, over the object's own depth range
137
+ float cz = -(modelViewMatrix * vec4(uLdrMin + 0.5 * uLdrSize, 1.0)).z;
138
+ float dz = clamp((-mv.z - cz) / (0.6 * E) + 0.5, 0.0, 1.0);
139
+ col = mix(mix(vec3(1.0, 0.93, 0.74), vec3(0.3, 0.95, 1.0), smoothstep(0.0, 0.5, dz)), vec3(0.16, 0.24, 1.0), smoothstep(0.5, 1.0, dz));
140
+ } else if (uLdrPalette < 1.5) {
141
+ col = uLdrLaser * (0.6 + 0.6 * aR.z);
142
+ } else {
143
+ col = aC * 1.4;
144
+ }
145
+ // a flash as the laser reads the point
146
+ float flash = exp(-since / 0.02) + exp(-abs(a - ldrRescan()) / 0.015) * 0.6;
147
+ vColor = mix(col, vec3(1.0), flash * 0.7) * (1.0 + 2.0 * flash);
148
+ vAlpha = (1.0 - out_) * (0.55 + 0.45 * aR.w) * (0.78 + 0.22 * sin(uLdrTime * (2.0 + 3.0 * aR.y) + aR.x * 40.0));
149
+ gl_PointSize = clamp(fxPointPx(E * 0.0028, mv) * (1.0 + flash), 1.2, 4.0);`,
150
+ });
151
+ own.sheet = new Mesh(new PlaneGeometry(1, 1), sheetMaterial(own.laser, own.sheetA));
152
+ own.sheet.userData.__opFxHelper = true;
153
+ own.sheet.raycast = () => { };
154
+ own.sheet.renderOrder = 11;
155
+ target.add(own.sheet);
156
+ hideUntilWarm(own.sheet);
157
+ const layer = {
158
+ uniforms: { ...fieldUniforms(P, field), uLdrLaser: own.laser, uLdrDensity: own.density, uLdrKeep: own.keep },
159
+ common: `varying vec3 vLdrQ;\nvarying vec3 vLdrR;\nvarying vec3 vLdrN;\n${fieldGlsl(P)}\n${STAGES}`,
160
+ fragmentPars: LATTICE,
161
+ vertex: /* glsl */ `
162
+ vLdrR = (uLdrRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
163
+ vLdrQ = LdrNorm(vLdrR);
164
+ vLdrN = (uLdrRootInv * modelMatrix * vec4(normal, 0.0)).xyz;`,
165
+ fragment: /* glsl */ `
166
+ {
167
+ float a = LdrAlong(vLdrQ);
168
+ float s1 = ldrFront(0.0), s2 = ldrFront(${MESH.toFixed(2)});
169
+ if (a < s2) discard; // only the point cloud is left
170
+ float on = step(0.0001, uLdrProgress) * step(uLdrProgress, ${(END - 0.0001).toFixed(4)});
171
+ if (a < s1) {
172
+ // the reconstructed mesh: lattice lines only, dimming as it goes
173
+ float m = ldrMesh(vLdrR / uLdrExtent * uLdrDensity, normalize(vLdrN));
174
+ if (m < 0.05) discard;
175
+ float age = uLdrKeep > 0.5 ? clamp((s1 - a) / 0.35, 0.0, 1.0) * 0.55 : clamp((s1 - a) / max(s1 - s2, 1e-3), 0.0, 1.0);
176
+ float rs = exp(-abs(a - ldrRescan()) / 0.05);
177
+ outgoingLight = uLdrLaser * m * (0.95 - 0.7 * age + 0.6 * rs) + vec3(1.0) * m * exp(-(s1 - a) / 0.015);
178
+ }
179
+ // the laser line where the sheet cuts the surface
180
+ float dl = abs(a - s1);
181
+ float line = 1.0 - smoothstep(0.0, fwidth(a) * 1.5 + 0.002, dl);
182
+ float halo = exp(-dl / 0.02) * 0.6;
183
+ outgoingLight += (uLdrLaser * halo + mix(uLdrLaser, vec3(1.0), 0.6) * line * 2.5) * on * (0.88 + 0.12 * sin(uLdrTime * 11.0));
184
+ // the re-scan line (holding in scanned mode)
185
+ float dr = abs(a - ldrRescan());
186
+ outgoingLight += mix(uLdrLaser, vec3(1.0), 0.4) * (1.0 - smoothstep(0.0, fwidth(a) * 1.5 + 0.002, dr)) * 0.9;
187
+ }`,
188
+ };
189
+ forEachMeshMaterial(target, (mat, mesh) => {
190
+ if (mesh.userData?.__opFxHelper)
191
+ return;
192
+ if (addLayer(mat, KEY, layer))
193
+ own.mats.add(mat);
194
+ });
195
+ st = own;
196
+ target.userData[STATE] = st;
197
+ }
198
+ const s = st;
199
+ setFieldParams(s.field, p, target, ctx);
200
+ s.laser.value.set(String(p.laser));
201
+ s.density.value = Number(p.density);
202
+ s.palette.value = Math.max(0, PALETTES.findIndex(o => o.value === p.palette));
203
+ const sheetOn = p.sheet !== false;
204
+ s.points.visible = true;
205
+ s.keep.value = p.disappear === false ? 1 : 0;
206
+ if (s.keep.value) {
207
+ return runProgress(target, s.field, 1, {
208
+ duration: Number(p.duration), ease: 'none', hold: true,
209
+ onUpdate: () => placeSheet(target, s, sheetOn),
210
+ onComplete: () => placeSheet(target, s, sheetOn),
211
+ });
212
+ }
213
+ return runProgress(target, s.field, END, {
214
+ duration: Number(p.duration), ease: 'none',
215
+ onUpdate: () => placeSheet(target, s, sheetOn),
216
+ onComplete: () => { hideMeshes(target, KEY, true); s.points.visible = false; s.sheetA.value = 0; },
217
+ });
218
+ },
219
+ revert(target, p) {
220
+ const s = target.userData[STATE];
221
+ if (!s)
222
+ return;
223
+ hideMeshes(target, KEY, false);
224
+ s.points.visible = true;
225
+ const sheetOn = p.sheet !== false;
226
+ // from a hold it only has part of the way to go: keep the same speed
227
+ return runProgress(target, s.field, 0, {
228
+ duration: Number(p.duration) * Math.min(1, Math.max(0.1, s.field.progress.value / (s.keep.value ? 1 : END))), ease: 'none',
229
+ onUpdate: () => placeSheet(target, s, sheetOn),
230
+ onComplete: () => {
231
+ s.mats.forEach(m => removeLayer(m, KEY));
232
+ disposeFxPoints(s.points);
233
+ s.sheet.removeFromParent();
234
+ s.sheet.geometry.dispose();
235
+ s.sheet.material.dispose();
236
+ delete target.userData[STATE];
237
+ },
238
+ });
239
+ },
240
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=liquidMetal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidMetal.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/liquidMetal.ts"],"names":[],"mappings":";AA6EA,wBA8CG"}
@@ -0,0 +1,122 @@
1
+ // Liquid metal — the object first turns to polished chrome, then melts: it sags
2
+ // from the top down and flows out into a puddle on the ground (higher parts
3
+ // travel further), with slow ripples running across the pool while it lies
4
+ // there. Reverting pulls it back up into shape and the chrome fades off.
5
+ //
6
+ // The chrome is a procedural studio environment (sky gradient, horizon band,
7
+ // two soft boxes) reflected about the surface normal, so it reads as metal in
8
+ // any scene, with or without an environment map. While the mesh deforms, normals
9
+ // come from screen-space derivatives of the displaced surface.
10
+ import { gsap } from 'gsap';
11
+ import { Color } from 'three';
12
+ import { defineOperation } from '../types.js';
13
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
14
+ import { createFieldState, fieldGlsl, fieldUniforms, runProgress, syncRoot } from './transitionField.js';
15
+ const P = 'Liq';
16
+ const KEY = 'liquidMetal';
17
+ const STATE = '__opLiquid';
18
+ function layerFor(st) {
19
+ return {
20
+ uniforms: { ...fieldUniforms(P, st.field), uLiqTint: st.tint, uLiqSpread: st.spread },
21
+ common: `varying float vLiqM;\nvarying vec3 vLiqView;\n${fieldGlsl(P)}`,
22
+ vertex: /* glsl */ `
23
+ {
24
+ mat4 toRoot = uLiqRootInv * modelMatrix;
25
+ vec3 rl = (toRoot * vec4(transformed, 1.0)).xyz;
26
+ vec3 q = LiqNorm(rl);
27
+ float E = uLiqExtent;
28
+ // melt runs after the chrome has come in; the top gives way first
29
+ float mp = clamp((uLiqProgress - 0.18) / 0.82, 0.0, 1.0);
30
+ float wob = 0.12 * (fxNoise(q * 4.0) - 0.5);
31
+ float m = clamp(mp * 1.3 - (1.0 - q.y) * 0.3 + wob, 0.0, 1.0);
32
+ m = m * m; // slow start: it sags before it runs
33
+ m = m * m * (3.0 - 2.0 * m);
34
+ vLiqM = m;
35
+ vec3 C = uLiqMin + uLiqSize * 0.5;
36
+ float ground = uLiqMin.y;
37
+ vec2 rel = rl.xz - C.xz;
38
+ // flow outward: higher material travels further
39
+ vec2 xz = C.xz + rel * (1.0 + m * (0.35 + 0.75 * q.y) * uLiqSpread);
40
+ float r = length(xz - C.xz);
41
+ // the pool: a thin sheet with slow ripples
42
+ float thick = 0.012 * E * (1.0 + 0.8 * fxNoise(vec3(xz / E * 6.0, 0.0)));
43
+ float ripple = 0.004 * E * sin(r / E * 38.0 - uLiqTime * 2.4) * smoothstep(0.7, 1.0, m);
44
+ float y = mix(rl.y, ground + thick + ripple, m) - sin(3.14159 * m) * 0.05 * E;
45
+ vec3 outR = vec3(xz.x, max(y, ground + 0.001 * E), xz.y);
46
+ transformed = (inverse(toRoot) * vec4(outR, 1.0)).xyz;
47
+ vLiqView = (modelViewMatrix * vec4(transformed, 1.0)).xyz;
48
+ }`,
49
+ fragment: /* glsl */ `
50
+ {
51
+ float chrome = smoothstep(0.0, 0.2, uLiqProgress);
52
+ vec3 nv = normalize(cross(dFdx(vLiqView), dFdy(vLiqView)));
53
+ #if defined( STANDARD ) || defined( PHONG ) || defined( LAMBERT ) || defined( TOON )
54
+ vec3 n = normalize(mix(normal, nv, smoothstep(0.05, 0.5, vLiqM)));
55
+ #else
56
+ vec3 n = nv;
57
+ #endif
58
+ vec3 v = normalize(vLiqView);
59
+ vec3 rv = reflect(v, n);
60
+ vec3 rw = normalize((vec4(rv, 0.0) * viewMatrix).xyz); // view → world direction
61
+ // studio: dark floor, bright sky, a crisp horizon band and two soft boxes
62
+ float up = rw.y;
63
+ vec3 env = mix(vec3(0.05), vec3(0.85, 0.9, 1.0), smoothstep(-0.15, 0.6, up));
64
+ env += vec3(1.4) * exp(-abs(up - 0.02) * 40.0);
65
+ env += vec3(2.2) * smoothstep(0.92, 0.99, dot(rw, normalize(vec3(0.6, 0.55, 0.6))));
66
+ env += vec3(1.2) * smoothstep(0.9, 0.98, dot(rw, normalize(vec3(-0.7, 0.35, -0.3))));
67
+ float fres = 0.65 + 0.35 * pow(1.0 - abs(dot(n, -v)), 3.0);
68
+ vec3 metal = uLiqTint * env * fres;
69
+ outgoingLight = mix(outgoingLight, metal, chrome);
70
+ }`,
71
+ };
72
+ }
73
+ export default defineOperation({
74
+ value: 'liquidMetal',
75
+ label: 'Liquid metal',
76
+ description: 'Turn the targets to chrome and melt them into a rippling pool — reverting pulls them back into shape',
77
+ channel: 'visual',
78
+ multi: true,
79
+ toggles: true,
80
+ usableIn: ['interaction', 'action'],
81
+ params: {
82
+ tint: { type: 'color', label: 'Metal', default: '#dfe7ee' },
83
+ spread: { type: 'number', label: 'Pool size', default: 1, min: 0.2, max: 3, step: 0.05, unit: '×' },
84
+ duration: { type: 'number', label: 'Duration', default: 3.4, min: 0.3, max: 12, step: 0.1, unit: 's' },
85
+ },
86
+ apply(target, p) {
87
+ let st = target.userData[STATE];
88
+ if (!st) {
89
+ const field = createFieldState(target);
90
+ const own = { field, tint: { value: new Color() }, spread: { value: 1 }, mats: new Set() };
91
+ // ripples keep moving while it lies melted
92
+ own.tick = () => { own.field.time.value += gsap.ticker.deltaRatio() / 60; syncRoot(target, own.field); };
93
+ const layer = layerFor(own);
94
+ forEachMeshMaterial(target, (mat, mesh) => {
95
+ if (mesh.userData?.__opFxHelper)
96
+ return;
97
+ if (addLayer(mat, KEY, layer))
98
+ own.mats.add(mat);
99
+ });
100
+ gsap.ticker.add(own.tick);
101
+ st = own;
102
+ target.userData[STATE] = st;
103
+ }
104
+ const s = st;
105
+ s.tint.value.set(String(p.tint));
106
+ s.spread.value = Number(p.spread);
107
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', clock: false });
108
+ },
109
+ revert(target, p) {
110
+ const s = target.userData[STATE];
111
+ if (!s)
112
+ return;
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
+ delete target.userData[STATE];
119
+ },
120
+ });
121
+ },
122
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=metalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metalize.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/metalize.ts"],"names":[],"mappings":";AA8EA,wBA4DG"}