@3driseai/3drise-viewer 0.1.28 → 0.1.29

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 (684) 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 +44 -3
  4. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  5. package/dist/animationsV2/ClipsRuntime.js +173 -55
  6. package/dist/animationsV2/appliers.d.ts.map +1 -1
  7. package/dist/animationsV2/appliers.js +21 -5
  8. package/dist/animationsV2/index.d.ts +1 -1
  9. package/dist/animationsV2/index.d.ts.map +1 -1
  10. package/dist/animationsV2/normalize.d.ts.map +1 -1
  11. package/dist/animationsV2/normalize.js +7 -3
  12. package/dist/animationsV2/sequenceUtils.d.ts +44 -6
  13. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  14. package/dist/animationsV2/sequenceUtils.js +58 -12
  15. package/dist/animationsV2/types.d.ts +22 -12
  16. package/dist/animationsV2/types.d.ts.map +1 -1
  17. package/dist/api/sceneHandle.d.ts +35 -1
  18. package/dist/api/sceneHandle.d.ts.map +1 -1
  19. package/dist/api/sceneHandle.js +88 -17
  20. package/dist/components/AdvancedGrid.d.ts +1 -5
  21. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  22. package/dist/components/AdvancedGrid.js +6 -35
  23. package/dist/components/AnimatedObject.d.ts.map +1 -1
  24. package/dist/components/AnimatedObject.js +9 -4
  25. package/dist/components/ApollonianGrid.d.ts +1 -1
  26. package/dist/components/ApollonianGrid.d.ts.map +1 -1
  27. package/dist/components/ApollonianGrid.js +3 -28
  28. package/dist/components/ChladniGrid.d.ts +1 -1
  29. package/dist/components/ChladniGrid.d.ts.map +1 -1
  30. package/dist/components/ChladniGrid.js +6 -35
  31. package/dist/components/CircuitGrid.d.ts +1 -1
  32. package/dist/components/CircuitGrid.d.ts.map +1 -1
  33. package/dist/components/CircuitGrid.js +6 -34
  34. package/dist/components/ConformalGrid.d.ts +1 -1
  35. package/dist/components/ConformalGrid.d.ts.map +1 -1
  36. package/dist/components/ConformalGrid.js +3 -34
  37. package/dist/components/ContourGrid.d.ts +1 -1
  38. package/dist/components/ContourGrid.d.ts.map +1 -1
  39. package/dist/components/ContourGrid.js +6 -34
  40. package/dist/components/CustomPrimitive.js +1 -1
  41. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  42. package/dist/components/EnvironmentObject.js +9 -7
  43. package/dist/components/FlowNetGrid.d.ts +1 -1
  44. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  45. package/dist/components/FlowNetGrid.js +6 -34
  46. package/dist/components/FractalGrid.d.ts +1 -1
  47. package/dist/components/FractalGrid.d.ts.map +1 -1
  48. package/dist/components/FractalGrid.js +6 -37
  49. package/dist/components/Galaxy.d.ts.map +1 -1
  50. package/dist/components/Galaxy.js +9 -23
  51. package/dist/components/GirihGrid.d.ts +1 -1
  52. package/dist/components/GirihGrid.d.ts.map +1 -1
  53. package/dist/components/GirihGrid.js +6 -35
  54. package/dist/components/GravWaveGrid.d.ts +1 -1
  55. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  56. package/dist/components/GravWaveGrid.js +6 -35
  57. package/dist/components/HexGrid.d.ts +1 -5
  58. package/dist/components/HexGrid.d.ts.map +1 -1
  59. package/dist/components/HexGrid.js +6 -36
  60. package/dist/components/HilbertGrid.d.ts +1 -1
  61. package/dist/components/HilbertGrid.d.ts.map +1 -1
  62. package/dist/components/HilbertGrid.js +3 -30
  63. package/dist/components/HyperbolicGrid.d.ts +1 -1
  64. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  65. package/dist/components/HyperbolicGrid.js +6 -34
  66. package/dist/components/LandObject.d.ts +9 -0
  67. package/dist/components/LandObject.d.ts.map +1 -0
  68. package/dist/components/LandObject.js +15 -0
  69. package/dist/components/LensingGrid.d.ts +1 -1
  70. package/dist/components/LensingGrid.d.ts.map +1 -1
  71. package/dist/components/LensingGrid.js +3 -29
  72. package/dist/components/LightsManager.d.ts.map +1 -1
  73. package/dist/components/LightsManager.js +8 -0
  74. package/dist/components/ModelBoundary.d.ts +2 -0
  75. package/dist/components/ModelBoundary.d.ts.map +1 -1
  76. package/dist/components/ModelBoundary.js +3 -0
  77. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  78. package/dist/components/ModelPrimitive.js +6 -0
  79. package/dist/components/MoireGrid.d.ts +1 -1
  80. package/dist/components/MoireGrid.d.ts.map +1 -1
  81. package/dist/components/MoireGrid.js +6 -35
  82. package/dist/components/MoonDisc.d.ts +11 -0
  83. package/dist/components/MoonDisc.d.ts.map +1 -0
  84. package/dist/components/MoonDisc.js +128 -0
  85. package/dist/components/ObjectNode.d.ts.map +1 -1
  86. package/dist/components/ObjectNode.js +15 -4
  87. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  88. package/dist/components/ObjectsRenderer.js +7 -5
  89. package/dist/components/OceanBuilder.d.ts.map +1 -1
  90. package/dist/components/OceanBuilder.js +2 -0
  91. package/dist/components/ParastichyGrid.d.ts +1 -1
  92. package/dist/components/ParastichyGrid.d.ts.map +1 -1
  93. package/dist/components/ParastichyGrid.js +3 -30
  94. package/dist/components/PhyllotaxisGrid.d.ts +1 -1
  95. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
  96. package/dist/components/PhyllotaxisGrid.js +3 -32
  97. package/dist/components/ProjectLoader.d.ts +5 -3
  98. package/dist/components/ProjectLoader.d.ts.map +1 -1
  99. package/dist/components/ProjectLoader.js +6 -3
  100. package/dist/components/QuasiGrid.d.ts +1 -1
  101. package/dist/components/QuasiGrid.d.ts.map +1 -1
  102. package/dist/components/QuasiGrid.js +6 -33
  103. package/dist/components/RadarGrid.d.ts +1 -1
  104. package/dist/components/RadarGrid.d.ts.map +1 -1
  105. package/dist/components/RadarGrid.js +6 -34
  106. package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
  107. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  108. package/dist/components/ReactionDiffusionGrid.js +6 -35
  109. package/dist/components/SceneBuilder.d.ts +25 -3
  110. package/dist/components/SceneBuilder.d.ts.map +1 -1
  111. package/dist/components/SceneBuilder.js +68 -38
  112. package/dist/components/SkyController.d.ts +25 -1
  113. package/dist/components/SkyController.d.ts.map +1 -1
  114. package/dist/components/SkyController.js +189 -130
  115. package/dist/components/SkyMesh.d.ts.map +1 -1
  116. package/dist/components/SkyMesh.js +26 -1
  117. package/dist/components/SkyStars.d.ts +11 -0
  118. package/dist/components/SkyStars.d.ts.map +1 -0
  119. package/dist/components/SkyStars.js +187 -0
  120. package/dist/components/SkySystem.d.ts +3 -3
  121. package/dist/components/SkySystem.d.ts.map +1 -1
  122. package/dist/components/SkySystem.js +8 -2
  123. package/dist/components/Sun.d.ts +15 -1
  124. package/dist/components/Sun.d.ts.map +1 -1
  125. package/dist/components/Sun.js +64 -3
  126. package/dist/components/SunLight.d.ts +6 -1
  127. package/dist/components/SunLight.d.ts.map +1 -1
  128. package/dist/components/SunLight.js +96 -44
  129. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  130. package/dist/components/TerrainBuilder.js +2 -0
  131. package/dist/components/TextGenerator.d.ts +9 -0
  132. package/dist/components/TextGenerator.d.ts.map +1 -0
  133. package/dist/components/TextGenerator.js +29 -0
  134. package/dist/components/TruchetGrid.d.ts +1 -1
  135. package/dist/components/TruchetGrid.d.ts.map +1 -1
  136. package/dist/components/TruchetGrid.js +3 -30
  137. package/dist/components/VoronoiGrid.d.ts +1 -1
  138. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  139. package/dist/components/VoronoiGrid.js +6 -33
  140. package/dist/components/WallpaperGrid.d.ts +1 -1
  141. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  142. package/dist/components/WallpaperGrid.js +6 -35
  143. package/dist/components/environment/Rain.d.ts +15 -0
  144. package/dist/components/environment/Rain.d.ts.map +1 -0
  145. package/dist/components/environment/Rain.js +110 -0
  146. package/dist/components/environment/Rainbow.d.ts +20 -0
  147. package/dist/components/environment/Rainbow.d.ts.map +1 -0
  148. package/dist/components/environment/Rainbow.js +974 -0
  149. package/dist/components/environment/Sandstorm.d.ts +20 -0
  150. package/dist/components/environment/Sandstorm.d.ts.map +1 -0
  151. package/dist/components/environment/Sandstorm.js +776 -0
  152. package/dist/components/environment/Snow.d.ts +20 -0
  153. package/dist/components/environment/Snow.d.ts.map +1 -0
  154. package/dist/components/environment/Snow.js +609 -0
  155. package/dist/components/environment/Thunderstorm.d.ts +20 -0
  156. package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
  157. package/dist/components/environment/Thunderstorm.js +731 -0
  158. package/dist/components/environment/Tornado.d.ts +20 -0
  159. package/dist/components/environment/Tornado.d.ts.map +1 -0
  160. package/dist/components/environment/Tornado.js +762 -0
  161. package/dist/components/environment/index.d.ts +13 -0
  162. package/dist/components/environment/index.d.ts.map +1 -0
  163. package/dist/components/environment/index.js +7 -0
  164. package/dist/components/index.d.ts +10 -10
  165. package/dist/components/index.d.ts.map +1 -1
  166. package/dist/components/index.js +8 -6
  167. package/dist/components/land/LandPatch.d.ts +15 -0
  168. package/dist/components/land/LandPatch.d.ts.map +1 -0
  169. package/dist/components/land/LandPatch.js +170 -0
  170. package/dist/components/land/index.d.ts +3 -0
  171. package/dist/components/land/index.d.ts.map +1 -0
  172. package/dist/components/land/index.js +1 -0
  173. package/dist/components/space/Earth.d.ts +16 -0
  174. package/dist/components/space/Earth.d.ts.map +1 -0
  175. package/dist/components/space/Earth.js +75 -0
  176. package/dist/components/space/ShootingStar.d.ts +21 -0
  177. package/dist/components/space/ShootingStar.d.ts.map +1 -0
  178. package/dist/components/space/ShootingStar.js +101 -0
  179. package/dist/components/space/ShootingStars.d.ts +16 -0
  180. package/dist/components/space/ShootingStars.d.ts.map +1 -0
  181. package/dist/components/space/ShootingStars.js +71 -0
  182. package/dist/components/space/SolarSystem.d.ts +16 -0
  183. package/dist/components/space/SolarSystem.d.ts.map +1 -0
  184. package/dist/components/space/SolarSystem.js +141 -0
  185. package/dist/components/space/Stars.d.ts +20 -0
  186. package/dist/components/space/Stars.d.ts.map +1 -0
  187. package/dist/components/space/Stars.js +160 -0
  188. package/dist/components/space/index.d.ts +11 -0
  189. package/dist/components/space/index.d.ts.map +1 -0
  190. package/dist/components/space/index.js +8 -0
  191. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  192. package/dist/components/terrain/TerrainSurface.js +27 -3
  193. package/dist/components/terrain/types.d.ts +5 -1
  194. package/dist/components/terrain/types.d.ts.map +1 -1
  195. package/dist/components/text/BurnAwayText.d.ts +15 -0
  196. package/dist/components/text/BurnAwayText.d.ts.map +1 -0
  197. package/dist/components/text/BurnAwayText.js +4 -0
  198. package/dist/components/text/ChalkboardText.d.ts +15 -0
  199. package/dist/components/text/ChalkboardText.d.ts.map +1 -0
  200. package/dist/components/text/ChalkboardText.js +4 -0
  201. package/dist/components/text/ConstellationText.d.ts +15 -0
  202. package/dist/components/text/ConstellationText.d.ts.map +1 -0
  203. package/dist/components/text/ConstellationText.js +4 -0
  204. package/dist/components/text/EmbroideryText.d.ts +15 -0
  205. package/dist/components/text/EmbroideryText.d.ts.map +1 -0
  206. package/dist/components/text/EmbroideryText.js +4 -0
  207. package/dist/components/text/FourierSketchText.d.ts +15 -0
  208. package/dist/components/text/FourierSketchText.d.ts.map +1 -0
  209. package/dist/components/text/FourierSketchText.js +4 -0
  210. package/dist/components/text/FrostGrowthText.d.ts +15 -0
  211. package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
  212. package/dist/components/text/FrostGrowthText.js +4 -0
  213. package/dist/components/text/HandwritingText.d.ts +15 -0
  214. package/dist/components/text/HandwritingText.d.ts.map +1 -0
  215. package/dist/components/text/HandwritingText.js +4 -0
  216. package/dist/components/text/InkBleedText.d.ts +15 -0
  217. package/dist/components/text/InkBleedText.d.ts.map +1 -0
  218. package/dist/components/text/InkBleedText.js +4 -0
  219. package/dist/components/text/LightPaintingText.d.ts +15 -0
  220. package/dist/components/text/LightPaintingText.d.ts.map +1 -0
  221. package/dist/components/text/LightPaintingText.js +4 -0
  222. package/dist/components/text/LiquidMetalText.d.ts +15 -0
  223. package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
  224. package/dist/components/text/LiquidMetalText.js +4 -0
  225. package/dist/components/text/NeonTubeText.d.ts +15 -0
  226. package/dist/components/text/NeonTubeText.d.ts.map +1 -0
  227. package/dist/components/text/NeonTubeText.js +4 -0
  228. package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
  229. package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
  230. package/dist/components/text/PlasmaDischargeText.js +4 -0
  231. package/dist/components/text/TextObjectView.d.ts +12 -0
  232. package/dist/components/text/TextObjectView.d.ts.map +1 -0
  233. package/dist/components/text/TextObjectView.js +11 -0
  234. package/dist/components/text/engine/fieldkit.d.ts +24 -0
  235. package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
  236. package/dist/components/text/engine/fieldkit.js +201 -0
  237. package/dist/components/text/engine/glyphs.d.ts +19 -0
  238. package/dist/components/text/engine/glyphs.d.ts.map +1 -0
  239. package/dist/components/text/engine/glyphs.js +269 -0
  240. package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
  241. package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
  242. package/dist/components/text/engine/looks/burnAway.js +593 -0
  243. package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
  244. package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
  245. package/dist/components/text/engine/looks/chalkboard.js +426 -0
  246. package/dist/components/text/engine/looks/constellation.d.ts +111 -0
  247. package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
  248. package/dist/components/text/engine/looks/constellation.js +496 -0
  249. package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
  250. package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
  251. package/dist/components/text/engine/looks/embroidery.js +645 -0
  252. package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
  253. package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
  254. package/dist/components/text/engine/looks/frostGrowth.js +727 -0
  255. package/dist/components/text/engine/looks/index.d.ts +2 -0
  256. package/dist/components/text/engine/looks/index.d.ts.map +1 -0
  257. package/dist/components/text/engine/looks/index.js +48 -0
  258. package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
  259. package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
  260. package/dist/components/text/engine/looks/inkBleed.js +590 -0
  261. package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
  262. package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
  263. package/dist/components/text/engine/looks/lightPainting.js +567 -0
  264. package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
  265. package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
  266. package/dist/components/text/engine/looks/liquidMetal.js +655 -0
  267. package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
  268. package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
  269. package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
  270. package/dist/components/text/engine/methods.d.ts +19 -0
  271. package/dist/components/text/engine/methods.d.ts.map +1 -0
  272. package/dist/components/text/engine/methods.js +126 -0
  273. package/dist/components/text/engine/playback.d.ts +40 -0
  274. package/dist/components/text/engine/playback.d.ts.map +1 -0
  275. package/dist/components/text/engine/playback.js +114 -0
  276. package/dist/components/text/engine/ribbon.d.ts +58 -0
  277. package/dist/components/text/engine/ribbon.d.ts.map +1 -0
  278. package/dist/components/text/engine/ribbon.js +250 -0
  279. package/dist/components/text/engine/variants.d.ts +159 -0
  280. package/dist/components/text/engine/variants.d.ts.map +1 -0
  281. package/dist/components/text/engine/variants.js +378 -0
  282. package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
  283. package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
  284. package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
  285. package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
  286. package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
  287. package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
  288. package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
  289. package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
  290. package/dist/components/text/fonts/caveat.outline.js +4 -0
  291. package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
  292. package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
  293. package/dist/components/text/fonts/caveat.strokes.js +4 -0
  294. package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
  295. package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
  296. package/dist/components/text/fonts/courgette.outline.js +4 -0
  297. package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
  298. package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
  299. package/dist/components/text/fonts/courgette.strokes.js +4 -0
  300. package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
  301. package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
  302. package/dist/components/text/fonts/dancing-script.outline.js +4 -0
  303. package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
  304. package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
  305. package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
  306. package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
  307. package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
  308. package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
  309. package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
  310. package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
  311. package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
  312. package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
  313. package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
  314. package/dist/components/text/fonts/handlee.outline.js +4 -0
  315. package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
  316. package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
  317. package/dist/components/text/fonts/handlee.strokes.js +4 -0
  318. package/dist/components/text/fonts/index.d.ts +5 -0
  319. package/dist/components/text/fonts/index.d.ts.map +1 -0
  320. package/dist/components/text/fonts/index.js +44 -0
  321. package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
  322. package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
  323. package/dist/components/text/fonts/indie-flower.outline.js +4 -0
  324. package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
  325. package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
  326. package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
  327. package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
  328. package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
  329. package/dist/components/text/fonts/kalam.outline.js +4 -0
  330. package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
  331. package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
  332. package/dist/components/text/fonts/kalam.strokes.js +4 -0
  333. package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
  334. package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
  335. package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
  336. package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
  337. package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
  338. package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
  339. package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
  340. package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
  341. package/dist/components/text/fonts/mynerve.outline.js +4 -0
  342. package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
  343. package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
  344. package/dist/components/text/fonts/mynerve.strokes.js +4 -0
  345. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
  346. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
  347. package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
  348. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
  349. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
  350. package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
  351. package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
  352. package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
  353. package/dist/components/text/fonts/pacifico.outline.js +4 -0
  354. package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
  355. package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
  356. package/dist/components/text/fonts/pacifico.strokes.js +4 -0
  357. package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
  358. package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
  359. package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
  360. package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
  361. package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
  362. package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
  363. package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
  364. package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
  365. package/dist/components/text/fonts/poppins.outline.js +4 -0
  366. package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
  367. package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
  368. package/dist/components/text/fonts/poppins.strokes.js +4 -0
  369. package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
  370. package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
  371. package/dist/components/text/fonts/satisfy.outline.js +4 -0
  372. package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
  373. package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
  374. package/dist/components/text/fonts/satisfy.strokes.js +4 -0
  375. package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
  376. package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
  377. package/dist/components/text/fonts/sriracha.outline.js +4 -0
  378. package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
  379. package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
  380. package/dist/components/text/fonts/sriracha.strokes.js +4 -0
  381. package/dist/components/text/index.d.ts +27 -0
  382. package/dist/components/text/index.d.ts.map +1 -0
  383. package/dist/components/text/index.js +13 -0
  384. package/dist/components/text/useTextObject.d.ts +21 -0
  385. package/dist/components/text/useTextObject.d.ts.map +1 -0
  386. package/dist/components/text/useTextObject.js +118 -0
  387. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  388. package/dist/components/water/OceanSurface.js +3 -1
  389. package/dist/components/water/WaterBody.d.ts.map +1 -1
  390. package/dist/components/water/WaterBody.js +3 -1
  391. package/dist/components/water/types.d.ts +5 -1
  392. package/dist/components/water/types.d.ts.map +1 -1
  393. package/dist/constants.d.ts.map +1 -1
  394. package/dist/constants.js +4 -0
  395. package/dist/hooks/index.d.ts +2 -0
  396. package/dist/hooks/index.d.ts.map +1 -1
  397. package/dist/hooks/index.js +1 -0
  398. package/dist/hooks/useCloudSun.d.ts +9 -4
  399. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  400. package/dist/hooks/useCloudSun.js +17 -7
  401. package/dist/hooks/useConfigLive.d.ts +3 -2
  402. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  403. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  404. package/dist/hooks/useContinuousEffects.js +4 -10
  405. package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
  406. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
  407. package/dist/hooks/useEnvironmentProbe.js +47 -8
  408. package/dist/hooks/useGridSurface.d.ts +3 -10
  409. package/dist/hooks/useGridSurface.d.ts.map +1 -1
  410. package/dist/hooks/useGridSurface.js +5 -31
  411. package/dist/hooks/useInteraction.d.ts.map +1 -1
  412. package/dist/hooks/useInteraction.js +19 -72
  413. package/dist/hooks/useLightConfig.d.ts +2 -1
  414. package/dist/hooks/useLightConfig.d.ts.map +1 -1
  415. package/dist/hooks/useOceanMaterial.d.ts +6 -2
  416. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  417. package/dist/hooks/useOceanMaterial.js +37 -2
  418. package/dist/hooks/useSkyLive.d.ts +23 -0
  419. package/dist/hooks/useSkyLive.d.ts.map +1 -0
  420. package/dist/hooks/useSkyLive.js +30 -0
  421. package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
  422. package/dist/hooks/useSkyUniforms.js +2 -10
  423. package/dist/hooks/useTerrainLive.d.ts +3 -1
  424. package/dist/hooks/useTerrainLive.d.ts.map +1 -1
  425. package/dist/hooks/useTerrainTextures.d.ts +38 -0
  426. package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
  427. package/dist/hooks/useTerrainTextures.js +149 -0
  428. package/dist/index.d.ts +11 -2
  429. package/dist/index.d.ts.map +1 -1
  430. package/dist/index.js +8 -1
  431. package/dist/operations/catalogue/blastOff.d.ts +3 -0
  432. package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
  433. package/dist/operations/catalogue/blastOff.js +118 -0
  434. package/dist/operations/catalogue/bounce.d.ts +3 -0
  435. package/dist/operations/catalogue/bounce.d.ts.map +1 -0
  436. package/dist/operations/catalogue/bounce.js +34 -0
  437. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
  438. package/dist/operations/catalogue/curlSmoke.js +3 -1
  439. package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
  440. package/dist/operations/catalogue/dissolve.js +2 -1
  441. package/dist/operations/catalogue/driftUp.d.ts +3 -0
  442. package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
  443. package/dist/operations/catalogue/driftUp.js +57 -0
  444. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
  445. package/dist/operations/catalogue/emberAsh.js +2 -1
  446. package/dist/operations/catalogue/flip.d.ts.map +1 -1
  447. package/dist/operations/catalogue/flip.js +19 -9
  448. package/dist/operations/catalogue/float.d.ts +3 -0
  449. package/dist/operations/catalogue/float.d.ts.map +1 -0
  450. package/dist/operations/catalogue/float.js +39 -0
  451. package/dist/operations/catalogue/flyBy.d.ts +3 -0
  452. package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
  453. package/dist/operations/catalogue/flyBy.js +79 -0
  454. package/dist/operations/catalogue/frost.d.ts.map +1 -1
  455. package/dist/operations/catalogue/frost.js +10 -3
  456. package/dist/operations/catalogue/grow.d.ts +3 -0
  457. package/dist/operations/catalogue/grow.d.ts.map +1 -0
  458. package/dist/operations/catalogue/grow.js +19 -0
  459. package/dist/operations/catalogue/hologram.d.ts.map +1 -1
  460. package/dist/operations/catalogue/hologram.js +11 -5
  461. package/dist/operations/catalogue/jelly.d.ts.map +1 -1
  462. package/dist/operations/catalogue/jelly.js +18 -8
  463. package/dist/operations/catalogue/knockAway.d.ts +3 -0
  464. package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
  465. package/dist/operations/catalogue/knockAway.js +74 -0
  466. package/dist/operations/catalogue/leafFall.d.ts +3 -0
  467. package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
  468. package/dist/operations/catalogue/leafFall.js +74 -0
  469. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
  470. package/dist/operations/catalogue/lidarScan.js +4 -1
  471. package/dist/operations/catalogue/metalize.d.ts.map +1 -1
  472. package/dist/operations/catalogue/metalize.js +8 -2
  473. package/dist/operations/catalogue/motionTrail.d.ts +6 -0
  474. package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
  475. package/dist/operations/catalogue/motionTrail.js +221 -0
  476. package/dist/operations/catalogue/petrify.d.ts.map +1 -1
  477. package/dist/operations/catalogue/petrify.js +9 -3
  478. package/dist/operations/catalogue/physicalExit.d.ts +55 -0
  479. package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
  480. package/dist/operations/catalogue/physicalExit.js +165 -0
  481. package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
  482. package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
  483. package/dist/operations/catalogue/physicalHeld.js +78 -0
  484. package/dist/operations/catalogue/physicalMix.d.ts +45 -0
  485. package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
  486. package/dist/operations/catalogue/physicalMix.js +144 -0
  487. package/dist/operations/catalogue/pop.d.ts +3 -0
  488. package/dist/operations/catalogue/pop.d.ts.map +1 -0
  489. package/dist/operations/catalogue/pop.js +44 -0
  490. package/dist/operations/catalogue/print3d.d.ts.map +1 -1
  491. package/dist/operations/catalogue/print3d.js +5 -1
  492. package/dist/operations/catalogue/pulse.d.ts +3 -0
  493. package/dist/operations/catalogue/pulse.d.ts.map +1 -0
  494. package/dist/operations/catalogue/pulse.js +29 -0
  495. package/dist/operations/catalogue/restPose.d.ts +5 -7
  496. package/dist/operations/catalogue/restPose.d.ts.map +1 -1
  497. package/dist/operations/catalogue/restPose.js +18 -48
  498. package/dist/operations/catalogue/rotate.d.ts +3 -0
  499. package/dist/operations/catalogue/rotate.d.ts.map +1 -0
  500. package/dist/operations/catalogue/rotate.js +49 -0
  501. package/dist/operations/catalogue/shake.d.ts +3 -0
  502. package/dist/operations/catalogue/shake.d.ts.map +1 -0
  503. package/dist/operations/catalogue/shake.js +31 -0
  504. package/dist/operations/catalogue/shatter.d.ts.map +1 -1
  505. package/dist/operations/catalogue/shatter.js +5 -1
  506. package/dist/operations/catalogue/slam.d.ts +3 -0
  507. package/dist/operations/catalogue/slam.d.ts.map +1 -0
  508. package/dist/operations/catalogue/slam.js +89 -0
  509. package/dist/operations/catalogue/slingshot.d.ts +3 -0
  510. package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
  511. package/dist/operations/catalogue/slingshot.js +88 -0
  512. package/dist/operations/catalogue/spin.d.ts.map +1 -1
  513. package/dist/operations/catalogue/spin.js +24 -13
  514. package/dist/operations/catalogue/sway.d.ts +3 -0
  515. package/dist/operations/catalogue/sway.d.ts.map +1 -0
  516. package/dist/operations/catalogue/sway.js +23 -0
  517. package/dist/operations/catalogue/swirl.d.ts.map +1 -1
  518. package/dist/operations/catalogue/swirl.js +6 -5
  519. package/dist/operations/catalogue/trailCore.d.ts +89 -0
  520. package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
  521. package/dist/operations/catalogue/trailCore.js +190 -0
  522. package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
  523. package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
  524. package/dist/operations/catalogue/trailGhosts.js +179 -0
  525. package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
  526. package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
  527. package/dist/operations/catalogue/trailStampStyles.js +479 -0
  528. package/dist/operations/catalogue/trailStamps.d.ts +57 -0
  529. package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
  530. package/dist/operations/catalogue/trailStamps.js +349 -0
  531. package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
  532. package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
  533. package/dist/operations/catalogue/trailStreaks.js +147 -0
  534. package/dist/operations/catalogue/transitionField.d.ts +30 -0
  535. package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
  536. package/dist/operations/catalogue/transitionField.js +21 -0
  537. package/dist/operations/catalogue/turnAway.d.ts +3 -0
  538. package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
  539. package/dist/operations/catalogue/turnAway.js +54 -0
  540. package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
  541. package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
  542. package/dist/operations/catalogue/vortexDrain.js +68 -0
  543. package/dist/operations/catalogue/warp.d.ts +3 -0
  544. package/dist/operations/catalogue/warp.d.ts.map +1 -0
  545. package/dist/operations/catalogue/warp.js +73 -0
  546. package/dist/operations/catalogue/whoosh.d.ts +3 -0
  547. package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
  548. package/dist/operations/catalogue/whoosh.js +84 -0
  549. package/dist/operations/catalogue/wobble.d.ts +3 -0
  550. package/dist/operations/catalogue/wobble.d.ts.map +1 -0
  551. package/dist/operations/catalogue/wobble.js +23 -0
  552. package/dist/operations/clipPreview.d.ts +3 -0
  553. package/dist/operations/clipPreview.d.ts.map +1 -0
  554. package/dist/operations/clipPreview.js +20 -0
  555. package/dist/operations/groupFanout.d.ts +96 -0
  556. package/dist/operations/groupFanout.d.ts.map +1 -0
  557. package/dist/operations/groupFanout.js +365 -0
  558. package/dist/operations/groups.d.ts +20 -0
  559. package/dist/operations/groups.d.ts.map +1 -0
  560. package/dist/operations/groups.js +66 -0
  561. package/dist/operations/index.d.ts +5 -2
  562. package/dist/operations/index.d.ts.map +1 -1
  563. package/dist/operations/index.js +5 -2
  564. package/dist/operations/objectEffects.d.ts +161 -6
  565. package/dist/operations/objectEffects.d.ts.map +1 -1
  566. package/dist/operations/objectEffects.js +1091 -17
  567. package/dist/operations/registry.d.ts.map +1 -1
  568. package/dist/operations/registry.js +24 -2
  569. package/dist/operations/runtime.d.ts +57 -2
  570. package/dist/operations/runtime.d.ts.map +1 -1
  571. package/dist/operations/runtime.js +161 -18
  572. package/dist/operations/types.d.ts +60 -3
  573. package/dist/operations/types.d.ts.map +1 -1
  574. package/dist/operations/types.js +5 -1
  575. package/dist/operations/useObjectEffectLayers.d.ts +2 -2
  576. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
  577. package/dist/operations/useObjectEffectLayers.js +31 -10
  578. package/dist/operations/usePresentedVisibility.d.ts +10 -0
  579. package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
  580. package/dist/operations/usePresentedVisibility.js +53 -0
  581. package/dist/presets/terrainBiomes.d.ts +67 -0
  582. package/dist/presets/terrainBiomes.d.ts.map +1 -0
  583. package/dist/presets/terrainBiomes.js +294 -0
  584. package/dist/presets/terrainPresets.d.ts +6 -0
  585. package/dist/presets/terrainPresets.d.ts.map +1 -1
  586. package/dist/presets/terrainPresets.js +26 -38
  587. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  588. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  589. package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
  590. package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
  591. package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
  592. package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
  593. package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
  594. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
  595. package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
  596. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
  597. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  598. package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
  599. package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
  600. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  601. package/dist/shaders/terrain/TerrainMaterial.js +107 -8
  602. package/dist/triggers/engine.d.ts +44 -0
  603. package/dist/triggers/engine.d.ts.map +1 -0
  604. package/dist/triggers/engine.js +165 -0
  605. package/dist/triggers/hosts/actions.d.ts +8 -0
  606. package/dist/triggers/hosts/actions.d.ts.map +1 -0
  607. package/dist/triggers/hosts/actions.js +22 -0
  608. package/dist/triggers/hosts/interactions.d.ts +6 -0
  609. package/dist/triggers/hosts/interactions.d.ts.map +1 -0
  610. package/dist/triggers/hosts/interactions.js +4 -0
  611. package/dist/triggers/hosts/timelineCues.d.ts +2 -0
  612. package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
  613. package/dist/triggers/hosts/timelineCues.js +22 -0
  614. package/dist/triggers/index.d.ts +13 -0
  615. package/dist/triggers/index.d.ts.map +1 -0
  616. package/dist/triggers/index.js +9 -0
  617. package/dist/triggers/kinds/action.d.ts +2 -0
  618. package/dist/triggers/kinds/action.d.ts.map +1 -0
  619. package/dist/triggers/kinds/action.js +31 -0
  620. package/dist/triggers/kinds/animations.d.ts +2 -0
  621. package/dist/triggers/kinds/animations.d.ts.map +1 -0
  622. package/dist/triggers/kinds/animations.js +75 -0
  623. package/dist/triggers/kinds/effects.d.ts +2 -0
  624. package/dist/triggers/kinds/effects.d.ts.map +1 -0
  625. package/dist/triggers/kinds/effects.js +27 -0
  626. package/dist/triggers/kinds/index.d.ts +4 -0
  627. package/dist/triggers/kinds/index.d.ts.map +1 -0
  628. package/dist/triggers/kinds/index.js +4 -0
  629. package/dist/triggers/log.d.ts +21 -0
  630. package/dist/triggers/log.d.ts.map +1 -0
  631. package/dist/triggers/log.js +43 -0
  632. package/dist/triggers/readiness.d.ts +40 -0
  633. package/dist/triggers/readiness.d.ts.map +1 -0
  634. package/dist/triggers/readiness.js +158 -0
  635. package/dist/triggers/registry.d.ts +41 -0
  636. package/dist/triggers/registry.d.ts.map +1 -0
  637. package/dist/triggers/registry.js +7 -0
  638. package/dist/types/gridConfigs.d.ts +18 -23
  639. package/dist/types/gridConfigs.d.ts.map +1 -1
  640. package/dist/ui/UiAnchorUpdater.d.ts +10 -0
  641. package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
  642. package/dist/ui/UiAnchorUpdater.js +111 -0
  643. package/dist/ui/UiLayers.d.ts +20 -0
  644. package/dist/ui/UiLayers.d.ts.map +1 -0
  645. package/dist/ui/UiLayers.js +57 -0
  646. package/dist/ui/index.d.ts +9 -0
  647. package/dist/ui/index.d.ts.map +1 -0
  648. package/dist/ui/index.js +6 -0
  649. package/dist/ui/uiAnchors.d.ts +21 -0
  650. package/dist/ui/uiAnchors.d.ts.map +1 -0
  651. package/dist/ui/uiAnchors.js +22 -0
  652. package/dist/ui/uiBaseStyles.d.ts +2 -0
  653. package/dist/ui/uiBaseStyles.d.ts.map +1 -0
  654. package/dist/ui/uiBaseStyles.js +100 -0
  655. package/dist/ui/uiBinder.d.ts +30 -0
  656. package/dist/ui/uiBinder.d.ts.map +1 -0
  657. package/dist/ui/uiBinder.js +344 -0
  658. package/dist/utils/configAnimations.d.ts.map +1 -1
  659. package/dist/utils/configAnimations.js +5 -1
  660. package/dist/utils/gridConfig.d.ts +1 -1
  661. package/dist/utils/gridConfig.d.ts.map +1 -1
  662. package/dist/utils/gridConfig.js +1 -1
  663. package/dist/utils/landPatch.d.ts +33 -0
  664. package/dist/utils/landPatch.d.ts.map +1 -0
  665. package/dist/utils/landPatch.js +114 -0
  666. package/dist/utils/renderedSky.d.ts +32 -0
  667. package/dist/utils/renderedSky.d.ts.map +1 -0
  668. package/dist/utils/renderedSky.js +57 -0
  669. package/dist/utils/skyMoon.d.ts +35 -0
  670. package/dist/utils/skyMoon.d.ts.map +1 -0
  671. package/dist/utils/skyMoon.js +41 -0
  672. package/dist/utils/terrainHeight.d.ts +4 -0
  673. package/dist/utils/terrainHeight.d.ts.map +1 -0
  674. package/dist/utils/terrainHeight.js +150 -0
  675. package/dist/utils/terrainTextureResolver.d.ts +18 -0
  676. package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
  677. package/dist/utils/terrainTextureResolver.js +17 -0
  678. package/dist/utils/terrainUniforms.d.ts +17 -0
  679. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  680. package/dist/utils/terrainUniforms.js +84 -0
  681. package/dist/utils/textureArrays.d.ts +29 -0
  682. package/dist/utils/textureArrays.d.ts.map +1 -0
  683. package/dist/utils/textureArrays.js +140 -0
  684. package/package.json +2 -2
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AnimationOptions, MouseMoveDomain, SnowEnvironmentConfig } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ export interface SnowProps extends ObjectReadyProps {
5
+ config: SnowEnvironmentConfig;
6
+ /** Scene object id: the live-edit handle is found by it. */
7
+ id?: string;
8
+ /** Keyframes on the config knobs (animations.environment.animations). */
9
+ keyframes?: AnimationOptions[];
10
+ /** Pointer bindings on the config knobs (mouseMove.environment). */
11
+ mouseMove?: MouseMoveDomain;
12
+ }
13
+ /**
14
+ * Snowfall with physical flakes: size-dependent terminal fall, helical flutter and tumbling dendrite crystals that glint in the sun, swept by travelling gusts and snow bands. The cursor is a gust, a shelter or a warm hand. Use for winter and weather scenes.
15
+ *
16
+ * The volume is the parent's transform: x / z span its scale, y rises from its origin to scale.y.
17
+ */
18
+ declare const Snow: React.FC<SnowProps>;
19
+ export default Snow;
20
+ //# sourceMappingURL=Snow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Snow.d.ts","sourceRoot":"","sources":["../../../src/components/environment/Snow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAMtG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAgjBhE,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,oEAAoE;IACpE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAmC7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,609 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
3
+ import * as THREE from 'three';
4
+ import { useFrame } from '@react-three/fiber';
5
+ import { DEFAULT_ENVIRONMENT_OBJECTS, ENVIRONMENT_OBJECTS_ANIMATABLE } from '@3driseai/3drise-core';
6
+ import { withConfigDefaults } from '../../utils/configAnimations.js';
7
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
8
+ import { useConfigDriver } from '../../hooks/useConfigDriver.js';
9
+ import { useCloudSun } from '../../hooks/useCloudSun.js';
10
+ import { stepPointerField, usePointerField } from '../../utils/pointerField.js';
11
+ // Generated from Claude outputs/environment-lab/snow.mjs (the approved lab module) — edit there and regenerate.
12
+ // Snow — environment object (lab module).
13
+ // Construction: every flake is an analytic trajectory evaluated on the GPU from a per-flake seed.
14
+ // fall y = y0 - v(d) * fallPhase terminal velocity grows with flake size (v ~ 0.8..1.4 m/s)
15
+ // wind xz += windOffset * drift windOffset is integrated on the CPU (rate knobs never jump)
16
+ // gusts a value-noise field travelling downwind at wind speed: it shoves flakes ahead and
17
+ // thickens the snowfall into sweeping curtains (snow bands) — one field, two readings
18
+ // flutter helical side-slip of a falling plate (radius ~ 25 cm, 1..2.6 rad/s per flake)
19
+ // eddies an ABC (Arnold–Beltrami–Childress) displacement: vx(y,z), vy(z,x), vz(x,y) -> divergence free
20
+ // tumble the plate normal oscillates about vertical; the sprite is the plate's projected ellipse
21
+ // Positions wrap with mod() inside their tile, faded at the tile and volume faces: nothing pops.
22
+ // Optics: sky fill tinted by shadeColor + sun (two-sided plate diffuse + Henyey–Greenstein forward
23
+ // lobe, g = 0.6) + specular glints when a tumbling plate's normal crosses the sun half-vector.
24
+ // Two layers: near crystals (instanced dendrite quads in a camera-centred tile) and the far fall
25
+ // (round specks filling the whole volume). Two draw calls.
26
+ // Cost: the fall is fill-bound, not vertex-bound. Each far speck is drawn only out to the radius where
27
+ // it is still above the alpha cut (and not at all when it never is), and is lit once in the vertex
28
+ // stage; the near layer is skipped when the camera is too far from the volume to see a crystal.
29
+ const catalog = {
30
+ key: 'snow',
31
+ name: 'Snow',
32
+ description: 'Snowfall with physical flakes: size-dependent terminal fall, helical flutter and tumbling dendrite crystals that glint in the sun, swept by travelling gusts and snow bands. The cursor is a gust, a shelter or a warm hand. Use for winter and weather scenes.',
33
+ tags: ['snow', 'weather', 'winter', 'snowfall', 'atmosphere', 'interactive'],
34
+ structural: ['density', 'quality', 'seed'],
35
+ pointerModes: ['gust', 'shelter', 'warmth'],
36
+ pointerLabels: { none: 'Off', gust: 'Gust', shelter: 'Shelter', warmth: 'Warmth' },
37
+ };
38
+ const QUALITY = { low: 0.5, medium: 1, high: 1.6 };
39
+ const NEAR_BASE = 40000;
40
+ const FAR_BASE = 60000;
41
+ const NEAR_MAX = 90000;
42
+ const FAR_MAX = 150000;
43
+ const NEAR_TILE = 16;
44
+ const WIND_MS = 8; // m/s per unit of windStrength (Rain's 0..1 range)
45
+ const DEG = Math.PI / 180;
46
+ function mulberry32(a) {
47
+ return function () {
48
+ a |= 0;
49
+ a = (a + 0x6d2b79f5) | 0;
50
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
51
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
52
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
53
+ };
54
+ }
55
+ function createUniforms() {
56
+ return {
57
+ uTime: { value: 0 },
58
+ uFall: { value: 0 },
59
+ uWind: { value: new THREE.Vector2() },
60
+ uWindDir: { value: new THREE.Vector2(0, 1) },
61
+ uGustPhase: { value: 0 },
62
+ uTurbPhase: { value: 0 },
63
+ uVolume: { value: new THREE.Vector3(100, 40, 100) },
64
+ uCam: { value: new THREE.Vector3() },
65
+ uTile: { value: NEAR_TILE },
66
+ uFollow: { value: 0 },
67
+ uViewH: { value: 800 },
68
+ uFarGain: { value: 20 },
69
+ uIntensity: { value: 1 },
70
+ uOpacity: { value: 0.9 },
71
+ uColor: { value: new THREE.Color('#f4f8ff') },
72
+ uShadeColor: { value: new THREE.Color('#a9bddc') },
73
+ uWindStrength: { value: 0.18 },
74
+ uTurb: { value: 0.25 },
75
+ uFlakeSize: { value: 0.045 },
76
+ uFlutter: { value: 0.6 },
77
+ uTumble: { value: 0.5 },
78
+ uGustiness: { value: 0.6 },
79
+ uBands: { value: 0.75 },
80
+ uGlint: { value: 0.8 },
81
+ uSpeed: { value: 1 },
82
+ uSunDir: { value: new THREE.Vector3(0.35, 0.42, 0.84).normalize() },
83
+ uSunColor: { value: new THREE.Color(1.0, 0.93, 0.82) },
84
+ uSkyAmbient: { value: new THREE.Color(0.55, 0.65, 0.85) },
85
+ uPointer: { value: new THREE.Vector3() },
86
+ uPointerVel: { value: new THREE.Vector3() },
87
+ uPointerActive: { value: 0 },
88
+ uPointerMode: { value: 0 },
89
+ uPointerStrength: { value: 1 },
90
+ uPointerRadius: { value: 1 },
91
+ uPointerColor: { value: new THREE.Color('#ffb070') },
92
+ };
93
+ }
94
+ function setColor(uniform, v) {
95
+ if (v === undefined || v === null)
96
+ return;
97
+ if (v.isColor)
98
+ uniform.value.copy(v);
99
+ else
100
+ uniform.value.set(v);
101
+ }
102
+ // The one push point: every per-frame knob lands here.
103
+ function applyConfig(u, c) {
104
+ if (c.intensity !== undefined)
105
+ u.uIntensity.value = c.intensity;
106
+ if (c.speed !== undefined)
107
+ u.uSpeed.value = c.speed;
108
+ if (c.opacity !== undefined)
109
+ u.uOpacity.value = c.opacity;
110
+ setColor(u.uColor, c.color);
111
+ setColor(u.uShadeColor, c.shadeColor);
112
+ setColor(u.uPointerColor, c.pointerColor);
113
+ if (c.windStrength !== undefined)
114
+ u.uWindStrength.value = c.windStrength;
115
+ if (c.windDirection !== undefined)
116
+ u.uWindDir.value.set(Math.sin(c.windDirection * DEG), Math.cos(c.windDirection * DEG));
117
+ if (c.turbulence !== undefined)
118
+ u.uTurb.value = c.turbulence;
119
+ if (c.flakeSize !== undefined)
120
+ u.uFlakeSize.value = c.flakeSize;
121
+ if (c.flutter !== undefined)
122
+ u.uFlutter.value = c.flutter;
123
+ if (c.tumble !== undefined)
124
+ u.uTumble.value = c.tumble;
125
+ if (c.gustiness !== undefined)
126
+ u.uGustiness.value = c.gustiness;
127
+ if (c.bands !== undefined)
128
+ u.uBands.value = c.bands;
129
+ if (c.glint !== undefined)
130
+ u.uGlint.value = c.glint;
131
+ if (c.pointerStrength !== undefined)
132
+ u.uPointerStrength.value = c.pointerStrength;
133
+ if (c.pointerRadius !== undefined)
134
+ u.uPointerRadius.value = c.pointerRadius;
135
+ if (c.pointerMode !== undefined)
136
+ u.uPointerMode.value = catalog.pointerModes.indexOf(c.pointerMode);
137
+ if (c.followCamera !== undefined)
138
+ u.uFollow.value = c.followCamera ? 1 : 0;
139
+ }
140
+ const COMMON = /* glsl */ `
141
+ uniform float uTime, uFall, uGustPhase, uTurbPhase, uTile, uFollow, uViewH, uFarGain;
142
+ uniform vec2 uWind, uWindDir;
143
+ uniform vec3 uVolume, uCam;
144
+ uniform float uWindStrength, uTurb, uFlakeSize, uFlutter, uTumble, uGustiness, uBands;
145
+ uniform vec3 uPointer, uPointerVel;
146
+ uniform float uPointerActive, uPointerMode, uPointerStrength, uPointerRadius;
147
+
148
+ float hash21(vec2 p) { p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); }
149
+ float vnoise(vec2 p) {
150
+ vec2 i = floor(p); vec2 f = fract(p); f = f * f * (3.0 - 2.0 * f);
151
+ float a = hash21(i), b = hash21(i + vec2(1.0, 0.0)), c = hash21(i + vec2(0.0, 1.0)), d = hash21(i + vec2(1.0, 1.0));
152
+ return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
153
+ }
154
+ // Gust field (0..1): long waves across the wind, travelling downwind at the wind's own speed.
155
+ float gustField(vec2 xz) {
156
+ vec2 pe = vec2(-uWindDir.y, uWindDir.x);
157
+ float a = dot(xz, uWindDir) / 26.0 - uGustPhase;
158
+ float b = dot(xz, pe) / 44.0;
159
+ return vnoise(vec2(a, b)) * 0.65 + vnoise(vec2(a * 2.1 + 3.7, b * 1.7 - 1.3)) * 0.35;
160
+ }
161
+ float bump(float x) { float t = clamp(1.0 - x * x, 0.0, 1.0); return t * t; }
162
+
163
+ // Where a flake is now (object-local metres) and what it is doing.
164
+ vec3 snowPos(vec3 s, float hs, vec4 sb, vec3 origin, vec3 span,
165
+ out float d, out float melt, out float shade, out float band) {
166
+ d = uFlakeSize * mix(0.55, 1.45, hs * hs);
167
+ float v = 0.8 + 0.45 * sqrt(d / max(uFlakeSize, 1e-4)); // terminal velocity, m/s at speed 1
168
+ float drift = 0.85 + 0.3 * sb.x; // lighter flakes ride the wind more
169
+ vec3 p = s * span + vec3(uWind.x * drift, -uFall * v, uWind.y * drift);
170
+ p = origin + mod(p - origin + 0.5 * span, span) - 0.5 * span;
171
+
172
+ // helical flutter of a falling plate
173
+ float om = mix(1.1, 2.6, sb.z);
174
+ float ph = sb.y * 6.2831853 + om * uTime;
175
+ p.xz += uFlutter * 0.25 * mix(0.5, 1.5, sb.x) * vec2(cos(ph), sin(ph));
176
+
177
+ // ABC eddies: each component independent of its own axis -> divergence free
178
+ vec3 q = p * 0.09; float t = uTurbPhase;
179
+ vec3 e = vec3(sin(q.y * 1.7 + t) + cos(q.z * 1.3 - t * 0.7),
180
+ sin(q.z * 1.1 + t * 0.8) + cos(q.x * 1.9 + t * 0.5),
181
+ sin(q.x * 1.5 - t * 1.1) + cos(q.y * 1.4 + t * 0.6));
182
+ p += uTurb * 1.6 * e;
183
+
184
+ // gusts push flakes downwind and gather them into bands
185
+ float g = gustField(p.xz);
186
+ p.xz += uWindDir * uGustiness * (0.4 + 2.0 * uWindStrength) * 6.0 * (g - 0.5);
187
+ p.y += uGustiness * 0.6 * (g - 0.5);
188
+ band = mix(1.0, 0.05 + 1.9 * smoothstep(0.38, 0.68, g), uBands);
189
+
190
+ melt = 0.0; shade = 1.0;
191
+ if (uPointerMode > -0.5 && uPointerActive > 0.001) {
192
+ vec3 P = uPointer * uVolume;
193
+ vec3 V = uPointerVel * uVolume;
194
+ float R = max(uPointerRadius * 2.0, 0.1);
195
+ float S = uPointerStrength * uPointerActive;
196
+ if (uPointerMode < 0.5) {
197
+ // gust: the hand's own air puff, along its velocity, relaxing when it stops
198
+ vec3 dp = p - P;
199
+ float w = bump(length(dp.xz) / R) * bump(dp.y / (R * 1.5));
200
+ vec3 push = V * 0.7; float m = length(push); if (m > 8.0) push *= 8.0 / m;
201
+ // the wake curls: a swirl about the axis across the motion, strongest behind the hand
202
+ vec3 ax = m > 1e-3 ? normalize(cross(push, vec3(0.0, 1.0, 0.0)) + vec3(0.0, 1e-4, 0.0)) : vec3(0.0);
203
+ vec3 sw = cross(ax, dp) * smoothstep(0.0, -R, dot(dp, push) / max(m, 1e-3)) * min(m, 4.0) * 0.35;
204
+ p += S * w * (push + sw + vec3(0.0, 0.08 * m, 0.0));
205
+ } else if (uPointerMode < 1.5) {
206
+ // shelter: an invisible canopy over the cursor; flakes slide off its rim, a dry column below
207
+ vec3 C = P - V * 0.2;
208
+ vec2 dxz = p.xz - C.xz; float r = length(dxz);
209
+ float below = smoothstep(C.y + 0.6, C.y - 0.8, p.y);
210
+ float w = bump(r / (R * 1.15)) * below;
211
+ p.xz += S * w * R * 0.9 * (r > 1e-3 ? dxz / r : vec2(1.0, 0.0));
212
+ shade = 1.0 - 0.45 * w * min(S, 1.0);
213
+ } else {
214
+ // warmth: a heat source melts flakes into droplets; the plume holds them up and leans with motion
215
+ vec3 C = P - V * 0.15;
216
+ float dy = p.y - C.y;
217
+ float r = length(p.xz - C.xz);
218
+ float w = bump(r / (R * (1.0 + 0.2 * max(dy, 0.0)))) * smoothstep(-0.7 * R, 0.0, dy) * bump(max(dy, 0.0) / (R * 1.6));
219
+ melt = smoothstep(0.25, 0.75, w * S);
220
+ p.y += melt * 0.6;
221
+ }
222
+ }
223
+ return p;
224
+ }
225
+
226
+ float volumeFade(vec3 p) {
227
+ float top = min(6.0, 0.15 * uVolume.y);
228
+ float a = smoothstep(0.0, 0.6, p.y) * (1.0 - smoothstep(uVolume.y - top, uVolume.y, p.y));
229
+ if (uFollow < 0.5) {
230
+ vec2 fx = min(vec2(8.0), 0.08 * uVolume.xz);
231
+ vec2 edge = 0.5 * uVolume.xz - abs(p.xz);
232
+ a *= smoothstep(0.0, fx.x, edge.x) * smoothstep(0.0, fx.y, edge.y);
233
+ }
234
+ return a;
235
+ }
236
+ `;
237
+ const FOG_V = /* glsl */ `
238
+ #ifdef USE_FOG
239
+ varying float vFogDepth;
240
+ #endif
241
+ `;
242
+ const FOG_F = /* glsl */ `
243
+ #ifdef USE_FOG
244
+ uniform vec3 fogColor;
245
+ varying float vFogDepth;
246
+ #ifdef FOG_EXP2
247
+ uniform float fogDensity;
248
+ #else
249
+ uniform float fogNear;
250
+ uniform float fogFar;
251
+ #endif
252
+ #endif
253
+ `;
254
+ const FOG_APPLY = /* glsl */ `
255
+ #ifdef USE_FOG
256
+ #ifdef FOG_EXP2
257
+ float fogFactor = 1.0 - exp(-fogDensity * fogDensity * vFogDepth * vFogDepth);
258
+ #else
259
+ float fogFactor = smoothstep(fogNear, fogFar, vFogDepth);
260
+ #endif
261
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor * gl_FragColor.a, fogFactor);
262
+ #endif
263
+ `;
264
+ const LIGHT = /* glsl */ `
265
+ uniform vec3 uSunDir;
266
+ uniform vec3 uSunColor, uSkyAmbient, uColor, uShadeColor, uPointerColor;
267
+ uniform float uIntensity, uOpacity, uGlint;
268
+ // sky fill + sun: two-sided plate diffuse and a Henyey–Greenstein forward lobe (g = 0.6)
269
+ vec3 snowLight(vec3 toCam, vec3 n, float shade) {
270
+ vec3 V = normalize(toCam);
271
+ float mu = dot(-V, uSunDir);
272
+ const float g = 0.6;
273
+ float hg = 0.25 * (1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * mu, 1.5);
274
+ float sunUp = smoothstep(-0.05, 0.12, uSunDir.y);
275
+ float diff = 0.45 + 0.55 * abs(dot(n, uSunDir));
276
+ vec3 lit = uSkyAmbient * uShadeColor * 0.6 + uSunColor * sunUp * (0.5 * diff + 0.3 * hg) * shade;
277
+ return min(lit * uColor, vec3(1.15));
278
+ }
279
+ `;
280
+ const NEAR_VERT = /* glsl */ `
281
+ ${COMMON}
282
+ uniform float uOpacity;
283
+ attribute vec2 aCorner;
284
+ attribute vec4 aSeedA;
285
+ attribute vec4 aSeedB;
286
+ varying vec2 vUv;
287
+ varying float vAlpha, vPx, vMelt, vShade, vRot, vType, vGrow;
288
+ varying vec3 vN, vToCam;
289
+ ${FOG_V}
290
+ void main() {
291
+ float d, melt, shade, band;
292
+ vec3 p = snowPos(aSeedA.xyz, aSeedA.w, aSeedB, uCam, vec3(uTile), d, melt, shade, band);
293
+ vec3 toCam = uCam - p;
294
+ float dist = length(toCam);
295
+ // bands read at a distance; close up they only thin the fall a little
296
+ float a = volumeFade(p) * mix(1.0, band, 0.4) * (1.0 - smoothstep(0.3 * uTile, 0.48 * uTile, dist));
297
+
298
+ // plate normal: a slow azimuth and a tilt oscillation about vertical
299
+ float psi = aSeedB.y * 6.2831853 + uTime * 0.35 * (aSeedB.z - 0.5);
300
+ float th = uTumble * 1.35 * sin(uTime * mix(0.8, 2.2, aSeedB.z) + aSeedB.w * 6.2831853);
301
+ vec3 n = vec3(sin(th) * cos(psi), cos(th), sin(th) * sin(psi));
302
+
303
+ vec4 mv = modelViewMatrix * vec4(p / uVolume, 1.0);
304
+ vec3 nv = normalize(normalMatrix * n);
305
+ float fore = abs(dot(nv, normalize(mv.xyz)));
306
+ vec2 minor = length(nv.xy) > 1e-3 ? normalize(nv.xy) : vec2(0.0, 1.0);
307
+ vec2 major = vec2(minor.y, -minor.x); // (major, minor) right-handed: the quad stays front-facing
308
+
309
+ float size = d * mix(1.0, 1.25, melt);
310
+ float px = size * uViewH * projectionMatrix[1][1] * 0.5 / max(-mv.z, 1e-3);
311
+ float grow = max(1.0, 2.0 / max(px, 1e-3));
312
+ a /= grow * grow;
313
+ a *= smoothstep(0.08, 0.45, -mv.z);
314
+
315
+ vec2 off = (major * aCorner.x + minor * aCorner.y * max(fore, mix(0.22, 1.0, melt))) * size * 0.5 * grow;
316
+ mv.xy += off;
317
+ // the fragment's alpha is at most 3 * a * opacity (a melted droplet's bright point): below the
318
+ // alpha cut nothing of this crystal survives, so it is clipped away instead of rasterised
319
+ gl_Position = a * uOpacity * 3.0 < 0.003 ? vec4(2.0, 2.0, 2.0, 1.0) : projectionMatrix * mv;
320
+
321
+ vUv = aCorner; vAlpha = a; vPx = px; vMelt = melt; vShade = shade;
322
+ vRot = aSeedB.y * 6.2831853; vType = aSeedB.x; vGrow = grow;
323
+ vN = n; vToCam = toCam;
324
+ #ifdef USE_FOG
325
+ vFogDepth = -mv.z;
326
+ #endif
327
+ }
328
+ `;
329
+ const NEAR_FRAG = /* glsl */ `
330
+ ${LIGHT}
331
+ varying vec2 vUv;
332
+ varying float vAlpha, vPx, vMelt, vShade, vRot, vType, vGrow;
333
+ varying vec3 vN, vToCam;
334
+ ${FOG_F}
335
+ float lineAA(float dist, float w) { float aa = fwidth(dist) + 1e-4; return 1.0 - smoothstep(w - aa, w + aa, dist); }
336
+ void main() {
337
+ float r = length(vUv);
338
+ if (r > 1.0) discard;
339
+ // six-fold dendrite: fold into one arm, then the arm, its 60-degree side branches and a hex core
340
+ float ang = atan(vUv.y, vUv.x) + vRot;
341
+ const float SECT = 1.0471976;
342
+ float a6 = mod(ang + 0.5 * SECT, SECT) - 0.5 * SECT;
343
+ vec2 q = r * vec2(cos(a6), abs(sin(a6)));
344
+ float w = 0.055;
345
+ float arm = lineAA(q.y, w) * (1.0 - smoothstep(0.86, 0.95, q.x));
346
+ float n = mix(3.0, 6.0, vType);
347
+ float s = q.x - q.y * 0.57735;
348
+ float k = (floor(s * n) + 0.5) / n;
349
+ float db = abs(s - k) * 0.866;
350
+ float along = q.y / 0.866;
351
+ float br = lineAA(db, w * 0.8) * step(along, 0.42 * (1.0 - k)) * step(0.12, k) * step(k, 0.85);
352
+ br *= step(0.25, vType); // the least branched quarter are stellar plates
353
+ float hexR = r * cos(a6);
354
+ float core = 1.0 - smoothstep(0.16, 0.16 + fwidth(hexR) + 1e-4, hexR);
355
+ float crystal = max(max(arm, br), core * 0.85) + 0.18 * exp(-r * r * 6.0);
356
+ float disc = 0.5 * exp(-r * r * 4.5);
357
+ float shape = mix(disc, crystal, smoothstep(6.0, 16.0, vPx));
358
+ // melting: crystals round into a clear droplet with a bright point
359
+ float drop = 0.8 * exp(-r * r * 3.0) + 0.7 * exp(-dot(vUv - vec2(-0.25, 0.25), vUv - vec2(-0.25, 0.25)) * 30.0);
360
+ shape = mix(shape, drop, vMelt);
361
+
362
+ float alpha = shape * vAlpha * uOpacity * (1.0 + vMelt);
363
+ if (alpha < 0.003) discard;
364
+ vec3 lit = snowLight(vToCam, vN, vShade);
365
+ vec3 H = normalize(uSunDir + normalize(vToCam));
366
+ float sunUp = smoothstep(-0.05, 0.12, uSunDir.y);
367
+ // a glint is a point of sun-bright radiance: it survives the sub-pixel dimming that the body does not
368
+ float gl = pow(abs(dot(vN, H)), 140.0) * uGlint * 3.0 * sunUp * smoothstep(0.4, 0.9, shape) * min(vGrow * vGrow, 16.0);
369
+ vec3 col = lit + uSunColor * gl;
370
+ col = mix(col, uPointerColor * (0.9 + 0.6 * gl) + 0.1, vMelt);
371
+ col *= uIntensity;
372
+ gl_FragColor = vec4(col * alpha, alpha);
373
+ #include <tonemapping_fragment>
374
+ #include <colorspace_fragment>
375
+ ${FOG_APPLY}
376
+ }
377
+ `;
378
+ const FAR_VERT = /* glsl */ `
379
+ ${COMMON}
380
+ ${LIGHT}
381
+ attribute vec4 aSeedB;
382
+ varying float vAlpha, vTight;
383
+ varying vec3 vCol;
384
+ ${FOG_V}
385
+ void main() {
386
+ float d, melt, shade, band;
387
+ vec3 origin = vec3(uFollow > 0.5 ? uCam.x : 0.0, 0.5 * uVolume.y, uFollow > 0.5 ? uCam.z : 0.0);
388
+ vec3 s = position + vec3(0.5, 0.0, 0.5);
389
+ vec3 p = snowPos(s, aSeedB.w, aSeedB, origin, uVolume, d, melt, shade, band);
390
+ vec3 toCam = uCam - p;
391
+ float dist = length(toCam);
392
+ float a = volumeFade(p) * band * smoothstep(0.26 * uTile, 0.44 * uTile, dist);
393
+ vec4 mv = modelViewMatrix * vec4(p / uVolume, 1.0);
394
+ // far flakes are out of focus: a bokeh disc that converges to a few pixels, energy conserved,
395
+ // times the share of the real snowfall each far speck stands for
396
+ float px = d * mix(1.0, 0.5, melt) * 1.3 * uViewH * projectionMatrix[1][1] * 0.5 / max(-mv.z, 1e-3);
397
+ float coc = (3.0 + 11.0 * smoothstep(6.0, 40.0, -mv.z)) * uViewH / 900.0;
398
+ float sz = max(px, coc);
399
+ // close by, the gain is held down so the fall stays calm; far off each speck carries its
400
+ // full share and the volume reads as a veil of snowfall
401
+ float gain = mix(min(uFarGain, 5.0), uFarGain, smoothstep(35.0, 110.0, dist));
402
+ a *= min(1.0, gain * (px * px) / (sz * sz));
403
+ a *= uOpacity;
404
+ // Tight sprite. The disc is exp(-3.5 r^2) - 0.03 and the fragment drops alpha < 0.003, so a speck
405
+ // is visible only out to r^2 = -ln(0.03 + 0.003 / a) / 3.5. A faint speck's bokeh disc is mostly
406
+ // below the cut: draw the point just that large (same pixels, same values), and when even its
407
+ // centre is below the cut, do not draw it.
408
+ float cut = 0.03 + 0.003 / max(a, 1e-6);
409
+ bool seen = cut < 1.0;
410
+ // (+0.5 px: a pixel centre sitting exactly on that radius must stay inside the point's square)
411
+ float ps = seen ? min(sz * sqrt(min(-log(cut) / 3.5, 1.0)) + 0.5, sz) : 0.0;
412
+ gl_PointSize = ps;
413
+ gl_Position = seen ? projectionMatrix * mv : vec4(2.0, 2.0, 2.0, 1.0);
414
+ vAlpha = a;
415
+ vTight = ps / sz; // point coords -> the full disc's coords
416
+ // a point has one colour: light it here, once, rather than in every pixel it covers
417
+ vCol = mix(snowLight(toCam, vec3(0.0, 1.0, 0.0), shade), uPointerColor + 0.15, melt * 0.8) * uIntensity;
418
+ #ifdef USE_FOG
419
+ vFogDepth = -mv.z;
420
+ #endif
421
+ }
422
+ `;
423
+ const FAR_FRAG = /* glsl */ `
424
+ varying float vAlpha, vTight;
425
+ varying vec3 vCol;
426
+ ${FOG_F}
427
+ void main() {
428
+ vec2 uv = (gl_PointCoord * 2.0 - 1.0) * vTight;
429
+ float r2 = dot(uv, uv);
430
+ if (r2 > 1.0) discard;
431
+ float shape = exp(-r2 * 3.5) - 0.03;
432
+ float alpha = shape * vAlpha;
433
+ if (alpha < 0.003) discard;
434
+ gl_FragColor = vec4(vCol * alpha, alpha);
435
+ #include <tonemapping_fragment>
436
+ #include <colorspace_fragment>
437
+ ${FOG_APPLY}
438
+ }
439
+ `;
440
+ function makeMaterial(u, vertexShader, fragmentShader) {
441
+ return new THREE.ShaderMaterial({
442
+ // fog uniforms per material, the snow uniforms shared by reference across both layers
443
+ uniforms: Object.assign({}, THREE.UniformsUtils.clone(THREE.UniformsLib.fog), u),
444
+ vertexShader, fragmentShader,
445
+ transparent: true, depthWrite: false, fog: true,
446
+ blending: THREE.CustomBlending,
447
+ blendSrc: THREE.OneFactor, blendDst: THREE.OneMinusSrcAlphaFactor,
448
+ blendSrcAlpha: THREE.OneFactor, blendDstAlpha: THREE.OneMinusSrcAlphaFactor,
449
+ premultipliedAlpha: true,
450
+ });
451
+ }
452
+ // Bounds: every layer's `position` spans the unit volume box (x,z in -0.5..0.5, y in 0..1),
453
+ // so Box3.expandByObject centres the gizmo on the volume. Shader seeds live in their own attributes.
454
+ function build(u, c) {
455
+ const q = QUALITY[c.quality] ?? 1;
456
+ const dens = Math.max(0.05, c.density ?? 1);
457
+ const nNear = Math.min(NEAR_MAX, Math.round(NEAR_BASE * dens * q));
458
+ const nFar = Math.min(FAR_MAX, Math.round(FAR_BASE * dens * q));
459
+ const rnd = mulberry32((c.seed ?? 7) * 2654435761);
460
+ const nearGeo = new THREE.InstancedBufferGeometry();
461
+ // One triangle per crystal, circumscribing the unit disc the fragment keeps (it discards r > 1):
462
+ // the flake's whole trajectory is evaluated per vertex, so 3 vertices instead of 4 is a quarter less
463
+ // vertex work. `position` only spans the volume box for the gizmo's bounds.
464
+ nearGeo.setAttribute('position', new THREE.Float32BufferAttribute([-0.5, 0, -0.5, 0.5, 1, 0.5, 0, 0.5, 0], 3));
465
+ nearGeo.setAttribute('aCorner', new THREE.Float32BufferAttribute([-1.7320508, -1, 1.7320508, -1, 0, 2], 2));
466
+ const sa = new Float32Array(nNear * 4), sb = new Float32Array(nNear * 4);
467
+ for (let i = 0; i < nNear * 4; i++) {
468
+ sa[i] = rnd();
469
+ sb[i] = rnd();
470
+ }
471
+ nearGeo.setAttribute('aSeedA', new THREE.InstancedBufferAttribute(sa, 4));
472
+ nearGeo.setAttribute('aSeedB', new THREE.InstancedBufferAttribute(sb, 4));
473
+ nearGeo.instanceCount = nNear;
474
+ nearGeo.boundingSphere = new THREE.Sphere(new THREE.Vector3(0, 0.5, 0), 0.87);
475
+ const farGeo = new THREE.BufferGeometry();
476
+ const fp = new Float32Array(nFar * 3), fb = new Float32Array(nFar * 4);
477
+ for (let i = 0; i < nFar; i++) {
478
+ fp[i * 3] = rnd() - 0.5;
479
+ fp[i * 3 + 1] = rnd();
480
+ fp[i * 3 + 2] = rnd() - 0.5;
481
+ fb[i * 4] = rnd();
482
+ fb[i * 4 + 1] = rnd();
483
+ fb[i * 4 + 2] = rnd();
484
+ fb[i * 4 + 3] = rnd();
485
+ }
486
+ farGeo.setAttribute('position', new THREE.BufferAttribute(fp, 3));
487
+ farGeo.setAttribute('aSeedB', new THREE.BufferAttribute(fb, 4));
488
+ farGeo.boundingSphere = new THREE.Sphere(new THREE.Vector3(0, 0.5, 0), 0.87);
489
+ const nearMat = makeMaterial(u, NEAR_VERT, NEAR_FRAG);
490
+ const farMat = makeMaterial(u, FAR_VERT, FAR_FRAG);
491
+ const near = new THREE.Mesh(nearGeo, nearMat);
492
+ const far = new THREE.Points(farGeo, farMat);
493
+ near.frustumCulled = false;
494
+ far.frustumCulled = false;
495
+ near.renderOrder = 2;
496
+ far.renderOrder = 1;
497
+ // Snow must not swallow clicks meant for the scene behind it.
498
+ near.raycast = function () { };
499
+ far.raycast = function () { };
500
+ const object = new THREE.Group();
501
+ object.name = 'snow';
502
+ object.add(far, near);
503
+ const _s = new THREE.Vector3(), _c = new THREE.Vector3(), _q = new THREE.Quaternion(), _sun = new THREE.Vector3();
504
+ return {
505
+ object,
506
+ materials: [nearMat, farMat],
507
+ apply: function (cfg) { applyConfig(u, cfg); },
508
+ // dt clamped by the caller; sunWorld optional (read-only scene sun)
509
+ update: function (dt, camera, viewH, sunWorld) {
510
+ object.updateWorldMatrix(true, false);
511
+ object.getWorldScale(_s);
512
+ u.uVolume.value.set(Math.max(_s.x, 0.01), Math.max(_s.y, 0.01), Math.max(_s.z, 0.01));
513
+ const V = u.uVolume.value;
514
+ const T = Math.min(NEAR_TILE, Math.max(V.x, V.y, V.z));
515
+ u.uTile.value = T;
516
+ // each far speck stands for (near density / far density) real flakes
517
+ u.uFarGain.value = Math.min(20, Math.max(1, (nNear / (T * T * T)) / (nFar / (V.x * V.y * V.z))));
518
+ object.worldToLocal(_c.copy(camera.position));
519
+ u.uCam.value.set(_c.x * V.x, _c.y * V.y, _c.z * V.z);
520
+ // Crystals exist only inside the volume and within 0.48 tile of the eye. When the camera is
521
+ // farther than that from the volume's box none can be drawn, so the layer (4 vertices per
522
+ // crystal, all of them every frame) is not submitted at all.
523
+ const C = u.uCam.value, follow = u.uFollow.value > 0.5;
524
+ const ox = follow ? 0 : Math.max(Math.abs(C.x) - 0.5 * V.x, 0);
525
+ const oz = follow ? 0 : Math.max(Math.abs(C.z) - 0.5 * V.z, 0);
526
+ const oy = Math.max(-C.y, C.y - V.y, 0);
527
+ near.visible = ox * ox + oy * oy + oz * oz < 0.2304 * T * T;
528
+ if (viewH)
529
+ u.uViewH.value = viewH;
530
+ const sp = u.uSpeed.value, ws = u.uWindStrength.value;
531
+ u.uTime.value += dt * sp;
532
+ u.uFall.value += dt * sp;
533
+ u.uWind.value.addScaledVector(u.uWindDir.value, dt * sp * ws * WIND_MS);
534
+ u.uGustPhase.value += dt * sp * (0.3 + ws * WIND_MS) / 26;
535
+ u.uTurbPhase.value += dt * sp * 0.25;
536
+ if (sunWorld) {
537
+ object.getWorldQuaternion(_q).invert();
538
+ u.uSunDir.value.copy(_sun.copy(sunWorld).normalize().applyQuaternion(_q));
539
+ }
540
+ },
541
+ seek: function (t) {
542
+ u.uTime.value = t;
543
+ u.uFall.value = t;
544
+ u.uWind.value.copy(u.uWindDir.value).multiplyScalar(t * u.uWindStrength.value * WIND_MS);
545
+ u.uGustPhase.value = t * (0.3 + u.uWindStrength.value * WIND_MS) / 26;
546
+ u.uTurbPhase.value = t * 0.25;
547
+ },
548
+ dispose: function () { nearGeo.dispose(); farGeo.dispose(); nearMat.dispose(); farMat.dispose(); },
549
+ };
550
+ }
551
+ // Where the pointer plane passes (object-local unit coords; the plane faces the camera):
552
+ // 4.5 m ahead of the eye when the camera is inside the volume, else through the volume centre's depth.
553
+ const _pa = new THREE.Vector3(), _pd = new THREE.Vector3(), _pc = new THREE.Vector3();
554
+ function pointerAnchor(object, camera, u, out) {
555
+ const V = u.uVolume.value, C = u.uCam.value;
556
+ const inside = Math.abs(C.x) < 0.5 * V.x && Math.abs(C.z) < 0.5 * V.z && C.y > 0 && C.y < V.y;
557
+ camera.getWorldDirection(_pd);
558
+ let dist = 4.5;
559
+ if (!inside) {
560
+ object.updateWorldMatrix(true, false);
561
+ object.localToWorld(_pc.set(0, 0.5, 0));
562
+ dist = Math.max(4.5, _pc.sub(camera.position).dot(_pd));
563
+ }
564
+ _pa.copy(camera.position).addScaledVector(_pd, dist);
565
+ return object.worldToLocal(out.copy(_pa));
566
+ }
567
+ // =============================================================================
568
+ // Component
569
+ // =============================================================================
570
+ const DEFAULTS = DEFAULT_ENVIRONMENT_OBJECTS.snow;
571
+ /** Knobs that rebuild the flakes: never live, they change once, on commit. */
572
+ const STRUCTURAL = ['density', 'quality', 'seed'];
573
+ /** Knobs a keyframe or pointer binding may drive per frame — exactly what applyConfig pushes. */
574
+ const ANIMATABLE = new Set(ENVIRONMENT_OBJECTS_ANIMATABLE.snow.map((p) => p.value));
575
+ /** The scene's sky fill is brighter than the flakes' own ambient term expects. */
576
+ const SKY_FILL = 0.5;
577
+ /**
578
+ * Snowfall with physical flakes: size-dependent terminal fall, helical flutter and tumbling dendrite crystals that glint in the sun, swept by travelling gusts and snow bands. The cursor is a gust, a shelter or a warm hand. Use for winter and weather scenes.
579
+ *
580
+ * The volume is the parent's transform: x / z span its scale, y rises from its origin to scale.y.
581
+ */
582
+ const Snow = ({ config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
583
+ const rootRef = useRef(null);
584
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
585
+ const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
586
+ // uniforms outlive rebuilds, so phases and keyframes survive a structural change
587
+ const uniforms = useMemo(() => createUniforms(), []);
588
+ const instance = useMemo(() => build(uniforms, cfg), [uniforms, cfg.density, cfg.quality, cfg.seed]); // eslint-disable-line react-hooks/exhaustive-deps
589
+ useEffect(() => () => instance.dispose(), [instance]);
590
+ useLayoutEffect(() => { applyConfig(uniforms, cfg); }, [uniforms, cfg]);
591
+ const push = useCallback((merged) => { applyConfig(uniforms, merged); }, [uniforms]);
592
+ useConfigDriver({ rootRef, id, family: 'environment', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
593
+ const pointer = usePointerField();
594
+ // the scene's sun, read-only: the same one the clouds, the water and the key light use
595
+ const sun = useCloudSun();
596
+ const anchor = useMemo(() => new THREE.Vector3(), []);
597
+ const buffer = useMemo(() => new THREE.Vector2(), []);
598
+ useFrame((state, delta) => {
599
+ const dt = Math.min(delta, 0.1);
600
+ const s = sun.update();
601
+ uniforms.uSunColor.value.copy(s.color);
602
+ uniforms.uSkyAmbient.value.copy(s.skyAmbient).multiplyScalar(SKY_FILL);
603
+ state.gl.getDrawingBufferSize(buffer);
604
+ instance.update(dt, state.camera, buffer.y, s.direction);
605
+ stepPointerField(uniforms, pointer, state.camera, instance.object, 1, dt, pointerAnchor(instance.object, state.camera, uniforms, anchor));
606
+ });
607
+ return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
608
+ };
609
+ export default Snow;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AnimationOptions, MouseMoveDomain, ThunderstormEnvironmentConfig } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ export interface ThunderstormProps extends ObjectReadyProps {
5
+ config: ThunderstormEnvironmentConfig;
6
+ /** Scene object id: the live-edit handle is found by it. */
7
+ id?: string;
8
+ /** Keyframes on the config knobs (animations.environment.animations). */
9
+ keyframes?: AnimationOptions[];
10
+ /** Pointer bindings on the config knobs (mouseMove.environment). */
11
+ mouseMove?: MouseMoveDomain;
12
+ }
13
+ /**
14
+ * A thunderstorm without the rain (rain is its own object): dark storm curtains drifting on the wind, and lightning arriving as a Poisson process of multi-stroke flashes that light the curtains and the whole scene. The cursor calls a strike or clears the murk. Use for storm, noir and dramatic scenes.
15
+ *
16
+ * The volume is the parent's transform: x / z span its scale, y rises from its origin to scale.y.
17
+ */
18
+ declare const Thunderstorm: React.FC<ThunderstormProps>;
19
+ export default Thunderstorm;
20
+ //# sourceMappingURL=Thunderstorm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thunderstorm.d.ts","sourceRoot":"","sources":["../../../src/components/environment/Thunderstorm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAM9G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA8pBhE,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,MAAM,EAAE,6BAA6B,CAAC;IACtC,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,oEAAoE;IACpE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;GAIG;AACH,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmC7C,CAAC;AAEF,eAAe,YAAY,CAAC"}