@3driseai/3drise-viewer 0.1.28 → 0.1.30

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 (804) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  2. package/dist/animationsV2/ClipPlayer.js +13 -9
  3. package/dist/animationsV2/ClipsRuntime.d.ts +48 -3
  4. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  5. package/dist/animationsV2/ClipsRuntime.js +239 -57
  6. package/dist/animationsV2/appliers.d.ts.map +1 -1
  7. package/dist/animationsV2/appliers.js +21 -5
  8. package/dist/animationsV2/clipUtils.js +1 -1
  9. package/dist/animationsV2/index.d.ts +1 -1
  10. package/dist/animationsV2/index.d.ts.map +1 -1
  11. package/dist/animationsV2/normalize.d.ts.map +1 -1
  12. package/dist/animationsV2/normalize.js +7 -3
  13. package/dist/animationsV2/sequenceUtils.d.ts +49 -6
  14. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  15. package/dist/animationsV2/sequenceUtils.js +68 -12
  16. package/dist/animationsV2/types.d.ts +28 -12
  17. package/dist/animationsV2/types.d.ts.map +1 -1
  18. package/dist/api/sceneHandle.d.ts +35 -1
  19. package/dist/api/sceneHandle.d.ts.map +1 -1
  20. package/dist/api/sceneHandle.js +88 -17
  21. package/dist/components/AdvancedGrid.d.ts +1 -5
  22. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  23. package/dist/components/AdvancedGrid.js +6 -35
  24. package/dist/components/AnimatedObject.d.ts.map +1 -1
  25. package/dist/components/AnimatedObject.js +9 -4
  26. package/dist/components/ApollonianGrid.d.ts +1 -1
  27. package/dist/components/ApollonianGrid.d.ts.map +1 -1
  28. package/dist/components/ApollonianGrid.js +3 -28
  29. package/dist/components/ChladniGrid.d.ts +1 -1
  30. package/dist/components/ChladniGrid.d.ts.map +1 -1
  31. package/dist/components/ChladniGrid.js +6 -35
  32. package/dist/components/CircuitGrid.d.ts +1 -1
  33. package/dist/components/CircuitGrid.d.ts.map +1 -1
  34. package/dist/components/CircuitGrid.js +6 -34
  35. package/dist/components/ConformalGrid.d.ts +1 -1
  36. package/dist/components/ConformalGrid.d.ts.map +1 -1
  37. package/dist/components/ConformalGrid.js +3 -34
  38. package/dist/components/ContourGrid.d.ts +1 -1
  39. package/dist/components/ContourGrid.d.ts.map +1 -1
  40. package/dist/components/ContourGrid.js +6 -34
  41. package/dist/components/CustomPrimitive.js +1 -1
  42. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  43. package/dist/components/EffectsGenerator.js +43 -38
  44. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  45. package/dist/components/EnvironmentObject.js +9 -7
  46. package/dist/components/FlowNetGrid.d.ts +1 -1
  47. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  48. package/dist/components/FlowNetGrid.js +6 -34
  49. package/dist/components/FractalGrid.d.ts +1 -1
  50. package/dist/components/FractalGrid.d.ts.map +1 -1
  51. package/dist/components/FractalGrid.js +6 -37
  52. package/dist/components/Galaxy.d.ts.map +1 -1
  53. package/dist/components/Galaxy.js +9 -23
  54. package/dist/components/GeometryShape.d.ts.map +1 -1
  55. package/dist/components/GeometryShape.js +22 -2
  56. package/dist/components/GirihGrid.d.ts +1 -1
  57. package/dist/components/GirihGrid.d.ts.map +1 -1
  58. package/dist/components/GirihGrid.js +6 -35
  59. package/dist/components/GravWaveGrid.d.ts +1 -1
  60. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  61. package/dist/components/GravWaveGrid.js +6 -35
  62. package/dist/components/HexGrid.d.ts +1 -5
  63. package/dist/components/HexGrid.d.ts.map +1 -1
  64. package/dist/components/HexGrid.js +6 -36
  65. package/dist/components/HilbertGrid.d.ts +1 -1
  66. package/dist/components/HilbertGrid.d.ts.map +1 -1
  67. package/dist/components/HilbertGrid.js +3 -30
  68. package/dist/components/HyperbolicGrid.d.ts +1 -1
  69. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  70. package/dist/components/HyperbolicGrid.js +6 -34
  71. package/dist/components/LandObject.d.ts +9 -0
  72. package/dist/components/LandObject.d.ts.map +1 -0
  73. package/dist/components/LandObject.js +15 -0
  74. package/dist/components/LensingGrid.d.ts +1 -1
  75. package/dist/components/LensingGrid.d.ts.map +1 -1
  76. package/dist/components/LensingGrid.js +3 -29
  77. package/dist/components/LightsManager.d.ts.map +1 -1
  78. package/dist/components/LightsManager.js +8 -0
  79. package/dist/components/ModelBoundary.d.ts +2 -0
  80. package/dist/components/ModelBoundary.d.ts.map +1 -1
  81. package/dist/components/ModelBoundary.js +3 -0
  82. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  83. package/dist/components/ModelPrimitive.js +6 -0
  84. package/dist/components/MoireGrid.d.ts +1 -1
  85. package/dist/components/MoireGrid.d.ts.map +1 -1
  86. package/dist/components/MoireGrid.js +6 -35
  87. package/dist/components/MoonDisc.d.ts +11 -0
  88. package/dist/components/MoonDisc.d.ts.map +1 -0
  89. package/dist/components/MoonDisc.js +128 -0
  90. package/dist/components/ObjectNode.d.ts.map +1 -1
  91. package/dist/components/ObjectNode.js +10 -10
  92. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  93. package/dist/components/ObjectsRenderer.js +7 -5
  94. package/dist/components/OceanBuilder.d.ts.map +1 -1
  95. package/dist/components/OceanBuilder.js +2 -0
  96. package/dist/components/ParastichyGrid.d.ts +1 -1
  97. package/dist/components/ParastichyGrid.d.ts.map +1 -1
  98. package/dist/components/ParastichyGrid.js +3 -30
  99. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  100. package/dist/components/ParticlesGenerator.js +44 -24
  101. package/dist/components/PhyllotaxisGrid.d.ts +1 -1
  102. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
  103. package/dist/components/PhyllotaxisGrid.js +3 -32
  104. package/dist/components/PickVolume.d.ts +17 -0
  105. package/dist/components/PickVolume.d.ts.map +1 -0
  106. package/dist/components/PickVolume.js +20 -0
  107. package/dist/components/ProjectLoader.d.ts +5 -3
  108. package/dist/components/ProjectLoader.d.ts.map +1 -1
  109. package/dist/components/ProjectLoader.js +6 -3
  110. package/dist/components/QuasiGrid.d.ts +1 -1
  111. package/dist/components/QuasiGrid.d.ts.map +1 -1
  112. package/dist/components/QuasiGrid.js +6 -33
  113. package/dist/components/RadarGrid.d.ts +1 -1
  114. package/dist/components/RadarGrid.d.ts.map +1 -1
  115. package/dist/components/RadarGrid.js +6 -34
  116. package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
  117. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  118. package/dist/components/ReactionDiffusionGrid.js +6 -35
  119. package/dist/components/SceneBuilder.d.ts +25 -3
  120. package/dist/components/SceneBuilder.d.ts.map +1 -1
  121. package/dist/components/SceneBuilder.js +68 -38
  122. package/dist/components/SkyController.d.ts +25 -1
  123. package/dist/components/SkyController.d.ts.map +1 -1
  124. package/dist/components/SkyController.js +189 -130
  125. package/dist/components/SkyMesh.d.ts.map +1 -1
  126. package/dist/components/SkyMesh.js +26 -1
  127. package/dist/components/SkyStars.d.ts +11 -0
  128. package/dist/components/SkyStars.d.ts.map +1 -0
  129. package/dist/components/SkyStars.js +268 -0
  130. package/dist/components/SkySystem.d.ts +3 -3
  131. package/dist/components/SkySystem.d.ts.map +1 -1
  132. package/dist/components/SkySystem.js +8 -2
  133. package/dist/components/Sun.d.ts +15 -1
  134. package/dist/components/Sun.d.ts.map +1 -1
  135. package/dist/components/Sun.js +64 -3
  136. package/dist/components/SunLight.d.ts +6 -1
  137. package/dist/components/SunLight.d.ts.map +1 -1
  138. package/dist/components/SunLight.js +96 -44
  139. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  140. package/dist/components/TerrainBuilder.js +2 -0
  141. package/dist/components/TextGenerator.d.ts +9 -0
  142. package/dist/components/TextGenerator.d.ts.map +1 -0
  143. package/dist/components/TextGenerator.js +30 -0
  144. package/dist/components/TruchetGrid.d.ts +1 -1
  145. package/dist/components/TruchetGrid.d.ts.map +1 -1
  146. package/dist/components/TruchetGrid.js +3 -30
  147. package/dist/components/VoronoiGrid.d.ts +1 -1
  148. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  149. package/dist/components/VoronoiGrid.js +6 -33
  150. package/dist/components/WallpaperGrid.d.ts +1 -1
  151. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  152. package/dist/components/WallpaperGrid.js +6 -35
  153. package/dist/components/environment/Rain.d.ts +15 -0
  154. package/dist/components/environment/Rain.d.ts.map +1 -0
  155. package/dist/components/environment/Rain.js +110 -0
  156. package/dist/components/environment/Rainbow.d.ts +20 -0
  157. package/dist/components/environment/Rainbow.d.ts.map +1 -0
  158. package/dist/components/environment/Rainbow.js +974 -0
  159. package/dist/components/environment/Sandstorm.d.ts +20 -0
  160. package/dist/components/environment/Sandstorm.d.ts.map +1 -0
  161. package/dist/components/environment/Sandstorm.js +776 -0
  162. package/dist/components/environment/Snow.d.ts +20 -0
  163. package/dist/components/environment/Snow.d.ts.map +1 -0
  164. package/dist/components/environment/Snow.js +609 -0
  165. package/dist/components/environment/Thunderstorm.d.ts +20 -0
  166. package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
  167. package/dist/components/environment/Thunderstorm.js +731 -0
  168. package/dist/components/environment/Tornado.d.ts +20 -0
  169. package/dist/components/environment/Tornado.d.ts.map +1 -0
  170. package/dist/components/environment/Tornado.js +762 -0
  171. package/dist/components/environment/index.d.ts +13 -0
  172. package/dist/components/environment/index.d.ts.map +1 -0
  173. package/dist/components/environment/index.js +7 -0
  174. package/dist/components/index.d.ts +11 -18
  175. package/dist/components/index.d.ts.map +1 -1
  176. package/dist/components/index.js +9 -10
  177. package/dist/components/land/LandPatch.d.ts +15 -0
  178. package/dist/components/land/LandPatch.d.ts.map +1 -0
  179. package/dist/components/land/LandPatch.js +170 -0
  180. package/dist/components/land/index.d.ts +3 -0
  181. package/dist/components/land/index.d.ts.map +1 -0
  182. package/dist/components/land/index.js +1 -0
  183. package/dist/components/particles/BioluminescentWakeParticles.d.ts +5 -0
  184. package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -1
  185. package/dist/components/particles/BioluminescentWakeParticles.js +2 -1
  186. package/dist/components/particles/BrownianDustParticles.d.ts +5 -0
  187. package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -1
  188. package/dist/components/particles/BrownianDustParticles.js +2 -0
  189. package/dist/components/particles/ChladniSandParticles.d.ts +5 -0
  190. package/dist/components/particles/ChladniSandParticles.d.ts.map +1 -1
  191. package/dist/components/particles/ChladniSandParticles.js +2 -1
  192. package/dist/components/particles/ElectronOrbitalsParticles.d.ts +5 -0
  193. package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -1
  194. package/dist/components/particles/ElectronOrbitalsParticles.js +2 -1
  195. package/dist/components/particles/FaradayPowderParticles.d.ts +5 -0
  196. package/dist/components/particles/FaradayPowderParticles.d.ts.map +1 -1
  197. package/dist/components/particles/FaradayPowderParticles.js +2 -1
  198. package/dist/components/particles/GrinderSparksParticles.d.ts +5 -0
  199. package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -1
  200. package/dist/components/particles/GrinderSparksParticles.js +2 -1
  201. package/dist/components/particles/MagneticBottleParticles.d.ts +5 -0
  202. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -1
  203. package/dist/components/particles/MagneticBottleParticles.js +2 -1
  204. package/dist/components/particles/NeonRainParticles.d.ts +5 -0
  205. package/dist/components/particles/NeonRainParticles.d.ts.map +1 -1
  206. package/dist/components/particles/NeonRainParticles.js +2 -1
  207. package/dist/components/particles/ShapeBurstParticles.d.ts +5 -0
  208. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -1
  209. package/dist/components/particles/ShapeBurstParticles.js +2 -1
  210. package/dist/components/particles/ShapeFlowParticles.d.ts +5 -0
  211. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -1
  212. package/dist/components/particles/ShapeFlowParticles.js +2 -1
  213. package/dist/components/particles/TidalStreamParticles.d.ts +5 -0
  214. package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -1
  215. package/dist/components/particles/TidalStreamParticles.js +2 -0
  216. package/dist/components/space/Earth.d.ts +16 -0
  217. package/dist/components/space/Earth.d.ts.map +1 -0
  218. package/dist/components/space/Earth.js +75 -0
  219. package/dist/components/space/ShootingStar.d.ts +21 -0
  220. package/dist/components/space/ShootingStar.d.ts.map +1 -0
  221. package/dist/components/space/ShootingStar.js +101 -0
  222. package/dist/components/space/ShootingStars.d.ts +16 -0
  223. package/dist/components/space/ShootingStars.d.ts.map +1 -0
  224. package/dist/components/space/ShootingStars.js +71 -0
  225. package/dist/components/space/SolarSystem.d.ts +16 -0
  226. package/dist/components/space/SolarSystem.d.ts.map +1 -0
  227. package/dist/components/space/SolarSystem.js +141 -0
  228. package/dist/components/space/Stars.d.ts +20 -0
  229. package/dist/components/space/Stars.d.ts.map +1 -0
  230. package/dist/components/space/Stars.js +160 -0
  231. package/dist/components/space/index.d.ts +11 -0
  232. package/dist/components/space/index.d.ts.map +1 -0
  233. package/dist/components/space/index.js +8 -0
  234. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  235. package/dist/components/terrain/TerrainSurface.js +27 -3
  236. package/dist/components/terrain/types.d.ts +5 -1
  237. package/dist/components/terrain/types.d.ts.map +1 -1
  238. package/dist/components/text/BurnAwayText.d.ts +15 -0
  239. package/dist/components/text/BurnAwayText.d.ts.map +1 -0
  240. package/dist/components/text/BurnAwayText.js +4 -0
  241. package/dist/components/text/ChalkboardText.d.ts +15 -0
  242. package/dist/components/text/ChalkboardText.d.ts.map +1 -0
  243. package/dist/components/text/ChalkboardText.js +4 -0
  244. package/dist/components/text/ConstellationText.d.ts +15 -0
  245. package/dist/components/text/ConstellationText.d.ts.map +1 -0
  246. package/dist/components/text/ConstellationText.js +4 -0
  247. package/dist/components/text/EmbroideryText.d.ts +15 -0
  248. package/dist/components/text/EmbroideryText.d.ts.map +1 -0
  249. package/dist/components/text/EmbroideryText.js +4 -0
  250. package/dist/components/text/FourierSketchText.d.ts +15 -0
  251. package/dist/components/text/FourierSketchText.d.ts.map +1 -0
  252. package/dist/components/text/FourierSketchText.js +4 -0
  253. package/dist/components/text/FrostGrowthText.d.ts +15 -0
  254. package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
  255. package/dist/components/text/FrostGrowthText.js +4 -0
  256. package/dist/components/text/HandwritingText.d.ts +15 -0
  257. package/dist/components/text/HandwritingText.d.ts.map +1 -0
  258. package/dist/components/text/HandwritingText.js +4 -0
  259. package/dist/components/text/InkBleedText.d.ts +15 -0
  260. package/dist/components/text/InkBleedText.d.ts.map +1 -0
  261. package/dist/components/text/InkBleedText.js +4 -0
  262. package/dist/components/text/LightPaintingText.d.ts +15 -0
  263. package/dist/components/text/LightPaintingText.d.ts.map +1 -0
  264. package/dist/components/text/LightPaintingText.js +4 -0
  265. package/dist/components/text/LiquidMetalText.d.ts +15 -0
  266. package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
  267. package/dist/components/text/LiquidMetalText.js +4 -0
  268. package/dist/components/text/NeonTubeText.d.ts +15 -0
  269. package/dist/components/text/NeonTubeText.d.ts.map +1 -0
  270. package/dist/components/text/NeonTubeText.js +4 -0
  271. package/dist/components/text/PlainText.d.ts +15 -0
  272. package/dist/components/text/PlainText.d.ts.map +1 -0
  273. package/dist/components/text/PlainText.js +4 -0
  274. package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
  275. package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
  276. package/dist/components/text/PlasmaDischargeText.js +4 -0
  277. package/dist/components/text/TextObjectView.d.ts +14 -0
  278. package/dist/components/text/TextObjectView.d.ts.map +1 -0
  279. package/dist/components/text/TextObjectView.js +17 -0
  280. package/dist/components/text/engine/fieldkit.d.ts +24 -0
  281. package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
  282. package/dist/components/text/engine/fieldkit.js +201 -0
  283. package/dist/components/text/engine/glyphs.d.ts +19 -0
  284. package/dist/components/text/engine/glyphs.d.ts.map +1 -0
  285. package/dist/components/text/engine/glyphs.js +269 -0
  286. package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
  287. package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
  288. package/dist/components/text/engine/looks/burnAway.js +593 -0
  289. package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
  290. package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
  291. package/dist/components/text/engine/looks/chalkboard.js +426 -0
  292. package/dist/components/text/engine/looks/constellation.d.ts +111 -0
  293. package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
  294. package/dist/components/text/engine/looks/constellation.js +496 -0
  295. package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
  296. package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
  297. package/dist/components/text/engine/looks/embroidery.js +645 -0
  298. package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
  299. package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
  300. package/dist/components/text/engine/looks/frostGrowth.js +727 -0
  301. package/dist/components/text/engine/looks/index.d.ts +2 -0
  302. package/dist/components/text/engine/looks/index.d.ts.map +1 -0
  303. package/dist/components/text/engine/looks/index.js +49 -0
  304. package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
  305. package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
  306. package/dist/components/text/engine/looks/inkBleed.js +590 -0
  307. package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
  308. package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
  309. package/dist/components/text/engine/looks/lightPainting.js +567 -0
  310. package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
  311. package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
  312. package/dist/components/text/engine/looks/liquidMetal.js +655 -0
  313. package/dist/components/text/engine/looks/plain.d.ts +146 -0
  314. package/dist/components/text/engine/looks/plain.d.ts.map +1 -0
  315. package/dist/components/text/engine/looks/plain.js +104 -0
  316. package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
  317. package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
  318. package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
  319. package/dist/components/text/engine/methods.d.ts +19 -0
  320. package/dist/components/text/engine/methods.d.ts.map +1 -0
  321. package/dist/components/text/engine/methods.js +126 -0
  322. package/dist/components/text/engine/playback.d.ts +40 -0
  323. package/dist/components/text/engine/playback.d.ts.map +1 -0
  324. package/dist/components/text/engine/playback.js +114 -0
  325. package/dist/components/text/engine/ribbon.d.ts +58 -0
  326. package/dist/components/text/engine/ribbon.d.ts.map +1 -0
  327. package/dist/components/text/engine/ribbon.js +250 -0
  328. package/dist/components/text/engine/variants.d.ts +159 -0
  329. package/dist/components/text/engine/variants.d.ts.map +1 -0
  330. package/dist/components/text/engine/variants.js +378 -0
  331. package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
  332. package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
  333. package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
  334. package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
  335. package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
  336. package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
  337. package/dist/components/text/fonts/bebas-neue.outline.d.ts +3 -0
  338. package/dist/components/text/fonts/bebas-neue.outline.d.ts.map +1 -0
  339. package/dist/components/text/fonts/bebas-neue.outline.js +4 -0
  340. package/dist/components/text/fonts/bebas-neue.strokes.d.ts +3 -0
  341. package/dist/components/text/fonts/bebas-neue.strokes.d.ts.map +1 -0
  342. package/dist/components/text/fonts/bebas-neue.strokes.js +4 -0
  343. package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
  344. package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
  345. package/dist/components/text/fonts/caveat.outline.js +4 -0
  346. package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
  347. package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
  348. package/dist/components/text/fonts/caveat.strokes.js +4 -0
  349. package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
  350. package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
  351. package/dist/components/text/fonts/courgette.outline.js +4 -0
  352. package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
  353. package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
  354. package/dist/components/text/fonts/courgette.strokes.js +4 -0
  355. package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
  356. package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
  357. package/dist/components/text/fonts/dancing-script.outline.js +4 -0
  358. package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
  359. package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
  360. package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
  361. package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
  362. package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
  363. package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
  364. package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
  365. package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
  366. package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
  367. package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
  368. package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
  369. package/dist/components/text/fonts/handlee.outline.js +4 -0
  370. package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
  371. package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
  372. package/dist/components/text/fonts/handlee.strokes.js +4 -0
  373. package/dist/components/text/fonts/index.d.ts +5 -0
  374. package/dist/components/text/fonts/index.d.ts.map +1 -0
  375. package/dist/components/text/fonts/index.js +58 -0
  376. package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
  377. package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
  378. package/dist/components/text/fonts/indie-flower.outline.js +4 -0
  379. package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
  380. package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
  381. package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
  382. package/dist/components/text/fonts/inter.outline.d.ts +3 -0
  383. package/dist/components/text/fonts/inter.outline.d.ts.map +1 -0
  384. package/dist/components/text/fonts/inter.outline.js +4 -0
  385. package/dist/components/text/fonts/inter.strokes.d.ts +3 -0
  386. package/dist/components/text/fonts/inter.strokes.d.ts.map +1 -0
  387. package/dist/components/text/fonts/inter.strokes.js +4 -0
  388. package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
  389. package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
  390. package/dist/components/text/fonts/kalam.outline.js +4 -0
  391. package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
  392. package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
  393. package/dist/components/text/fonts/kalam.strokes.js +4 -0
  394. package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
  395. package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
  396. package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
  397. package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
  398. package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
  399. package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
  400. package/dist/components/text/fonts/lora.outline.d.ts +3 -0
  401. package/dist/components/text/fonts/lora.outline.d.ts.map +1 -0
  402. package/dist/components/text/fonts/lora.outline.js +4 -0
  403. package/dist/components/text/fonts/lora.strokes.d.ts +3 -0
  404. package/dist/components/text/fonts/lora.strokes.d.ts.map +1 -0
  405. package/dist/components/text/fonts/lora.strokes.js +4 -0
  406. package/dist/components/text/fonts/montserrat.outline.d.ts +3 -0
  407. package/dist/components/text/fonts/montserrat.outline.d.ts.map +1 -0
  408. package/dist/components/text/fonts/montserrat.outline.js +4 -0
  409. package/dist/components/text/fonts/montserrat.strokes.d.ts +3 -0
  410. package/dist/components/text/fonts/montserrat.strokes.d.ts.map +1 -0
  411. package/dist/components/text/fonts/montserrat.strokes.js +4 -0
  412. package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
  413. package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
  414. package/dist/components/text/fonts/mynerve.outline.js +4 -0
  415. package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
  416. package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
  417. package/dist/components/text/fonts/mynerve.strokes.js +4 -0
  418. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
  419. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
  420. package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
  421. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
  422. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
  423. package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
  424. package/dist/components/text/fonts/oswald.outline.d.ts +3 -0
  425. package/dist/components/text/fonts/oswald.outline.d.ts.map +1 -0
  426. package/dist/components/text/fonts/oswald.outline.js +4 -0
  427. package/dist/components/text/fonts/oswald.strokes.d.ts +3 -0
  428. package/dist/components/text/fonts/oswald.strokes.d.ts.map +1 -0
  429. package/dist/components/text/fonts/oswald.strokes.js +4 -0
  430. package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
  431. package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
  432. package/dist/components/text/fonts/pacifico.outline.js +4 -0
  433. package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
  434. package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
  435. package/dist/components/text/fonts/pacifico.strokes.js +4 -0
  436. package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
  437. package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
  438. package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
  439. package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
  440. package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
  441. package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
  442. package/dist/components/text/fonts/playfair-display.outline.d.ts +3 -0
  443. package/dist/components/text/fonts/playfair-display.outline.d.ts.map +1 -0
  444. package/dist/components/text/fonts/playfair-display.outline.js +4 -0
  445. package/dist/components/text/fonts/playfair-display.strokes.d.ts +3 -0
  446. package/dist/components/text/fonts/playfair-display.strokes.d.ts.map +1 -0
  447. package/dist/components/text/fonts/playfair-display.strokes.js +4 -0
  448. package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
  449. package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
  450. package/dist/components/text/fonts/poppins.outline.js +4 -0
  451. package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
  452. package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
  453. package/dist/components/text/fonts/poppins.strokes.js +4 -0
  454. package/dist/components/text/fonts/roboto.outline.d.ts +3 -0
  455. package/dist/components/text/fonts/roboto.outline.d.ts.map +1 -0
  456. package/dist/components/text/fonts/roboto.outline.js +4 -0
  457. package/dist/components/text/fonts/roboto.strokes.d.ts +3 -0
  458. package/dist/components/text/fonts/roboto.strokes.d.ts.map +1 -0
  459. package/dist/components/text/fonts/roboto.strokes.js +4 -0
  460. package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
  461. package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
  462. package/dist/components/text/fonts/satisfy.outline.js +4 -0
  463. package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
  464. package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
  465. package/dist/components/text/fonts/satisfy.strokes.js +4 -0
  466. package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
  467. package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
  468. package/dist/components/text/fonts/sriracha.outline.js +4 -0
  469. package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
  470. package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
  471. package/dist/components/text/fonts/sriracha.strokes.js +4 -0
  472. package/dist/components/text/index.d.ts +29 -0
  473. package/dist/components/text/index.d.ts.map +1 -0
  474. package/dist/components/text/index.js +14 -0
  475. package/dist/components/text/useTextObject.d.ts +22 -0
  476. package/dist/components/text/useTextObject.d.ts.map +1 -0
  477. package/dist/components/text/useTextObject.js +130 -0
  478. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  479. package/dist/components/water/OceanSurface.js +3 -1
  480. package/dist/components/water/WaterBody.d.ts.map +1 -1
  481. package/dist/components/water/WaterBody.js +3 -1
  482. package/dist/components/water/types.d.ts +5 -1
  483. package/dist/components/water/types.d.ts.map +1 -1
  484. package/dist/constants.d.ts.map +1 -1
  485. package/dist/constants.js +6 -0
  486. package/dist/hooks/index.d.ts +2 -0
  487. package/dist/hooks/index.d.ts.map +1 -1
  488. package/dist/hooks/index.js +1 -0
  489. package/dist/hooks/useCloudSun.d.ts +9 -4
  490. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  491. package/dist/hooks/useCloudSun.js +17 -7
  492. package/dist/hooks/useConfigLive.d.ts +3 -2
  493. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  494. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  495. package/dist/hooks/useContinuousEffects.js +4 -10
  496. package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
  497. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
  498. package/dist/hooks/useEnvironmentProbe.js +47 -8
  499. package/dist/hooks/useGridSurface.d.ts +3 -10
  500. package/dist/hooks/useGridSurface.d.ts.map +1 -1
  501. package/dist/hooks/useGridSurface.js +5 -31
  502. package/dist/hooks/useInteraction.d.ts.map +1 -1
  503. package/dist/hooks/useInteraction.js +19 -72
  504. package/dist/hooks/useLightConfig.d.ts +2 -1
  505. package/dist/hooks/useLightConfig.d.ts.map +1 -1
  506. package/dist/hooks/useOceanMaterial.d.ts +6 -2
  507. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  508. package/dist/hooks/useOceanMaterial.js +37 -2
  509. package/dist/hooks/useSkyLive.d.ts +23 -0
  510. package/dist/hooks/useSkyLive.d.ts.map +1 -0
  511. package/dist/hooks/useSkyLive.js +30 -0
  512. package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
  513. package/dist/hooks/useSkyUniforms.js +2 -10
  514. package/dist/hooks/useTerrainLive.d.ts +3 -1
  515. package/dist/hooks/useTerrainLive.d.ts.map +1 -1
  516. package/dist/hooks/useTerrainTextures.d.ts +38 -0
  517. package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
  518. package/dist/hooks/useTerrainTextures.js +149 -0
  519. package/dist/index.d.ts +12 -3
  520. package/dist/index.d.ts.map +1 -1
  521. package/dist/index.js +9 -2
  522. package/dist/operations/catalogue/blastOff.d.ts +3 -0
  523. package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
  524. package/dist/operations/catalogue/blastOff.js +118 -0
  525. package/dist/operations/catalogue/bounce.d.ts +3 -0
  526. package/dist/operations/catalogue/bounce.d.ts.map +1 -0
  527. package/dist/operations/catalogue/bounce.js +34 -0
  528. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
  529. package/dist/operations/catalogue/curlSmoke.js +3 -1
  530. package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
  531. package/dist/operations/catalogue/dissolve.js +2 -1
  532. package/dist/operations/catalogue/driftUp.d.ts +3 -0
  533. package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
  534. package/dist/operations/catalogue/driftUp.js +57 -0
  535. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
  536. package/dist/operations/catalogue/emberAsh.js +2 -1
  537. package/dist/operations/catalogue/flip.d.ts.map +1 -1
  538. package/dist/operations/catalogue/flip.js +19 -9
  539. package/dist/operations/catalogue/float.d.ts +3 -0
  540. package/dist/operations/catalogue/float.d.ts.map +1 -0
  541. package/dist/operations/catalogue/float.js +39 -0
  542. package/dist/operations/catalogue/flock.d.ts.map +1 -1
  543. package/dist/operations/catalogue/flock.js +44 -9
  544. package/dist/operations/catalogue/flyBy.d.ts +3 -0
  545. package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
  546. package/dist/operations/catalogue/flyBy.js +79 -0
  547. package/dist/operations/catalogue/frost.d.ts.map +1 -1
  548. package/dist/operations/catalogue/frost.js +10 -3
  549. package/dist/operations/catalogue/grow.d.ts +3 -0
  550. package/dist/operations/catalogue/grow.d.ts.map +1 -0
  551. package/dist/operations/catalogue/grow.js +19 -0
  552. package/dist/operations/catalogue/hologram.d.ts.map +1 -1
  553. package/dist/operations/catalogue/hologram.js +11 -5
  554. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -1
  555. package/dist/operations/catalogue/inkBloom.js +46 -9
  556. package/dist/operations/catalogue/jelly.d.ts.map +1 -1
  557. package/dist/operations/catalogue/jelly.js +18 -8
  558. package/dist/operations/catalogue/knockAway.d.ts +3 -0
  559. package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
  560. package/dist/operations/catalogue/knockAway.js +74 -0
  561. package/dist/operations/catalogue/leafFall.d.ts +3 -0
  562. package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
  563. package/dist/operations/catalogue/leafFall.js +74 -0
  564. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
  565. package/dist/operations/catalogue/lidarScan.js +4 -1
  566. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -1
  567. package/dist/operations/catalogue/liquidMetal.js +41 -12
  568. package/dist/operations/catalogue/metalize.d.ts.map +1 -1
  569. package/dist/operations/catalogue/metalize.js +8 -2
  570. package/dist/operations/catalogue/motionTrail.d.ts +6 -0
  571. package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
  572. package/dist/operations/catalogue/motionTrail.js +221 -0
  573. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -1
  574. package/dist/operations/catalogue/particleSwarm.js +29 -9
  575. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -1
  576. package/dist/operations/catalogue/petalPeel.js +33 -9
  577. package/dist/operations/catalogue/petrify.d.ts.map +1 -1
  578. package/dist/operations/catalogue/petrify.js +9 -3
  579. package/dist/operations/catalogue/physicalExit.d.ts +55 -0
  580. package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
  581. package/dist/operations/catalogue/physicalExit.js +165 -0
  582. package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
  583. package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
  584. package/dist/operations/catalogue/physicalHeld.js +78 -0
  585. package/dist/operations/catalogue/physicalMix.d.ts +45 -0
  586. package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
  587. package/dist/operations/catalogue/physicalMix.js +144 -0
  588. package/dist/operations/catalogue/pop.d.ts +3 -0
  589. package/dist/operations/catalogue/pop.d.ts.map +1 -0
  590. package/dist/operations/catalogue/pop.js +44 -0
  591. package/dist/operations/catalogue/portal.d.ts.map +1 -1
  592. package/dist/operations/catalogue/portal.js +33 -11
  593. package/dist/operations/catalogue/print3d.d.ts.map +1 -1
  594. package/dist/operations/catalogue/print3d.js +5 -1
  595. package/dist/operations/catalogue/pulse.d.ts +3 -0
  596. package/dist/operations/catalogue/pulse.d.ts.map +1 -0
  597. package/dist/operations/catalogue/pulse.js +29 -0
  598. package/dist/operations/catalogue/restPose.d.ts +5 -7
  599. package/dist/operations/catalogue/restPose.d.ts.map +1 -1
  600. package/dist/operations/catalogue/restPose.js +18 -48
  601. package/dist/operations/catalogue/rotate.d.ts +3 -0
  602. package/dist/operations/catalogue/rotate.d.ts.map +1 -0
  603. package/dist/operations/catalogue/rotate.js +49 -0
  604. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -1
  605. package/dist/operations/catalogue/sandErosion.js +36 -14
  606. package/dist/operations/catalogue/shake.d.ts +3 -0
  607. package/dist/operations/catalogue/shake.d.ts.map +1 -0
  608. package/dist/operations/catalogue/shake.js +31 -0
  609. package/dist/operations/catalogue/shatter.d.ts.map +1 -1
  610. package/dist/operations/catalogue/shatter.js +5 -1
  611. package/dist/operations/catalogue/slam.d.ts +3 -0
  612. package/dist/operations/catalogue/slam.d.ts.map +1 -0
  613. package/dist/operations/catalogue/slam.js +89 -0
  614. package/dist/operations/catalogue/slingshot.d.ts +3 -0
  615. package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
  616. package/dist/operations/catalogue/slingshot.js +88 -0
  617. package/dist/operations/catalogue/spin.d.ts.map +1 -1
  618. package/dist/operations/catalogue/spin.js +24 -13
  619. package/dist/operations/catalogue/sway.d.ts +3 -0
  620. package/dist/operations/catalogue/sway.d.ts.map +1 -0
  621. package/dist/operations/catalogue/sway.js +23 -0
  622. package/dist/operations/catalogue/swirl.d.ts.map +1 -1
  623. package/dist/operations/catalogue/swirl.js +6 -5
  624. package/dist/operations/catalogue/teleport.d.ts.map +1 -1
  625. package/dist/operations/catalogue/teleport.js +43 -12
  626. package/dist/operations/catalogue/trailCore.d.ts +89 -0
  627. package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
  628. package/dist/operations/catalogue/trailCore.js +190 -0
  629. package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
  630. package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
  631. package/dist/operations/catalogue/trailGhosts.js +179 -0
  632. package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
  633. package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
  634. package/dist/operations/catalogue/trailStampStyles.js +479 -0
  635. package/dist/operations/catalogue/trailStamps.d.ts +57 -0
  636. package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
  637. package/dist/operations/catalogue/trailStamps.js +349 -0
  638. package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
  639. package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
  640. package/dist/operations/catalogue/trailStreaks.js +147 -0
  641. package/dist/operations/catalogue/transitionField.d.ts +30 -0
  642. package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
  643. package/dist/operations/catalogue/transitionField.js +21 -0
  644. package/dist/operations/catalogue/turnAway.d.ts +3 -0
  645. package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
  646. package/dist/operations/catalogue/turnAway.js +54 -0
  647. package/dist/operations/catalogue/unweave.d.ts.map +1 -1
  648. package/dist/operations/catalogue/unweave.js +34 -15
  649. package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
  650. package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
  651. package/dist/operations/catalogue/vortexDrain.js +68 -0
  652. package/dist/operations/catalogue/voxelize.d.ts.map +1 -1
  653. package/dist/operations/catalogue/voxelize.js +37 -10
  654. package/dist/operations/catalogue/warp.d.ts +3 -0
  655. package/dist/operations/catalogue/warp.d.ts.map +1 -0
  656. package/dist/operations/catalogue/warp.js +73 -0
  657. package/dist/operations/catalogue/whoosh.d.ts +3 -0
  658. package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
  659. package/dist/operations/catalogue/whoosh.js +84 -0
  660. package/dist/operations/catalogue/wobble.d.ts +3 -0
  661. package/dist/operations/catalogue/wobble.d.ts.map +1 -0
  662. package/dist/operations/catalogue/wobble.js +23 -0
  663. package/dist/operations/clipPreview.d.ts +3 -0
  664. package/dist/operations/clipPreview.d.ts.map +1 -0
  665. package/dist/operations/clipPreview.js +20 -0
  666. package/dist/operations/groupFanout.d.ts +96 -0
  667. package/dist/operations/groupFanout.d.ts.map +1 -0
  668. package/dist/operations/groupFanout.js +365 -0
  669. package/dist/operations/groups.d.ts +20 -0
  670. package/dist/operations/groups.d.ts.map +1 -0
  671. package/dist/operations/groups.js +66 -0
  672. package/dist/operations/index.d.ts +5 -2
  673. package/dist/operations/index.d.ts.map +1 -1
  674. package/dist/operations/index.js +5 -2
  675. package/dist/operations/objectEffects.d.ts +161 -6
  676. package/dist/operations/objectEffects.d.ts.map +1 -1
  677. package/dist/operations/objectEffects.js +1091 -17
  678. package/dist/operations/registry.d.ts.map +1 -1
  679. package/dist/operations/registry.js +24 -2
  680. package/dist/operations/runtime.d.ts +57 -2
  681. package/dist/operations/runtime.d.ts.map +1 -1
  682. package/dist/operations/runtime.js +161 -18
  683. package/dist/operations/types.d.ts +60 -3
  684. package/dist/operations/types.d.ts.map +1 -1
  685. package/dist/operations/types.js +5 -1
  686. package/dist/operations/useObjectEffectLayers.d.ts +2 -2
  687. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
  688. package/dist/operations/useObjectEffectLayers.js +31 -10
  689. package/dist/operations/usePresentedVisibility.d.ts +10 -0
  690. package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
  691. package/dist/operations/usePresentedVisibility.js +53 -0
  692. package/dist/presets/terrainBiomes.d.ts +67 -0
  693. package/dist/presets/terrainBiomes.d.ts.map +1 -0
  694. package/dist/presets/terrainBiomes.js +294 -0
  695. package/dist/presets/terrainPresets.d.ts +6 -0
  696. package/dist/presets/terrainPresets.d.ts.map +1 -1
  697. package/dist/presets/terrainPresets.js +26 -38
  698. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  699. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  700. package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
  701. package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
  702. package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
  703. package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
  704. package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
  705. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
  706. package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
  707. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
  708. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  709. package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
  710. package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
  711. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  712. package/dist/shaders/terrain/TerrainMaterial.js +107 -8
  713. package/dist/triggers/engine.d.ts +44 -0
  714. package/dist/triggers/engine.d.ts.map +1 -0
  715. package/dist/triggers/engine.js +168 -0
  716. package/dist/triggers/hosts/actions.d.ts +8 -0
  717. package/dist/triggers/hosts/actions.d.ts.map +1 -0
  718. package/dist/triggers/hosts/actions.js +22 -0
  719. package/dist/triggers/hosts/interactions.d.ts +6 -0
  720. package/dist/triggers/hosts/interactions.d.ts.map +1 -0
  721. package/dist/triggers/hosts/interactions.js +4 -0
  722. package/dist/triggers/hosts/timelineCues.d.ts +2 -0
  723. package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
  724. package/dist/triggers/hosts/timelineCues.js +22 -0
  725. package/dist/triggers/index.d.ts +13 -0
  726. package/dist/triggers/index.d.ts.map +1 -0
  727. package/dist/triggers/index.js +9 -0
  728. package/dist/triggers/kinds/action.d.ts +2 -0
  729. package/dist/triggers/kinds/action.d.ts.map +1 -0
  730. package/dist/triggers/kinds/action.js +31 -0
  731. package/dist/triggers/kinds/animations.d.ts +2 -0
  732. package/dist/triggers/kinds/animations.d.ts.map +1 -0
  733. package/dist/triggers/kinds/animations.js +75 -0
  734. package/dist/triggers/kinds/effects.d.ts +2 -0
  735. package/dist/triggers/kinds/effects.d.ts.map +1 -0
  736. package/dist/triggers/kinds/effects.js +27 -0
  737. package/dist/triggers/kinds/index.d.ts +4 -0
  738. package/dist/triggers/kinds/index.d.ts.map +1 -0
  739. package/dist/triggers/kinds/index.js +4 -0
  740. package/dist/triggers/log.d.ts +21 -0
  741. package/dist/triggers/log.d.ts.map +1 -0
  742. package/dist/triggers/log.js +43 -0
  743. package/dist/triggers/readiness.d.ts +40 -0
  744. package/dist/triggers/readiness.d.ts.map +1 -0
  745. package/dist/triggers/readiness.js +158 -0
  746. package/dist/triggers/registry.d.ts +41 -0
  747. package/dist/triggers/registry.d.ts.map +1 -0
  748. package/dist/triggers/registry.js +7 -0
  749. package/dist/types/gridConfigs.d.ts +18 -23
  750. package/dist/types/gridConfigs.d.ts.map +1 -1
  751. package/dist/ui/UiAnchorUpdater.d.ts +10 -0
  752. package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
  753. package/dist/ui/UiAnchorUpdater.js +111 -0
  754. package/dist/ui/UiLayers.d.ts +20 -0
  755. package/dist/ui/UiLayers.d.ts.map +1 -0
  756. package/dist/ui/UiLayers.js +57 -0
  757. package/dist/ui/index.d.ts +9 -0
  758. package/dist/ui/index.d.ts.map +1 -0
  759. package/dist/ui/index.js +6 -0
  760. package/dist/ui/uiAnchors.d.ts +21 -0
  761. package/dist/ui/uiAnchors.d.ts.map +1 -0
  762. package/dist/ui/uiAnchors.js +22 -0
  763. package/dist/ui/uiBaseStyles.d.ts +2 -0
  764. package/dist/ui/uiBaseStyles.d.ts.map +1 -0
  765. package/dist/ui/uiBaseStyles.js +100 -0
  766. package/dist/ui/uiBinder.d.ts +30 -0
  767. package/dist/ui/uiBinder.d.ts.map +1 -0
  768. package/dist/ui/uiBinder.js +344 -0
  769. package/dist/utils/configAnimations.d.ts.map +1 -1
  770. package/dist/utils/configAnimations.js +5 -1
  771. package/dist/utils/gridConfig.d.ts +1 -1
  772. package/dist/utils/gridConfig.d.ts.map +1 -1
  773. package/dist/utils/gridConfig.js +1 -1
  774. package/dist/utils/landPatch.d.ts +33 -0
  775. package/dist/utils/landPatch.d.ts.map +1 -0
  776. package/dist/utils/landPatch.js +114 -0
  777. package/dist/utils/pickProxy.d.ts +11 -0
  778. package/dist/utils/pickProxy.d.ts.map +1 -0
  779. package/dist/utils/pickProxy.js +36 -0
  780. package/dist/utils/renderedSky.d.ts +32 -0
  781. package/dist/utils/renderedSky.d.ts.map +1 -0
  782. package/dist/utils/renderedSky.js +57 -0
  783. package/dist/utils/shapes.d.ts +4 -0
  784. package/dist/utils/shapes.d.ts.map +1 -1
  785. package/dist/utils/shapes.js +4 -1
  786. package/dist/utils/skyMoon.d.ts +35 -0
  787. package/dist/utils/skyMoon.d.ts.map +1 -0
  788. package/dist/utils/skyMoon.js +41 -0
  789. package/dist/utils/terrainHeight.d.ts +4 -0
  790. package/dist/utils/terrainHeight.d.ts.map +1 -0
  791. package/dist/utils/terrainHeight.js +150 -0
  792. package/dist/utils/terrainTextureResolver.d.ts +18 -0
  793. package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
  794. package/dist/utils/terrainTextureResolver.js +17 -0
  795. package/dist/utils/terrainUniforms.d.ts +17 -0
  796. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  797. package/dist/utils/terrainUniforms.js +84 -0
  798. package/dist/utils/textShape.d.ts +24 -0
  799. package/dist/utils/textShape.d.ts.map +1 -0
  800. package/dist/utils/textShape.js +102 -0
  801. package/dist/utils/textureArrays.d.ts +29 -0
  802. package/dist/utils/textureArrays.d.ts.map +1 -0
  803. package/dist/utils/textureArrays.js +140 -0
  804. package/package.json +2 -2
@@ -0,0 +1,727 @@
1
+ import * as THREE from 'three';
2
+ import { buildCapsules, capsuleMaterial, setReveal } from '../ribbon.js';
3
+ import { prepare, applyDraw, applyErase, extentOf, DRAW_METHODS, ERASE_METHODS } from '../methods.js';
4
+ const hex = (h) => new THREE.Color(h);
5
+ const clamp01 = (x) => Math.max(0, Math.min(1, x));
6
+ function mulberry32(a) { return function () { a |= 0; a = (a + 0x6D2B79F5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }
7
+ // =========================================================================================
8
+ // frostGrowth - hoarfrost / dendritic ice crystallising on the letters.
9
+ //
10
+ // The maths (all computed once, at build, deterministically):
11
+ // * Ice Ih is hexagonal, so a growing dendrite arm splits sidebranches at +/-60 deg to its own heading (six-fold
12
+ // lattice), forward leaning, each sidebranch shorter than the part of the parent that lies beyond its root (the
13
+ // pointed fern envelope), with occasional tip-splitting into a trident (tip + two 60 deg prongs).
14
+ // * Generation 0 is the rime along every letter contour (the spine). It spreads both ways from a nucleation point.
15
+ // Generation 1 barbs leave the spine at 60 deg to the local tangent (outward into the frost zone; some inward, short),
16
+ // generation 2..4 are sidebranches of sidebranches.
17
+ // * Diffusion-limited screening: a signed-distance grid of the letters bounds the frost zone (reach), and a coarse
18
+ // segment occupancy grid rejects any step that would come closer than a generation-dependent separation to a branch of
19
+ // another lineage, so arms never cross; they stop where they meet (generation by generation = the older, larger arms
20
+ // claim space first, which is exactly what screens the small ones).
21
+ // * Every point gets a birth time = parent's time at the root + latency + distance along the arm / tip speed. DRAW is
22
+ // therefore literally the crystal growing (spines first, tips last); ERASE ('sublimate') is the reverse weighted by
23
+ // thinness: hairs and tips vanish first, the spine last. Shared methods drive only the spine; the branches follow it.
24
+ // * Shading: thickness tapers with generation and along the arm; colour = ramp between a cool deep tone (thick) and a
25
+ // pale blue-white (thin), with a Fresnel-like bright rim; sub-pixel hairs are dimmed by their pixel coverage.
26
+ // =========================================================================================
27
+ const CELL = 0.01; // signed-distance grid cell (em)
28
+ const STEP = [0.016, 0.014, 0.01, 0.007, 0.0055]; // step length per generation
29
+ const SEP = [0.0, 0.0125, 0.0075, 0.0058, 0.0046]; // min distance to a foreign arm per generation
30
+ const SIDE_SP = [0, 0, 0.027, 0.018, 0.012]; // side-branch spacing along an arm of generation g -> children
31
+ const SIDE_RATIO = [0, 0, 0.56, 0.5, 0.46]; // child length / remaining length of the parent
32
+ const MIN_LEN = [0, 0.03, 0.02, 0.014, 0.01];
33
+ const SPEED = [0, 2.4, 3.0, 3.6, 4.2]; // progress per em along an arm of generation g (slower = bigger crystal)
34
+ const LATENCY = [0, 0.03, 0.025, 0.02, 0.015];
35
+ const WF = [0.66, 0.5, 0.4, 0.3, 0.22]; // thickness factor per generation
36
+ const MAX_GEN = 4;
37
+ const MAX_SEG = 24000;
38
+ const SIN60 = Math.sqrt(3) / 2, COS60 = 0.5;
39
+ // ---- signed distance grid of the letters (union by non-zero winding, chamfer distance) ----------------------------
40
+ function buildSDF(strokes, ext, pad) {
41
+ const x0 = ext.x0 - pad, y0 = ext.y0 - pad;
42
+ const W = Math.ceil((ext.w + 2 * pad) / CELL) + 2, H = Math.ceil((ext.h + 2 * pad) / CELL) + 2;
43
+ const rows = new Array(H);
44
+ for (let j = 0; j < H; j++)
45
+ rows[j] = [];
46
+ for (const s of strokes) {
47
+ const n = s.pts.length / 2;
48
+ for (let i = 0; i < n - 1; i++) {
49
+ const ax = s.pts[2 * i], ay = s.pts[2 * i + 1], bx = s.pts[2 * i + 2], by = s.pts[2 * i + 3];
50
+ if (ay === by)
51
+ continue;
52
+ const lo = Math.min(ay, by), hi = Math.max(ay, by), dir = by > ay ? 1 : -1;
53
+ const j0 = Math.max(0, Math.ceil((lo - y0) / CELL - 0.5)), j1 = Math.min(H - 1, Math.ceil((hi - y0) / CELL - 0.5) - 1);
54
+ for (let j = j0; j <= j1; j++) {
55
+ const cy = y0 + (j + 0.5) * CELL;
56
+ rows[j].push(ax + ((cy - ay) * (bx - ax)) / (by - ay), dir);
57
+ }
58
+ }
59
+ }
60
+ const ins = new Uint8Array(W * H);
61
+ for (let j = 0; j < H; j++) {
62
+ const r = rows[j];
63
+ const m = r.length / 2;
64
+ if (!m)
65
+ continue;
66
+ const idx = Array.from({ length: m }, (_, k) => k).sort((a, b) => r[2 * a] - r[2 * b]);
67
+ let w = 0;
68
+ for (let k = 0; k < m - 1; k++) {
69
+ w += r[2 * idx[k] + 1];
70
+ if (w !== 0) {
71
+ const i0 = Math.max(0, Math.ceil((r[2 * idx[k]] - x0) / CELL - 0.5)), i1 = Math.min(W - 1, Math.ceil((r[2 * idx[k + 1]] - x0) / CELL - 0.5) - 1);
72
+ for (let i = i0; i <= i1; i++)
73
+ ins[j * W + i] = 1;
74
+ }
75
+ }
76
+ }
77
+ const dt = (src) => {
78
+ const d = new Float32Array(W * H);
79
+ const INF = 1e6, R2 = Math.SQRT2;
80
+ for (let k = 0; k < W * H; k++)
81
+ d[k] = ins[k] === src ? 0 : INF;
82
+ for (let j = 0; j < H; j++)
83
+ for (let i = 0; i < W; i++) {
84
+ const k = j * W + i;
85
+ let v = d[k];
86
+ if (i > 0)
87
+ v = Math.min(v, d[k - 1] + 1);
88
+ if (j > 0) {
89
+ v = Math.min(v, d[k - W] + 1);
90
+ if (i > 0)
91
+ v = Math.min(v, d[k - W - 1] + R2);
92
+ if (i < W - 1)
93
+ v = Math.min(v, d[k - W + 1] + R2);
94
+ }
95
+ d[k] = v;
96
+ }
97
+ for (let j = H - 1; j >= 0; j--)
98
+ for (let i = W - 1; i >= 0; i--) {
99
+ const k = j * W + i;
100
+ let v = d[k];
101
+ if (i < W - 1)
102
+ v = Math.min(v, d[k + 1] + 1);
103
+ if (j < H - 1) {
104
+ v = Math.min(v, d[k + W] + 1);
105
+ if (i < W - 1)
106
+ v = Math.min(v, d[k + W + 1] + R2);
107
+ if (i > 0)
108
+ v = Math.min(v, d[k + W - 1] + R2);
109
+ }
110
+ d[k] = v;
111
+ }
112
+ return d;
113
+ };
114
+ const dOut = dt(1), dIn = dt(0);
115
+ const sd = new Float32Array(W * H);
116
+ for (let k = 0; k < W * H; k++)
117
+ sd[k] = (ins[k] ? -(dIn[k] - 0.5) : dOut[k] - 0.5) * CELL;
118
+ return { sample(x, y) {
119
+ const u = (x - x0) / CELL - 0.5, v = (y - y0) / CELL - 0.5;
120
+ const i = Math.floor(u), j = Math.floor(v);
121
+ if (i < 0 || j < 0 || i >= W - 1 || j >= H - 1)
122
+ return 1;
123
+ const fx = u - i, fy = v - j, k = j * W + i;
124
+ return (sd[k] * (1 - fx) + sd[k + 1] * fx) * (1 - fy) + (sd[k + W] * (1 - fx) + sd[k + W + 1] * fx) * fy;
125
+ } };
126
+ }
127
+ // ---- segment occupancy grid (screening) ---------------------------------------------------------------------------
128
+ function makeOccupancy(ext, pad) {
129
+ const OC = 0.03;
130
+ const x0 = ext.x0 - pad, y0 = ext.y0 - pad;
131
+ const OW = Math.ceil((ext.w + 2 * pad) / OC) + 2;
132
+ const cells = new Map();
133
+ const ax = [], ay = [], bx = [], by = [], pid = [];
134
+ const key = (i, j) => i * 4096 + j;
135
+ const cx = (x) => Math.floor((x - x0) / OC), cy = (y) => Math.floor((y - y0) / OC);
136
+ return {
137
+ add(x1, y1, x2, y2, p) {
138
+ const id = ax.length;
139
+ ax.push(x1);
140
+ ay.push(y1);
141
+ bx.push(x2);
142
+ by.push(y2);
143
+ pid.push(p);
144
+ const e = 0.014;
145
+ const i0 = cx(Math.min(x1, x2) - e), i1 = cx(Math.max(x1, x2) + e), j0 = cy(Math.min(y1, y2) - e), j1 = cy(Math.max(y1, y2) + e);
146
+ for (let i = i0; i <= i1; i++)
147
+ for (let j = j0; j <= j1; j++) {
148
+ const k = key(i, j);
149
+ let a = cells.get(k);
150
+ if (!a) {
151
+ a = [];
152
+ cells.set(k, a);
153
+ }
154
+ a.push(id);
155
+ }
156
+ },
157
+ // is (px,py) closer than sep to a segment of another lineage? early = skip ancestors / siblings (they share the root)
158
+ blocked(px, py, p, sep, early, parentOf) {
159
+ const a = cells.get(key(cx(px), cy(py)));
160
+ if (!a)
161
+ return false;
162
+ const par = parentOf[p], gpar = par >= 0 ? parentOf[par] : -1;
163
+ for (let n = 0; n < a.length; n++) {
164
+ const id = a[n];
165
+ const o = pid[id];
166
+ if (o === p)
167
+ continue;
168
+ if (early && (o === par || o === gpar || parentOf[o] === par))
169
+ continue;
170
+ const dx = bx[id] - ax[id], dy = by[id] - ay[id];
171
+ const l2 = dx * dx + dy * dy;
172
+ let t = l2 > 0 ? ((px - ax[id]) * dx + (py - ay[id]) * dy) / l2 : 0;
173
+ t = t < 0 ? 0 : t > 1 ? 1 : t;
174
+ const ex = ax[id] + dx * t - px, ey = ay[id] + dy * t - py;
175
+ if (ex * ex + ey * ey < sep * sep)
176
+ return true;
177
+ }
178
+ return false;
179
+ },
180
+ };
181
+ }
182
+ // ---- the crystal --------------------------------------------------------------------------------------------------
183
+ function growCrystal(spines, cfg, rnd) {
184
+ const ext = extentOf(spines);
185
+ const reach = cfg.reach, br = Math.max(0.2, cfg.branching);
186
+ const pad = reach + 0.2;
187
+ const sdf = buildSDF(spines, ext, pad);
188
+ const occ = makeOccupancy(ext, pad);
189
+ const parentOf = [];
190
+ const nc = spines.length;
191
+ spines.forEach((s, ci) => { parentOf.push(-1); for (let i = 0; i < s.pts.length / 2 - 1; i++)
192
+ occ.add(s.pts[2 * i], s.pts[2 * i + 1], s.pts[2 * i + 2], s.pts[2 * i + 3], ci); });
193
+ let segCount = 0;
194
+ const branches = [];
195
+ const reachCap = reach * 1.12 + 0.012, innerDepth = 0.09;
196
+ // ---- crystal grains: K nucleation sites on the letters (farthest-point spread, seeded). A grain = the (slightly warped) Voronoi
197
+ // cell of its site; inside it every arm lies on the grain's own 60 deg lattice (orientation phi), growth stops at the boundary.
198
+ const K = Math.max(1, Math.min(9, Math.round(cfg.grains)));
199
+ const cand = [];
200
+ spines.forEach((s, ci) => { for (let i = 0; i < s.pts.length / 2 - 1; i += 3)
201
+ cand.push([s.pts[2 * i], s.pts[2 * i + 1], ci, i]); });
202
+ const grains = [];
203
+ for (let k = 0; k < K; k++) {
204
+ let best = null, bd = -1;
205
+ for (let t = 0; t < (k ? 160 : 1); t++) {
206
+ const c = cand[Math.floor(rnd() * cand.length)];
207
+ let md = 1e9;
208
+ for (const g of grains)
209
+ md = Math.min(md, Math.hypot(c[0] - g.x, c[1] - g.y));
210
+ if (k === 0)
211
+ md = 1;
212
+ if (md > bd) {
213
+ bd = md;
214
+ best = c;
215
+ }
216
+ }
217
+ grains.push({ x: best[0], y: best[1], ci: best[2], i: best[3], phi: ((k * 0.618034 + 0.12 * rnd()) % 1) * (Math.PI / 3), delay: k ? rnd() * 0.1 : 0, p1: rnd() * 6.28, p2: rnd() * 6.28, p3: rnd() * 6.28, p4: rnd() * 6.28 });
218
+ }
219
+ const score = (k, x, y) => { const g = grains[k]; return Math.hypot(x - g.x, y - g.y) + 0.02 * Math.sin(x * 7.3 + g.p1) * Math.sin(y * 6.1 + g.p2) + 0.012 * Math.sin(x * 17.0 + y * 11.0 + g.p3); };
220
+ const exactAt = (x, y) => { let b = 0, bs = 1e9; for (let k = 0; k < K; k++) {
221
+ const v = score(k, x, y);
222
+ if (v < bs) {
223
+ bs = v;
224
+ b = k;
225
+ }
226
+ } return b; };
227
+ // label grid (same lattice as the SDF, 1 cell = 1 cm) so the hot loops are a lookup
228
+ const gx0 = ext.x0 - pad, gy0 = ext.y0 - pad, gW = Math.ceil((ext.w + 2 * pad) / CELL) + 2, gH = Math.ceil((ext.h + 2 * pad) / CELL) + 2;
229
+ const gl = new Uint8Array(gW * gH);
230
+ if (K > 1)
231
+ for (let j = 0; j < gH; j++)
232
+ for (let i = 0; i < gW; i++)
233
+ gl[j * gW + i] = exactAt(gx0 + (i + 0.5) * CELL, gy0 + (j + 0.5) * CELL);
234
+ const grainAt = (x, y) => { if (K === 1)
235
+ return 0; const i = Math.floor((x - gx0) / CELL), j = Math.floor((y - gy0) / CELL); if (i < 0 || j < 0 || i >= gW || j >= gH)
236
+ return exactAt(x, y); return gl[j * gW + i]; };
237
+ const TH = Math.PI / 3;
238
+ const snap = (th, phi) => phi + Math.round((th - phi) / TH) * TH;
239
+ const lattice = (phi, nx, ny, sgn, minDot) => { const out = []; for (let m = 0; m < 6; m++) {
240
+ const a = phi + m * TH;
241
+ const dt = (Math.cos(a) * nx + Math.sin(a) * ny) * sgn;
242
+ if (dt >= minDot)
243
+ out.push({ a, dt });
244
+ } out.sort((u, v) => v.dt - u.dt); return out; };
245
+ // trace one arm; returns its polyline or null
246
+ function trace(sp) {
247
+ const g = sp.g, h = STEP[g], n = Math.max(1, Math.floor(sp.len / h));
248
+ const pid = nc + branches.length;
249
+ parentOf[pid] = sp.parent;
250
+ let x = sp.x, y = sp.y, th = sp.th;
251
+ const bend = (rnd() - 0.5) * 0.04;
252
+ const pts = [x, y];
253
+ const phi = grains[sp.grain].phi;
254
+ const m3 = (((Math.round((sp.th - phi) / TH) % 3) + 3) % 3);
255
+ for (let k = 1; k <= n; k++) {
256
+ th += bend * 0.3 + (rnd() - 0.5) * 0.012;
257
+ const nx = x + Math.cos(th) * h, ny = y + Math.sin(th) * h;
258
+ const sd = sdf.sample(nx, ny);
259
+ if (sp.inner) {
260
+ if (k >= 2 && (sd > -0.004 || sd < -innerDepth))
261
+ break;
262
+ }
263
+ else if (k >= 2 && (sd < 0.005 || sd > reachCap))
264
+ break;
265
+ if (K > 1 && grainAt(nx + Math.cos(th) * 0.007, ny + Math.sin(th) * 0.007) !== sp.grain)
266
+ break; // grain boundary: growth stops
267
+ const early = k <= 3;
268
+ if (occ.blocked(nx, ny, pid, SEP[g], early, parentOf) || occ.blocked((x + nx) / 2, (y + ny) / 2, pid, SEP[g], early, parentOf))
269
+ break;
270
+ occ.add(x, y, nx, ny, pid);
271
+ x = nx;
272
+ y = ny;
273
+ pts.push(x, y);
274
+ segCount++;
275
+ }
276
+ if (pts.length < 4) {
277
+ parentOf.length = pid;
278
+ return null;
279
+ }
280
+ const rec = { pts, g, pid, parent: sp.parent, pidx: sp.pidx, inner: sp.inner, glyph: sp.glyph, th, rid: rnd(), grain: sp.grain, m3 };
281
+ branches.push(rec);
282
+ return rec;
283
+ }
284
+ // generation 1: barbs along every contour, snapped to the lattice of the grain they sit in.
285
+ const nuc = [];
286
+ let specs = [];
287
+ const rime = [];
288
+ spines.forEach((s, ci) => {
289
+ const L = s.len;
290
+ const list = grains.filter((g) => g.ci === ci).map((g) => ({ c: s.cum[g.i], delay: g.delay }));
291
+ const own = list.length === 0;
292
+ if (own)
293
+ list.push({ c: rnd() * L, delay: 0 });
294
+ nuc.push({ list, own });
295
+ const c0 = list[0].c;
296
+ const at = (c) => {
297
+ c = ((c % L) + L) % L;
298
+ let lo = 0, hi = s.cum.length - 1;
299
+ while (hi - lo > 1) {
300
+ const m = (lo + hi) >> 1;
301
+ if (s.cum[m] <= c)
302
+ lo = m;
303
+ else
304
+ hi = m;
305
+ }
306
+ const f = (c - s.cum[lo]) / Math.max(1e-9, s.cum[hi] - s.cum[lo]);
307
+ return { x: s.pts[2 * lo] + (s.pts[2 * hi] - s.pts[2 * lo]) * f, y: s.pts[2 * lo + 1] + (s.pts[2 * hi + 1] - s.pts[2 * lo + 1]) * f, i: f > 0.5 ? hi : lo };
308
+ };
309
+ const frame = (c) => {
310
+ const p = at(c), a = at(c - 0.014), b = at(c + 0.014);
311
+ let tx = b.x - a.x, ty = b.y - a.y;
312
+ const tl = Math.hypot(tx, ty) || 1;
313
+ tx /= tl;
314
+ ty /= tl;
315
+ let nx = -ty, ny = tx;
316
+ if (sdf.sample(p.x + 0.008 * nx, p.y + 0.008 * ny) < 0) {
317
+ nx = -nx;
318
+ ny = -ny;
319
+ }
320
+ return { p, nx, ny, gi: grainAt(p.x, p.y) };
321
+ };
322
+ const ds0 = 0.07 / br;
323
+ const ph1 = rnd() * 6.28, ph2 = rnd() * 6.28, f1 = 5 + rnd() * 6, f2 = 13 + rnd() * 9;
324
+ for (let c = rnd() * ds0; c < L; c += ds0 * (0.75 + 0.5 * rnd())) {
325
+ let dd0 = c - c0;
326
+ if (dd0 > L / 2)
327
+ dd0 -= L;
328
+ if (dd0 < -L / 2)
329
+ dd0 += L;
330
+ // patchy: ferns are larger near the nucleus (older frost) and in lucky stretches of the contour; some stretches stay bare rime
331
+ const patch = 0.62 + 0.38 * Math.sin(c * f1 / L * 3 + ph1) * Math.cos(c * f2 + ph2) + 0.2 * (1 - Math.abs(dd0) / (L / 2));
332
+ if (patch < 0.3 || rnd() < 0.08)
333
+ continue;
334
+ const { p, nx, ny, gi } = frame(c);
335
+ const phi = grains[gi].phi;
336
+ const r = rnd();
337
+ const outs = lattice(phi, nx, ny, 1, 0.45);
338
+ const a1 = (outs.length > 1 && rnd() < 0.4 ? outs[outs.length - 1] : outs[0]).a + (rnd() - 0.5) * 0.04;
339
+ specs.push({ x: p.x, y: p.y, th: a1, len: (reach * Math.min(1.25, patch) * (0.75 + 0.5 * r)) / SIN60, g: 1, parent: ci, pidx: p.i, inner: false, glyph: s.glyph, grain: gi, key: rnd() });
340
+ if (rnd() < 0.5) {
341
+ const ins = lattice(phi, nx, ny, -1, 0.45);
342
+ specs.push({ x: p.x, y: p.y, th: ins[Math.floor(rnd() * ins.length)].a, len: Math.min(0.07, reach * 0.6) * (0.7 + 0.6 * rnd()), g: 1, parent: ci, pidx: p.i, inner: true, glyph: s.glyph, grain: gi, key: rnd() });
343
+ }
344
+ }
345
+ // rime fringe: short crystals along the whole edge (generation 2 slots, so they fill what the barbs leave)
346
+ for (let c = rnd() * 0.02; c < L; c += 0.02 * (0.7 + 0.6 * rnd())) {
347
+ if (rnd() < 0.15)
348
+ continue;
349
+ const { p, nx, ny, gi } = frame(c);
350
+ const outs = lattice(grains[gi].phi, nx, ny, 1, 0.45);
351
+ rime.push({ x: p.x, y: p.y, th: outs[Math.floor(rnd() * outs.length)].a, len: (0.012 + 0.03 * rnd()) * Math.min(1, reach / 0.12), g: 2, parent: ci, pidx: p.i, inner: false, glyph: s.glyph, grain: gi, key: rnd() });
352
+ }
353
+ });
354
+ for (let g = 1; g <= MAX_GEN; g++) {
355
+ specs.sort((a, b) => a.key - b.key); // random order inside a generation: nobody is systematically favoured
356
+ const made = [];
357
+ for (const sp of specs) {
358
+ if (segCount > MAX_SEG)
359
+ break;
360
+ const rec = trace(sp);
361
+ if (rec)
362
+ made.push(rec);
363
+ }
364
+ if (g === MAX_GEN)
365
+ break;
366
+ const next = g === 1 ? rime.splice(0) : [];
367
+ for (const b of made) {
368
+ const P = b.pts, n = P.length / 2;
369
+ const ng = g + 1;
370
+ let Ltot = 0;
371
+ const cum = [0];
372
+ for (let i = 1; i < n; i++) {
373
+ Ltot += Math.hypot(P[2 * i] - P[2 * i - 2], P[2 * i + 1] - P[2 * i - 1]);
374
+ cum.push(Ltot);
375
+ }
376
+ b.cum = cum;
377
+ b.len = Ltot;
378
+ const sp = SIDE_SP[ng] / br;
379
+ let last = 0.022;
380
+ for (let i = 1; i < n - 1; i++) {
381
+ if (cum[i] - last < sp * (0.8 + 0.4 * rnd()))
382
+ continue;
383
+ const hx = P[2 * i + 2] - P[2 * i - 2], hy = P[2 * i + 3] - P[2 * i - 1];
384
+ const th = Math.atan2(hy, hx);
385
+ last = cum[i];
386
+ for (let sd = -1; sd <= 1; sd += 2) {
387
+ if (rnd() > 0.92)
388
+ continue;
389
+ const Ls = SIDE_RATIO[ng] * (Ltot - cum[i]) * (0.7 + 0.6 * rnd());
390
+ if (Ls < MIN_LEN[ng])
391
+ continue;
392
+ next.push({ x: P[2 * i], y: P[2 * i + 1], th: snap(th + sd * TH, grains[b.grain].phi) + (rnd() - 0.5) * 0.03, len: Ls, g: ng, parent: b.pid, pidx: i, inner: b.inner, glyph: b.glyph, grain: b.grain, key: rnd() });
393
+ }
394
+ }
395
+ // tip splitting: a trident (tip + two 60 deg prongs)
396
+ if (n > 3 && Ltot > 0.06 && rnd() < 0.38 * Math.min(1.6, br))
397
+ for (let sd = -1; sd <= 1; sd += 2) {
398
+ const Ls = Ltot * 0.3 * (0.7 + 0.6 * rnd());
399
+ if (Ls < MIN_LEN[ng])
400
+ continue;
401
+ next.push({ x: P[2 * n - 2], y: P[2 * n - 1], th: snap(b.th + sd * TH, grains[b.grain].phi) + (rnd() - 0.5) * 0.03, len: Ls, g: ng, parent: b.pid, pidx: n - 1, inner: b.inner, glyph: b.glyph, grain: b.grain, key: rnd() });
402
+ }
403
+ }
404
+ specs = next;
405
+ }
406
+ // ---- grain boundaries: trace the (warped) bisector of every pair of grains through the frost zone -> thin bright seams
407
+ const seams = [];
408
+ if (K > 1) {
409
+ const R = Math.hypot(ext.w, ext.h) / 2 + 0.6, cxm = (ext.x0 + ext.x1) / 2, cym = (ext.y0 + ext.y1) / 2;
410
+ for (let a = 0; a < K; a++)
411
+ for (let b = a + 1; b < K; b++) {
412
+ const A = grains[a], B = grains[b];
413
+ const dx = B.x - A.x, dy = B.y - A.y, dl = Math.hypot(dx, dy) || 1;
414
+ const nx = dx / dl, ny = dy / dl, ux = -ny, uy = nx;
415
+ const mx = (A.x + B.x) / 2, my = (A.y + B.y) / 2;
416
+ let run = [];
417
+ const flush = () => { if (run.length >= 6)
418
+ seams.push({ pts: run.flat() }); run = []; };
419
+ for (let t = -R; t <= R; t += 0.012) {
420
+ const px = mx + ux * t, py = my + uy * t;
421
+ if (Math.abs(px - cxm) > ext.w / 2 + pad || Math.abs(py - cym) > ext.h / 2 + pad) {
422
+ flush();
423
+ continue;
424
+ }
425
+ const sp0 = sdf.sample(px, py);
426
+ if (sp0 > reach + 0.12 || sp0 < -0.14) {
427
+ flush();
428
+ continue;
429
+ }
430
+ const f = (sv) => score(a, px + nx * sv, py + ny * sv) - score(b, px + nx * sv, py + ny * sv);
431
+ let lo = -0.08, hi = 0.08;
432
+ if (f(lo) * f(hi) > 0) {
433
+ flush();
434
+ continue;
435
+ }
436
+ for (let it = 0; it < 12; it++) {
437
+ const m = (lo + hi) / 2;
438
+ if (f(m) * f(lo) > 0)
439
+ lo = m;
440
+ else
441
+ hi = m;
442
+ }
443
+ const qx = px + nx * lo, qy = py + ny * lo;
444
+ const w = grainAt(qx, qy);
445
+ const sdv = sdf.sample(qx, qy);
446
+ if ((w !== a && w !== b) || sdv < 0.008 || sdv > reach * 0.85) {
447
+ flush();
448
+ continue;
449
+ }
450
+ const last = run[run.length - 1];
451
+ if (last && Math.hypot(qx - last[0], qy - last[1]) > 0.035)
452
+ flush();
453
+ run.push([qx, qy]);
454
+ }
455
+ flush();
456
+ }
457
+ }
458
+ return { branches, nuc, nc, seams, grains };
459
+ }
460
+ // ---- schedule: birth times of every point -------------------------------------------------------------------------
461
+ function schedule(spines, crystal, anim, G) {
462
+ const { branches, nuc, nc } = crystal;
463
+ const rnd = mulberry32(991);
464
+ const method = anim.draw.method;
465
+ const tau = []; // tau[pid] = Float32Array per point (raw progress)
466
+ let infoD;
467
+ if (method === 'grow') {
468
+ let half = 1e-3;
469
+ for (const s of spines)
470
+ half = Math.max(half, s.len / 2);
471
+ const vs = 0.26 / half;
472
+ spines.forEach((s, ci) => {
473
+ const n = s.pts.length / 2, L = s.len, t = new Float32Array(n);
474
+ const nu = nuc[ci];
475
+ const g0 = nu.own ? (G > 1 ? 0.12 * (s.glyph / (G - 1)) : 0) + 0.025 * rnd() : 0;
476
+ for (let i = 0; i < n; i++) {
477
+ let m = 1e9;
478
+ for (const q of nu.list) {
479
+ let dd = Math.abs(s.cum[i] - q.c);
480
+ dd = Math.min(dd, L - dd);
481
+ m = Math.min(m, q.delay + dd * vs);
482
+ }
483
+ t[i] = g0 + m;
484
+ } // grains nucleate at their own moment and compete
485
+ tau.push(t);
486
+ });
487
+ infoD = { soft: 0.012, tip: false, fade: false };
488
+ }
489
+ else {
490
+ const ctx = { G: Math.max(1, G), ext: extentOf(spines) };
491
+ infoD = applyDraw(method, spines, anim.draw, ctx);
492
+ spines.forEach((s) => { const n = s.pts.length / 2, t = new Float32Array(n); for (let i = 0; i < n; i++)
493
+ t[i] = 0.5 * (s.seg[0] + s.t[i] * (s.seg[1] - s.seg[0])); tau.push(t); });
494
+ infoD = { ...infoD, tip: false };
495
+ }
496
+ for (const b of branches) {
497
+ const n = b.pts.length / 2, t = new Float32Array(n);
498
+ const t0 = tau[b.parent][Math.min(b.pidx, tau[b.parent].length - 1)] + LATENCY[b.g];
499
+ if (!b.cum) {
500
+ b.cum = [0];
501
+ let L = 0;
502
+ for (let i = 1; i < n; i++) {
503
+ L += Math.hypot(b.pts[2 * i] - b.pts[2 * i - 2], b.pts[2 * i + 1] - b.pts[2 * i - 1]);
504
+ b.cum.push(L);
505
+ }
506
+ b.len = L;
507
+ }
508
+ for (let i = 0; i < n; i++)
509
+ t[i] = t0 + b.cum[i] * SPEED[b.g];
510
+ tau[b.pid] = t;
511
+ }
512
+ // seams appear when the arms of the two grains have reached the boundary: nearest spine point time + arm travel
513
+ (crystal.seams || []).forEach((sm, si) => {
514
+ const n = sm.pts.length / 2, t = new Float32Array(n);
515
+ sm.cum = [0];
516
+ let Lc = 0;
517
+ for (let i = 0; i < n; i++) {
518
+ if (i) {
519
+ Lc += Math.hypot(sm.pts[2 * i] - sm.pts[2 * i - 2], sm.pts[2 * i + 1] - sm.pts[2 * i - 1]);
520
+ sm.cum.push(Lc);
521
+ }
522
+ let bd = 1e9, bt = 0;
523
+ spines.forEach((s, ci) => { for (let k = 0; k < s.pts.length / 2; k += 2) {
524
+ const d2 = (s.pts[2 * k] - sm.pts[2 * i]) ** 2 + (s.pts[2 * k + 1] - sm.pts[2 * i + 1]) ** 2;
525
+ if (d2 < bd) {
526
+ bd = d2;
527
+ bt = tau[ci][k];
528
+ }
529
+ } });
530
+ t[i] = bt + LATENCY[1] + SPEED[1] * Math.sqrt(bd) / SIN60 + 0.03;
531
+ }
532
+ sm.len = Lc;
533
+ tau[nc + branches.length + si] = t;
534
+ sm.pid = nc + branches.length + si;
535
+ });
536
+ let mx = 1e-6;
537
+ for (const t of tau)
538
+ for (let i = 0; i < t.length; i++)
539
+ mx = Math.max(mx, t[i]);
540
+ const f = 0.985 / mx;
541
+ for (const t of tau)
542
+ for (let i = 0; i < t.length; i++)
543
+ t[i] *= f;
544
+ return { tau, infoD };
545
+ }
546
+ // ---- fragment: ice rod cross-section, rim, front glow, sparkle ------------------------------------------------------
547
+ const FROST_FRAG = /* glsl */ `
548
+ uniform vec3 uColor; uniform vec3 uColor2; uniform float uOpacity; uniform float uSparkle; uniform float uHaze; uniform float uW0; uniform float uSeam; uniform float uPhi[9];
549
+ float h11(float x){ return fract(sin(x*127.1 + 7.7)*43758.5453); }
550
+ void main(){
551
+ float d = length(vec2(max(abs(vXY.x) - vHL, 0.0), vXY.y));
552
+ float px = max(length(dFdx(vPos)), length(dFdy(vPos))); px = max(px, 1e-5); // em per pixel
553
+ float seam = step(3.5, vVar); float v2 = vVar - 4.0*seam; float inner = step(1.5, v2); float wf = v2 - 2.0*inner;
554
+ float ig = floor(vGlyph); float grain = floor(ig/4.0); float m3 = ig - 4.0*grain; float lat = step(m3, 2.5);
555
+ float w = uW0*wf;
556
+ float weff = max(w, 0.5*px);
557
+ float amp = min(1.0, w/weff); // sub-pixel hairs are dimmer, never aliased
558
+ float cov = clamp((weff + 0.5*px - d)/px, 0.0, 1.0);
559
+ float s = abs(vXY.y)/weff;
560
+ float rim = smoothstep(0.2, 0.95, s);
561
+ float f = clamp((vXY.x + vHL)/(2.0*max(vHL, 1e-6)), 0.0, 1.0);
562
+ float lit = revealIn(f); float gone = revealOut(f);
563
+ float age = ageAt(f);
564
+ float front = exp(-age/0.28); // the growing front is brighter and whiter
565
+ float settled = smoothstep(0.4, 1.8, age);
566
+ // colour from thickness: thick spines are a deeper cooler tone, thin edges pale blue-white (Fresnel-like rim)
567
+ vec3 body = mix(uColor2, uColor, clamp(0.3 + 1.0*(1.0 - wf), 0.0, 1.0));
568
+ vec3 col = mix(body, uColor, rim*0.85);
569
+ // each grain has its own slightly different cool tint
570
+ float gt = h11(grain*3.7 + 1.3) - 0.5;
571
+ col *= mix(vec3(1.0), vec3(1.0 - 0.24*gt, 1.0 + 0.03*gt, 1.0 + 0.16*gt), lat);
572
+ // facet angle (lattice line orientation of this arm) against a slowly moving light
573
+ float alpha = lat > 0.5 ? uPhi[int(clamp(grain, 0.0, 8.0) + 0.5)] + m3*1.0471976 : h11(vGlyph)*3.14159;
574
+ float psi = 1.1*sin(uTime*0.09*uIdleSpeed) + 0.5*sin(uTime*0.037*uIdleSpeed + 1.3);
575
+ float dl = mod(alpha - psi + 1.5708, 3.14159) - 1.5708;
576
+ float align = exp(-pow(dl/0.22, 2.0));
577
+ float I = (0.64 + 0.36*rim)*(0.5 + 0.5*clamp(wf*1.25, 0.0, 1.0))*(1.0 + 0.16*align*uSparkle*uIdle*lat);
578
+ // grain boundary: thin bright seam / dislocation line
579
+ col = mix(col, mix(uColor, vec3(0.92, 0.98, 1.0), 0.6), seam);
580
+ I = mix(I, uSeam*(0.8 + 0.2*sin(arcAt(f)*120.0)), seam);
581
+ float breath = 1.0 + 0.07*uIdle*sin(uTime*0.5*uIdleSpeed - vPos.x*0.9 + vPos.y*0.4); // slow cold breathing wave through the rim light
582
+ col = mix(col, vec3(1.0), 0.55*front);
583
+ I *= (1.0 + 0.45*front);
584
+ // sublimation: a faint bright edge at the erase front
585
+ float tOv = mix(vTT.z, vTT.w, f); float dE = tOv - vLL.y;
586
+ float sub = (1.0 - uFadeOut)*smoothstep(0.0, 0.03, uE)*exp(-max(dE, 0.0)/0.05)*0.6;
587
+ // sparkle: narrow-peaked glints, each sitting in a cell along its arm and drifting along it while it flashes
588
+ float cellL = 0.05; float aid = vGlyph*61.0;
589
+ float a = arcAt(f)/cellL + aid; float k = floor(a); float fr = fract(a);
590
+ float h1 = h11(k*1.31 + aid), h2 = h11(k*2.17 + aid*3.1), h3 = h11(k*0.73 + aid*5.3);
591
+ float on = step(h3, (0.07 + 0.3*align)*uSparkle);
592
+ float P = mix(3.0, 9.0, h2); float ph = fract(uTime*uIdleSpeed/P + h1);
593
+ float pulse = exp(-pow((ph - 0.5)/0.03, 2.0));
594
+ float cpos = 0.5 + (ph - 0.5)*9.0;
595
+ float da = (fr - cpos)*cellL;
596
+ float rr = length(vec2(da, d));
597
+ float glint = pulse*on*(exp(-pow(rr/0.0035, 2.0)) + 0.35*exp(-pow(rr/0.011, 2.0)) + 0.5*exp(-abs(da)/0.016)*exp(-pow(d/0.0012, 2.0)))*uSparkle*uIdle*settled*(1.0 - 0.5*inner);
598
+ // thin prismatic dispersion: cool to warm with the facet angle against the light, kept close to white
599
+ vec3 spec = mix(vec3(0.92, 0.97, 1.0), mix(vec3(0.55, 0.85, 1.0), vec3(1.0, 0.84, 0.62), 0.5 + 0.5*clamp(dl/0.4, -1.0, 1.0)), 0.6);
600
+ float hz = uHaze*0.2*(0.3 + 0.7*wf)*exp(-pow(d/(0.012 + 0.7*w), 2.0))*(1.0 - 0.5*inner); // frosted glow around the ice
601
+ vec3 hcol = mix(uColor2, uColor, 0.45);
602
+ vec3 c = col*(cov*amp*I*breath*(1.0 - 0.45*inner)) + hcol*hz + uColor*sub*cov + spec*glint*0.95;
603
+ c *= lit*gone*uOpacity;
604
+ gl_FragColor = vec4(c, 1.0);
605
+ #include <tonemapping_fragment>
606
+ #include <colorspace_fragment>
607
+ }`;
608
+ const num = (name, label, description, min, max, step, unit) => ({ name, label, description, type: 'number', min, max, step, ...(unit ? { unit } : {}) });
609
+ const col = (name, label, description) => ({ name, label, description, type: 'color' });
610
+ export default {
611
+ key: 'frostGrowth', source: 'outline', drawMethods: ['grow', ...DRAW_METHODS], eraseMethods: ['sublimate', ...ERASE_METHODS], drawDefault: 'grow', eraseDefault: 'sublimate',
612
+ animDefaults: { drawDuration: 6, drawEase: 'linear', eraseDuration: 3, eraseEase: 'linear' },
613
+ methodInfo: {
614
+ grow: { label: 'Grow', hint: 'Rime spreads along the contours from a nucleation point, branches follow; tips are last' },
615
+ sublimate: { label: 'Sublimate', hint: 'Tips and thin branches vanish first, the spine last' },
616
+ },
617
+ catalog: { name: 'Frost Growth', description: 'Dendritic hoarfrost nucleates in competing crystal grains on the letter outlines, each with its own six-fold lattice and bright boundary seams, then throws prismatic glints. Use for winter, cold-brand and fantasy titles.', tags: ['frost', 'ice', 'crystal', 'dendrite', 'winter', 'cold', 'hoarfrost'] },
618
+ defaults: { reach: 0.15, branching: 1, grains: 5, sparkle: 0.6, thickness: 1, seams: 0.75, haze: 0.5, seed: 7, color: '#d6edff', color2: '#4a90d4', opacity: 1 },
619
+ ui: {
620
+ main: [
621
+ num('reach', 'Reach', 'How far the frost spreads from the letters', 0.04, 0.5, 0.005, 'em'),
622
+ num('branching', 'Branching', 'Side-branch density of the ice ferns', 0.3, 1.8, 0.05),
623
+ num('grains', 'Grains', 'Number of crystal grains; each has its own lattice orientation', 1, 9, 1),
624
+ num('sparkle', 'Sparkle', 'Sharp glints travelling over the crystal facets', 0, 1, 0.01),
625
+ ],
626
+ more: [
627
+ num('thickness', 'Thickness', 'Thickness of the ice arms', 0.4, 2.5, 0.05),
628
+ num('seams', 'Grain seams', 'Brightness of the boundary lines where grains meet', 0, 1, 0.01),
629
+ num('haze', 'Frost haze', 'Soft frosted glow around the ice', 0, 1.5, 0.01),
630
+ col('color', 'Ice', 'Pale colour of thin edges and tips'),
631
+ col('color2', 'Deep ice', 'Cooler deeper tone of thick spines'),
632
+ num('opacity', 'Opacity', 'Overall opacity', 0, 1, 0.01),
633
+ num('seed', 'Seed', 'Random seed of the crystal pattern', 0, 999, 1),
634
+ ],
635
+ },
636
+ structural: ['reach', 'branching', 'grains', 'seed'],
637
+ presets: [
638
+ { name: 'Hoarfrost', description: 'Pale blue-white window frost', patch: {} },
639
+ { name: 'Glacier', description: 'Deep cyan ice, heavier arms', patch: { color: '#9fe6ff', color2: '#1d6fb8', thickness: 1.4, haze: 0.8 } },
640
+ { name: 'Moonlit', description: 'Silver-violet rime with many glints', patch: { color: '#eaeeff', color2: '#7f8fd8', sparkle: 1, haze: 0.3 } },
641
+ { name: 'Fine lace', description: 'Hair-fine, faint crystal', patch: { thickness: 0.6, sparkle: 0.35, haze: 0.2, opacity: 0.9 } },
642
+ { name: 'Arctic', description: 'Teal glow with strong frosted haze', patch: { color: '#c8fff4', color2: '#2aa59a', haze: 1.1, sparkle: 0.8 } },
643
+ ],
644
+ build(layout, cfg, anim) {
645
+ const spines = layout.strokes;
646
+ const G = Math.max(1, layout.glyphs.length);
647
+ const empty = !spines.length;
648
+ const group = new THREE.Group();
649
+ if (empty)
650
+ return { object: group, apply() { }, update() { }, dispose() { } };
651
+ prepare(spines, 'outline');
652
+ const rnd = mulberry32(Math.round(cfg.seed) * 7919 + 13);
653
+ const crystal = growCrystal(spines, { reach: cfg.reach, branching: cfg.branching, grains: cfg.grains }, rnd);
654
+ const { tau, infoD } = schedule(spines, crystal, anim, G);
655
+ // strokes: contours first, then arms. Every stroke gets the full window [0,1] and its own per-point birth times.
656
+ const strokes = spines.slice();
657
+ const pr = (g, inner, u) => Math.max(0.1, WF[g] * (1 - 0.5 * u)) + (inner ? 2 : 0);
658
+ const gen = []; // generation per stroke
659
+ spines.forEach((s, i) => { s.t = tau[i]; s.seg = [0, 1]; s.pressure = new Float32Array(s.pts.length / 2).fill(0.66); s.glyphN = 3 + ((i * 0.6180339) % 1) * 0.98; gen.push(0); });
660
+ crystal.branches.forEach((b) => {
661
+ const n = b.pts.length / 2;
662
+ const st = { pts: Float32Array.from(b.pts), cum: Float32Array.from(b.cum), len: Math.max(1e-6, b.len), closed: false, glyph: b.glyph, ptime: Math.max(1e-3, b.len), pt: null };
663
+ st.t = tau[b.pid];
664
+ st.seg = [0, 1];
665
+ st.pressure = new Float32Array(n);
666
+ for (let i = 0; i < n; i++)
667
+ st.pressure[i] = pr(b.g, b.inner, i / Math.max(1, n - 1));
668
+ st.glyphN = b.grain * 4 + b.m3 + b.rid * 0.98;
669
+ strokes.push(st);
670
+ gen.push(b.g);
671
+ });
672
+ crystal.seams.forEach((sm, si) => {
673
+ const n = sm.pts.length / 2;
674
+ const st = { pts: Float32Array.from(sm.pts), cum: Float32Array.from(sm.cum), len: Math.max(1e-6, sm.len), closed: false, glyph: 0, ptime: Math.max(1e-3, sm.len), pt: null };
675
+ st.t = tau[sm.pid];
676
+ st.seg = [0, 1];
677
+ st.pressure = new Float32Array(n).fill(4.38);
678
+ st.glyphN = 3 + ((si * 0.7548777) % 1) * 0.98;
679
+ strokes.push(st);
680
+ gen.push(9);
681
+ });
682
+ // erase
683
+ const ctx = { G, ext: extentOf(strokes), drawSched: strokes.map((s) => ({ seg: s.seg, t: s.t })), drawInfo: infoD };
684
+ let infoE;
685
+ if (anim.erase.method === 'sublimate') {
686
+ // arms: thin and late-born first. spines next; grain seams (the boundaries) are the very last thing to go
687
+ const r2 = mulberry32(4242);
688
+ let mxv = 1e-6, mnv = 1e6;
689
+ const raw = strokes.map((s, si) => {
690
+ const n = s.pts.length / 2, o = new Float32Array(n);
691
+ const jit = (r2() - 0.5) * 0.12;
692
+ for (let i = 0; i < n; i++) {
693
+ o[i] = 0.5 * (1 - s.t[i] / 0.985) + 0.5 * (1 - Math.min(gen[si], MAX_GEN) / MAX_GEN) + jit;
694
+ if (gen[si] >= 1 && gen[si] <= MAX_GEN) {
695
+ mxv = Math.max(mxv, o[i]);
696
+ mnv = Math.min(mnv, o[i]);
697
+ }
698
+ }
699
+ return o;
700
+ });
701
+ mxv = Math.max(mxv, mnv + 1e-3);
702
+ strokes.forEach((s, si) => {
703
+ const g = gen[si];
704
+ s.segO = [0, 1];
705
+ s.tO = raw[si].map((v, i) => g === 0 ? 0.9 + 0.05 * clamp01(1 - s.t[i] / 0.985) : g > MAX_GEN ? 0.97 + 0.03 * clamp01(1 - s.t[i] / 0.985) : 0.88 * clamp01((v - mnv) / (mxv - mnv)));
706
+ });
707
+ infoE = { soft: 0.05, fade: false };
708
+ }
709
+ else
710
+ infoE = applyErase(anim.erase.method, strokes, anim.erase, ctx);
711
+ strokes.forEach((s) => { s.len = 1; }); // arc coordinate becomes absolute em along the arm (glints use it)
712
+ const geo = buildCapsules(strokes);
713
+ const mat = capsuleMaterial(FROST_FRAG, { uColor: { value: hex(cfg.color) }, uColor2: { value: hex(cfg.color2) }, uOpacity: { value: 1 }, uSparkle: { value: cfg.sparkle }, uHaze: { value: cfg.haze }, uSeam: { value: cfg.seams }, uPhi: { value: Array.from({ length: 9 }, (_, k) => (crystal.grains[k] ? crystal.grains[k].phi : 0)) }, uW0: { value: 0.0068 } });
714
+ const mesh = new THREE.Mesh(geo, mat);
715
+ mesh.frustumCulled = false;
716
+ group.add(mesh);
717
+ const api = {
718
+ object: group,
719
+ apply(c) { const u = mat.uniforms; u.uColor.value.set(c.color); u.uColor2.value.set(c.color2); u.uOpacity.value = c.opacity; u.uSparkle.value = c.sparkle; u.uHaze.value = c.haze; u.uSeam.value = c.seams; u.uW0.value = 0.0068 * c.thickness; u.uHalf.value = 0.028 + 0.005 * c.thickness; api.c = c; },
720
+ update(S, time) { setReveal(mat.uniforms, S, infoD, infoE, anim.draw.duration, time); },
721
+ dispose() { geo.dispose(); mat.dispose(); },
722
+ };
723
+ api.stats = { segments: geo.instanceCount, arms: crystal.branches.length };
724
+ api.apply(cfg);
725
+ return api;
726
+ },
727
+ };