@realsee/five 6.8.0-alpha.2 → 6.8.0-alpha.21

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 (715) hide show
  1. package/AGENTS_READ_ME.md +4 -0
  2. package/AI_CONTEXT.md +4 -0
  3. package/README.md +9 -6
  4. package/{guides → ai_guides}/README.md +12 -2
  5. package/ai_guides/ai-doc-guidelines.md +102 -0
  6. package/{guides → ai_guides}/api.md +24 -1
  7. package/ai_guides/features/3dtile.md +172 -0
  8. package/{guides → ai_guides}/features/camera-animation.md +24 -3
  9. package/{guides → ai_guides}/features/clipper.md +2 -0
  10. package/{guides/features/coordnate-system.md → ai_guides/features/coordinate-system.md} +2 -0
  11. package/{guides → ai_guides}/features/event.md +2 -0
  12. package/{guides → ai_guides}/features/five.md +4 -0
  13. package/ai_guides/features/flowing-light-2d-pass.md +438 -0
  14. package/ai_guides/features/flowing-light-3d-pass.md +420 -0
  15. package/ai_guides/features/gaussian-blur-pass.md +202 -0
  16. package/{guides → ai_guides}/features/gesture.md +3 -0
  17. package/{guides → ai_guides}/features/get-screen-pixels.md +2 -0
  18. package/{guides → ai_guides}/features/image-options.md +3 -0
  19. package/{guides → ai_guides}/features/load-external-model.md +21 -0
  20. package/ai_guides/features/load-progress.md +140 -0
  21. package/ai_guides/features/material.md +153 -0
  22. package/{guides → ai_guides}/features/mode.md +4 -0
  23. package/{guides → ai_guides}/features/model.md +4 -1
  24. package/{guides → ai_guides}/features/move-pano-effect.md +2 -0
  25. package/{guides → ai_guides}/features/multi-work.md +2 -0
  26. package/ai_guides/features/pano-filter.md +148 -0
  27. package/{guides → ai_guides}/features/pano-tile.md +7 -14
  28. package/ai_guides/features/pano-uv.md +131 -0
  29. package/ai_guides/features/parameter.md +153 -0
  30. package/ai_guides/features/plugin.md +210 -0
  31. package/{guides → ai_guides}/features/postprocessing.md +39 -4
  32. package/{guides → ai_guides}/features/raycast.md +11 -0
  33. package/{guides → ai_guides}/features/request-proxy.md +2 -0
  34. package/{guides → ai_guides}/features/screen-project.md +2 -0
  35. package/{guides → ai_guides}/features/state.md +2 -0
  36. package/ai_guides/features/view-layer.md +187 -0
  37. package/{guides → ai_guides}/features/work.md +63 -2
  38. package/{guides → ai_guides}/glossary.md +26 -5
  39. package/{guides → ai_guides}/intro.md +1 -1
  40. package/{guides → ai_guides}/quick-start.md +1 -0
  41. package/ai_guides/release_notes/6.8.md +208 -0
  42. package/{guides → ai_guides}/template.md +17 -3
  43. package/docs/00_FOR_AI_AGENTS.md +11 -0
  44. package/docs/README.md +4 -7
  45. package/docs/assets/hierarchy.js +1 -1
  46. package/docs/assets/navigation.js +1 -1
  47. package/docs/assets/search.js +1 -1
  48. package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
  49. package/docs/classes/five.BoundingMesh.html +2 -2
  50. package/docs/classes/five.Camera.html +1 -1
  51. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  52. package/docs/classes/five.Five.html +73 -72
  53. package/docs/classes/five.FivePass.html +1 -1
  54. package/docs/classes/five.Histogram.html +19 -0
  55. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  56. package/docs/classes/five.Model.html +31 -31
  57. package/docs/classes/five.ModelScene.html +1 -1
  58. package/docs/classes/five.NetworkSubscribe.html +1 -1
  59. package/docs/classes/five.PBMContainer.html +1 -1
  60. package/docs/classes/five.PBMCustomShader.html +42 -3
  61. package/docs/classes/five.PBMGSObject.html +5 -3
  62. package/docs/classes/five.PBMGroup.html +1 -1
  63. package/docs/classes/five.PBMMesh.html +1 -1
  64. package/docs/classes/five.PBMMeshMaterial.html +16 -7
  65. package/docs/classes/five.PBMPanoFilter.html +61 -0
  66. package/docs/classes/five.PBMPointCloud.html +1 -1
  67. package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
  68. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  69. package/docs/classes/five.PBMUpdateable.html +41 -0
  70. package/docs/classes/five.PanoCircleMesh.html +1 -1
  71. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  72. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  73. package/docs/classes/five.Parameter.html +57 -53
  74. package/docs/classes/five.Scene.html +1 -1
  75. package/docs/classes/five.Subscribe.html +1 -1
  76. package/docs/classes/five.Tile.html +1 -1
  77. package/docs/classes/five.Tile3D.html +30 -26
  78. package/docs/classes/five.TileNode.html +1 -1
  79. package/docs/classes/five.Trajectory.html +1 -1
  80. package/docs/classes/five.TrajectoryNode.html +1 -1
  81. package/docs/classes/five.Work.html +16 -16
  82. package/docs/classes/five.WorkResolvedObserver.html +27 -2
  83. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  84. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  85. package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
  86. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  87. package/docs/classes/gltf-loader.GLTFParser.html +1 -1
  88. package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
  89. package/docs/classes/line.Line.html +1 -1
  90. package/docs/classes/line.LineGeometry.html +1 -1
  91. package/docs/classes/line.LineMaterial.html +1 -1
  92. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  93. package/docs/classes/line.THREE_Line2.html +1 -1
  94. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  95. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  96. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  97. package/docs/classes/sticker.Sticker.html +1 -1
  98. package/docs/classes/vfx.Airflow.html +1 -1
  99. package/docs/classes/vfx.Flame.html +1 -1
  100. package/docs/classes/vfx.Particle.html +1 -1
  101. package/docs/classes/vfx.ParticleGPU.html +1 -1
  102. package/docs/classes/vfx.SpotLight.html +1 -1
  103. package/docs/documents/README.html +11 -2
  104. package/docs/documents/ai-doc-guidelines.html +60 -15
  105. package/docs/documents/api.html +40 -15
  106. package/docs/documents/features_3dtile.html +142 -45
  107. package/docs/documents/features_camera-animation.html +62 -5
  108. package/docs/documents/features_clipper.html +3 -0
  109. package/docs/documents/{features_coordnate-system.html → features_coordinate-system.html} +4 -1
  110. package/docs/documents/features_event.html +3 -0
  111. package/docs/documents/features_five.html +4 -0
  112. package/docs/documents/features_flowing-light-2d-pass.html +356 -0
  113. package/docs/documents/features_flowing-light-3d-pass.html +351 -0
  114. package/docs/documents/features_gaussian-blur-pass.html +182 -0
  115. package/docs/documents/features_gesture.html +4 -0
  116. package/docs/documents/features_get-screen-pixels.html +3 -0
  117. package/docs/documents/features_image-options.html +3 -0
  118. package/docs/documents/features_load-external-model.html +25 -2
  119. package/docs/documents/features_load-progress.html +110 -0
  120. package/docs/documents/features_material.html +341 -0
  121. package/docs/documents/features_mode.html +5 -0
  122. package/docs/documents/features_model.html +5 -1
  123. package/docs/documents/features_move-pano-effect.html +3 -0
  124. package/docs/documents/features_multi-work.html +3 -0
  125. package/docs/documents/features_pano-filter.html +122 -0
  126. package/docs/documents/features_pano-tile.html +34 -19
  127. package/docs/documents/features_pano-uv.html +82 -0
  128. package/docs/documents/features_parameter.html +76 -56
  129. package/docs/documents/features_plugin.html +105 -0
  130. package/docs/documents/features_postprocessing.html +22 -5
  131. package/docs/documents/features_raycast.html +4 -1
  132. package/docs/documents/features_request-proxy.html +3 -0
  133. package/docs/documents/features_screen-project.html +3 -0
  134. package/docs/documents/features_state.html +3 -0
  135. package/docs/documents/features_view-layer.html +158 -0
  136. package/docs/documents/features_work.html +63 -2
  137. package/docs/documents/glossary.html +31 -6
  138. package/docs/documents/intro.html +1 -1
  139. package/docs/documents/quick-start.html +1 -0
  140. package/docs/documents/release_notes_6.8.html +189 -0
  141. package/docs/documents/template.html +45 -4
  142. package/docs/functions/five.loadAt3d.html +1 -1
  143. package/docs/functions/five.loadB3dm.html +1 -1
  144. package/docs/functions/five.loadDome.html +1 -1
  145. package/docs/functions/five.loadDomez.html +1 -1
  146. package/docs/functions/five.loadFbx.html +1 -1
  147. package/docs/functions/five.loadGltf.html +1 -1
  148. package/docs/functions/five.loadPbm.html +1 -1
  149. package/docs/functions/five.loadPly.html +1 -1
  150. package/docs/functions/five.loadPnts.html +1 -1
  151. package/docs/functions/five.loadSplat.html +1 -1
  152. package/docs/functions/five.loadSpz.html +1 -1
  153. package/docs/functions/five.loadX3p.html +1 -1
  154. package/docs/functions/five.parseWork.html +1 -1
  155. package/docs/functions/vue.useFiveWorks.html +2 -2
  156. package/docs/hierarchy.html +1 -1
  157. package/docs/index.html +11 -2
  158. package/docs/interfaces/five.AddableObject.html +1 -1
  159. package/docs/interfaces/five.AjaxOptions.html +1 -1
  160. package/docs/interfaces/five.BaseEvent.html +2 -2
  161. package/docs/interfaces/five.EventCallback.html +53 -47
  162. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  163. package/docs/interfaces/five.GestureEvent.html +2 -2
  164. package/docs/interfaces/five.ImageOptions.html +1 -1
  165. package/docs/interfaces/five.IntersectEvent.html +2 -2
  166. package/docs/interfaces/five.IntersectMesh.html +1 -1
  167. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  168. package/docs/interfaces/five.Intersection.html +4 -3
  169. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
  170. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
  171. package/docs/interfaces/five.ModeChangeEvent.html +2 -2
  172. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  173. package/docs/interfaces/five.ModelEvent.html +2 -2
  174. package/docs/interfaces/five.ModelSceneEvent.html +2 -2
  175. package/docs/interfaces/five.ModelTileEvent.html +8 -0
  176. package/docs/interfaces/five.MovePanoOptions.html +7 -7
  177. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  178. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  179. package/docs/interfaces/five.NetworkOptions.html +1 -1
  180. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  181. package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
  182. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  183. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  184. package/docs/interfaces/five.ObjectEvent.html +2 -2
  185. package/docs/interfaces/five.PBMClipperParameter.html +2 -2
  186. package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
  187. package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
  188. package/docs/interfaces/five.PBMMaterial.html +1 -1
  189. package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
  190. package/docs/interfaces/five.PBMPanoDepth.html +5 -5
  191. package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
  192. package/docs/interfaces/five.PBMPanoPicture.html +8 -6
  193. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
  194. package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
  195. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  196. package/docs/interfaces/five.PanoEvent.html +2 -2
  197. package/docs/interfaces/five.PanoTextureEvent.html +2 -2
  198. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  199. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  200. package/docs/interfaces/five.ParameterMaterialValue.html +42 -38
  201. package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
  202. package/docs/interfaces/five.ParameterValue.html +56 -52
  203. package/docs/interfaces/five.Pose.html +1 -1
  204. package/docs/interfaces/five.RenderEvent.html +2 -2
  205. package/docs/interfaces/five.ResolvedParameterValue.html +56 -52
  206. package/docs/interfaces/five.RgbaData.html +7 -0
  207. package/docs/interfaces/five.SplatData.html +2 -2
  208. package/docs/interfaces/five.State.html +1 -1
  209. package/docs/interfaces/five.StateEvent.html +2 -2
  210. package/docs/interfaces/five.TextureOptions.html +1 -1
  211. package/docs/interfaces/five.Tile3DOptions.html +2 -2
  212. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
  213. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  214. package/docs/interfaces/five.ViewLayer.html +30 -26
  215. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  216. package/docs/interfaces/five.WorkImage.html +1 -1
  217. package/docs/interfaces/five.WorkModel.html +8 -8
  218. package/docs/interfaces/five.WorkModelLayer.html +6 -6
  219. package/docs/interfaces/five.WorkObserver.html +27 -2
  220. package/docs/interfaces/five.WorkTile.html +1 -1
  221. package/docs/interfaces/five.WorksEvent.html +2 -2
  222. package/docs/interfaces/five.XRControllerEvent.html +2 -2
  223. package/docs/interfaces/five.XRGestureEvent.html +2 -2
  224. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  225. package/docs/interfaces/five.XRSessionEvent.html +2 -2
  226. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  227. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  228. package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
  229. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
  230. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  231. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  232. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  233. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  234. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
  235. package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
  236. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  237. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  238. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  239. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  240. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  241. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  242. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  243. package/docs/interfaces/plugins.TrajectoryController.html +1 -1
  244. package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
  245. package/docs/modules/five.html +1 -1
  246. package/docs/modules.html +1 -1
  247. package/docs/types/five.ControllerEventTypes.html +27 -25
  248. package/docs/types/five.EasingFunction.html +1 -0
  249. package/docs/types/five.EventTypes.html +27 -25
  250. package/docs/types/five.FivePlugin.html +1 -1
  251. package/docs/types/five.FivePluginInit.html +1 -1
  252. package/docs/types/five.FivePluginInstance.html +1 -1
  253. package/docs/types/five.NetworkProgressCallback.html +1 -1
  254. package/docs/types/five.PBMAlphaMode.html +1 -1
  255. package/docs/types/five.PBMColorStyle.html +1 -1
  256. package/docs/types/five.PBMFloorStyle.html +1 -1
  257. package/docs/types/five.PBMMeshShaderType.html +1 -1
  258. package/docs/types/five.PBMPointBack.html +1 -1
  259. package/docs/types/five.PBMPointCloudShaderType.html +1 -1
  260. package/docs/types/five.PBMPointShape.html +1 -1
  261. package/docs/types/five.PBMPointSize.html +1 -1
  262. package/docs/types/five.PBMTransition.html +1 -1
  263. package/docs/types/five.ParseOptions.html +6 -6
  264. package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
  265. package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
  266. package/five/application/analysis.d.ts +40 -0
  267. package/five/application/controllers.d.ts +41 -0
  268. package/five/application/events-legacy.d.ts +454 -0
  269. package/five/application/events.d.ts +69 -0
  270. package/five/application/five.d.ts +519 -0
  271. package/five/application/fiveInitArgs.d.ts +176 -0
  272. package/five/application/fiveLoadOptions.d.ts +21 -0
  273. package/five/application/generateDefaultVideoElement.d.ts +2 -0
  274. package/five/application/getViewportScale.d.ts +2 -0
  275. package/five/application/initLights.d.ts +3 -0
  276. package/five/application/mode.d.ts +28 -0
  277. package/five/application/renderPoweredByRealsee.d.ts +3 -0
  278. package/five/assets/cardboard-png-data-url.d.ts +2 -0
  279. package/five/assets/gradient-png-data-url.d.ts +2 -0
  280. package/five/assets/loading-png-data-url.d.ts +2 -0
  281. package/five/assets/phone-png-data-url.d.ts +2 -0
  282. package/five/assets/realsee-png-data-url.d.ts +2 -0
  283. package/five/bvh/bvhMath.d.ts +33 -0
  284. package/five/bvh/bvhMesh.d.ts +7 -0
  285. package/five/bvh/bvhNode.d.ts +29 -0
  286. package/five/bvh/bvhObject.d.ts +18 -0
  287. package/five/bvh/bvhPoints.d.ts +6 -0
  288. package/five/bvh/index.d.ts +10 -0
  289. package/five/bvh/worker.d.ts +35 -0
  290. package/five/cardboard/helper.d.ts +2 -0
  291. package/five/cardboard/index.d.ts +13 -0
  292. package/five/cardboard/sensor.d.ts +158 -0
  293. package/five/certificates/hardware.d.ts +1 -0
  294. package/five/controllers/base.d.ts +167 -0
  295. package/five/controllers/events.d.ts +71 -0
  296. package/five/controllers/floorplan.d.ts +119 -0
  297. package/five/controllers/mapview.d.ts +139 -0
  298. package/five/controllers/model.d.ts +57 -0
  299. package/five/controllers/panorama.d.ts +143 -0
  300. package/five/controllers/panoramaLike.d.ts +87 -0
  301. package/five/controllers/topview.d.ts +42 -0
  302. package/five/controllers/vrPanorama.d.ts +56 -0
  303. package/five/controllers/xrPanorama.d.ts +81 -0
  304. package/five/core/camera.d.ts +65 -0
  305. package/five/core/internalWebGLRenderer.d.ts +14 -0
  306. package/five/core/panoVideo.d.ts +18 -0
  307. package/five/core/scene.d.ts +10 -0
  308. package/five/core/tiling.d.ts +43 -0
  309. package/five/declare.d.ts +2 -1
  310. package/five/gaussian-splatting/util/renderData.d.ts +52 -0
  311. package/five/gaussian-splatting/wasm/data.d.ts +20 -0
  312. package/five/gaussian-splatting/wasm/sort.d.ts +18 -0
  313. package/five/gaussian-splatting/worker/dataWorker.d.ts +1 -0
  314. package/five/gaussian-splatting/worker/sortWorker.d.ts +1 -0
  315. package/five/index.d.ts +60 -4637
  316. package/five/index.js +193 -341
  317. package/five/index.mjs +26455 -31011
  318. package/five/meshes/boundingMesh.d.ts +12 -0
  319. package/five/meshes/intersectMesh.d.ts +8 -0
  320. package/five/meshes/panoCircleMesh.d.ts +35 -0
  321. package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
  322. package/five/meshes/panoCircleMeshSolid.d.ts +34 -0
  323. package/five/meshes/panoSphereMesh.d.ts +27 -0
  324. package/five/model/helpers/coordinate-transform.d.ts +3 -0
  325. package/five/model/helpers/ellipsoid-coordinates.d.ts +14 -0
  326. package/five/model/helpers/get-edges-by-sphere.d.ts +8 -0
  327. package/five/model/helpers/get-recommend-tile3d-parameters.d.ts +8 -0
  328. package/five/model/index.d.ts +70 -0
  329. package/five/model/intersection.d.ts +18 -0
  330. package/five/model/loaders/at3d.d.ts +12 -0
  331. package/five/model/loaders/b3dm.d.ts +9 -0
  332. package/five/model/loaders/dome.d.ts +22 -0
  333. package/five/model/loaders/domez.d.ts +11 -0
  334. package/five/model/loaders/fbx.d.ts +8 -0
  335. package/five/model/loaders/glTF-helpers/extensions/CESIUM_RTC.d.ts +9 -0
  336. package/five/model/loaders/glTF-helpers/extensions/EXT_meshopt_compression.d.ts +8 -0
  337. package/five/model/loaders/glTF-helpers/extensions/EXT_texture_webp.d.ts +11 -0
  338. package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
  339. package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +25 -0
  340. package/five/model/loaders/glTF-helpers/extensions/KHR_draco_mesh_compression.d.ts +11 -0
  341. package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +9 -0
  342. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_clearcoat.d.ts +10 -0
  343. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_emissive_strength.d.ts +10 -0
  344. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_sheen.d.ts +10 -0
  345. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_transmission.d.ts +10 -0
  346. package/five/model/loaders/glTF-helpers/extensions/KHR_materials_unlit.d.ts +10 -0
  347. package/five/model/loaders/glTF-helpers/extensions/KHR_mesh_quantization.d.ts +6 -0
  348. package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +10 -0
  349. package/five/model/loaders/glTF-helpers/extensions/KHR_texture_basisu.d.ts +9 -0
  350. package/five/model/loaders/glTF-helpers/extensions/KHR_texture_transform.d.ts +10 -0
  351. package/five/model/loaders/glTF-helpers/extensions/REALSEE_materials_lightmap.d.ts +7 -0
  352. package/five/model/loaders/glTF-helpers/extensions/base.d.ts +24 -0
  353. package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
  354. package/five/model/loaders/glTF-helpers/index.d.ts +47 -0
  355. package/five/model/loaders/glTF-helpers/parser.d.ts +114 -0
  356. package/five/model/loaders/glTF-helpers/type.d.ts +14 -0
  357. package/five/model/loaders/gltf.d.ts +10 -0
  358. package/five/model/loaders/obj.d.ts +9 -0
  359. package/five/model/loaders/pbm.d.ts +26 -0
  360. package/five/model/loaders/ply.d.ts +24 -0
  361. package/five/model/loaders/pnts.d.ts +8 -0
  362. package/five/model/loaders/protobuf/dome.d.ts +540 -0
  363. package/five/model/loaders/protobuf/pbm.d.ts +203 -0
  364. package/five/model/loaders/shared.d.ts +16 -0
  365. package/five/model/loaders/splat.d.ts +8 -0
  366. package/five/model/loaders/spz.d.ts +14 -0
  367. package/five/model/loaders/tile3d-helpers/feature-table.d.ts +15 -0
  368. package/five/model/loaders/tile3d-helpers/gl-type.d.ts +20 -0
  369. package/five/model/loaders/tile3d-helpers/parse-gltf-array-buffer.d.ts +2 -0
  370. package/five/model/loaders/tile3d-helpers/parse-header.d.ts +2 -0
  371. package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.d.ts +2 -0
  372. package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.worker.d.ts +6 -0
  373. package/five/model/loaders/tile3d-helpers/parse-table.d.ts +3 -0
  374. package/five/model/loaders/tile3d-helpers/tile3d-type.d.ts +35 -0
  375. package/five/model/loaders/x3p.d.ts +22 -0
  376. package/five/model/materials/pbmMaterial.d.ts +137 -0
  377. package/five/model/materials/pbmMeshMaterial.d.ts +126 -0
  378. package/five/model/materials/pbmPointCloudMaterial.d.ts +70 -0
  379. package/five/model/model-scene.d.ts +172 -0
  380. package/five/model/model.d.ts +209 -0
  381. package/five/model/objects/pbmContainer.d.ts +28 -0
  382. package/five/model/objects/pbmGaussianSplattingObject.d.ts +43 -0
  383. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +55 -0
  384. package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
  385. package/five/model/objects/pbmGroup.d.ts +8 -0
  386. package/five/model/objects/pbmMesh.d.ts +10 -0
  387. package/five/model/objects/pbmPointCloud.d.ts +7 -0
  388. package/five/model/parameter.d.ts +140 -0
  389. package/five/model/shaders/pbm_gaussian_splatting/fragment.d.ts +2 -0
  390. package/five/model/shaders/pbm_gaussian_splatting/vertex.d.ts +2 -0
  391. package/five/model/shaders/pbm_mesh_basic/fragment.d.ts +2 -0
  392. package/five/model/shaders/pbm_mesh_basic/vertex.d.ts +2 -0
  393. package/five/model/shaders/pbm_mesh_none/fragment.d.ts +2 -0
  394. package/five/model/shaders/pbm_mesh_none/vertex.d.ts +2 -0
  395. package/five/model/shaders/pbm_mesh_phong/fragment.d.ts +2 -0
  396. package/five/model/shaders/pbm_mesh_phong/vertex.d.ts +2 -0
  397. package/five/model/shaders/pbm_mesh_standard/fragment.d.ts +2 -0
  398. package/five/model/shaders/pbm_mesh_standard/vertex.d.ts +2 -0
  399. package/five/model/shaders/pbm_pointcloud/fragment.d.ts +2 -0
  400. package/five/model/shaders/pbm_pointcloud/vertex.d.ts +2 -0
  401. package/five/model/tile3d/header.d.ts +88 -0
  402. package/five/model/tile3d/index.d.ts +214 -0
  403. package/five/model/tile3d/tile-cache.d.ts +18 -0
  404. package/five/model/tile3d/tile-content.d.ts +10 -0
  405. package/five/model/tile3d/tile-node.d.ts +24 -0
  406. package/five/model/tile3d/tile-request-scheduler.d.ts +17 -0
  407. package/five/model/tile3d/tile.d.ts +79 -0
  408. package/five/model/tile3d/tileset-base-traverser.d.ts +59 -0
  409. package/five/model/tile3d/tileset-most-detail-traverser.d.ts +14 -0
  410. package/five/model/tile3d/tileset-normal-traverser.d.ts +15 -0
  411. package/five/model/tile3d/tileset-skip-traverser.d.ts +60 -0
  412. package/five/model/tile3d/tileset.d.ts +69 -0
  413. package/five/model/tile3d/trajectory-content.d.ts +9 -0
  414. package/five/model/tile3d/trajectory-node.d.ts +15 -0
  415. package/five/model/tile3d/trajectory.d.ts +30 -0
  416. package/five/model/tile3d/types.d.ts +33 -0
  417. package/five/model/view-layer.d.ts +20 -0
  418. package/five/renderer/five-renderer.d.ts +17 -0
  419. package/five/renderer/index.d.ts +3 -0
  420. package/five/renderer/postprocessing/composer.d.ts +37 -0
  421. package/five/renderer/postprocessing/index.d.ts +7 -0
  422. package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +17 -0
  423. package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +14 -0
  424. package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +36 -0
  425. package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +36 -0
  426. package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +12 -0
  427. package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
  428. package/five/renderer/scene-renderers/point-cloud-high-quality-scene-renderer.d.ts +11 -0
  429. package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
  430. package/five/renderer/scene-renderers/ssaa-scene-renderer.d.ts +15 -0
  431. package/five/renderer/tools/full-screen-quad.d.ts +15 -0
  432. package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
  433. package/five/renderer/tools/render-full-screen-depth.d.ts +2 -0
  434. package/five/renderer/tools/render-full-screen.d.ts +2 -0
  435. package/five/texture/histogram.d.ts +54 -0
  436. package/five/texture/imageBitmap.d.ts +13 -0
  437. package/five/texture/initTexture.d.ts +3 -0
  438. package/five/texture/loader.d.ts +39 -0
  439. package/five/texture/textureData.d.ts +11 -0
  440. package/five/thirdparty/fflate.d.ts +1407 -0
  441. package/five/thirdparty/hammer.d.ts +375 -0
  442. package/five/thirdparty/jsrsasign.d.ts +753 -0
  443. package/five/thirdparty/meshopt_decoder.d.ts +15 -0
  444. package/five/three-version-check.d.ts +1 -0
  445. package/five/types/addableObject.d.ts +12 -0
  446. package/five/types/cube.d.ts +1 -0
  447. package/five/types/gestureInput.d.ts +24 -0
  448. package/five/types/imageOptions.d.ts +20 -0
  449. package/five/types/intersectMeshInterface.d.ts +8 -0
  450. package/five/types/movePanoEffect.d.ts +13 -0
  451. package/five/types/movePanoOptions.d.ts +36 -0
  452. package/five/types/panoCircleMeshInterface.d.ts +34 -0
  453. package/five/types/plugin.d.ts +25 -0
  454. package/five/types/pose.d.ts +17 -0
  455. package/five/types/state.d.ts +20 -0
  456. package/five/types/viewport.d.ts +22 -0
  457. package/five/utils/ajax.d.ts +66 -0
  458. package/five/utils/animationFrameLoop.d.ts +45 -0
  459. package/five/utils/array.d.ts +31 -0
  460. package/five/utils/asyncTaskQueue.d.ts +8 -0
  461. package/five/utils/bufferGeometry.d.ts +33 -0
  462. package/five/utils/calculateProgress.d.ts +39 -0
  463. package/five/utils/calculateThreeMouse.d.ts +13 -0
  464. package/five/utils/canplayVideo.d.ts +2 -0
  465. package/five/utils/clamp.d.ts +2 -0
  466. package/five/utils/clock.d.ts +17 -0
  467. package/five/utils/createSymbol.d.ts +5 -0
  468. package/five/utils/decodeText.d.ts +2 -0
  469. package/five/utils/deepEqual.d.ts +2 -0
  470. package/five/utils/deepFreeze.d.ts +2 -0
  471. package/five/utils/defineProperty.d.ts +9 -0
  472. package/five/utils/detector.d.ts +14 -0
  473. package/five/utils/distance.d.ts +10 -0
  474. package/five/utils/draco.d.ts +26 -0
  475. package/five/utils/easing.d.ts +63 -0
  476. package/five/utils/event.d.ts +159 -0
  477. package/five/utils/formatRad.d.ts +7 -0
  478. package/five/utils/imageSupport.d.ts +6 -0
  479. package/five/utils/imageURL.d.ts +42 -0
  480. package/five/utils/isEmptyObject.d.ts +2 -0
  481. package/five/utils/isNil.d.ts +6 -0
  482. package/five/utils/isNumber.d.ts +2 -0
  483. package/five/utils/isPowerOfTwo.d.ts +2 -0
  484. package/five/utils/isPromise.d.ts +2 -0
  485. package/five/utils/isSimilar.d.ts +6 -0
  486. package/five/utils/json.d.ts +7 -0
  487. package/five/utils/ktx2.d.ts +30 -0
  488. package/five/utils/lzma/index.d.ts +2 -0
  489. package/five/utils/lzma/lzma.d.ts +3 -0
  490. package/five/utils/lzma/lzmaWASM.d.ts +2 -0
  491. package/five/utils/lzma/lzmaWorker.d.ts +14 -0
  492. package/five/utils/memoryUsage.d.ts +29 -0
  493. package/five/utils/motion.d.ts +38 -0
  494. package/five/utils/noop.d.ts +6 -0
  495. package/five/utils/now.d.ts +7 -0
  496. package/five/utils/pano.d.ts +9 -0
  497. package/five/utils/pick.d.ts +3 -0
  498. package/five/utils/poseUtils.d.ts +5 -0
  499. package/five/utils/renderCubeTextureToCubeRenderTarget.d.ts +3 -0
  500. package/five/utils/renderDepth.d.ts +2 -0
  501. package/five/utils/renderTexturesToCubeRenderTarget.d.ts +10 -0
  502. package/five/utils/requestPermission.d.ts +3 -0
  503. package/five/utils/shaderContentFix.d.ts +7 -0
  504. package/five/utils/shaderMaterial.d.ts +20 -0
  505. package/five/utils/stateUtils.d.ts +5 -0
  506. package/five/utils/string-pattern.d.ts +8 -0
  507. package/five/utils/subscribe.d.ts +67 -0
  508. package/five/utils/tileCube.d.ts +19 -0
  509. package/five/utils/toFastProperties.d.ts +1 -0
  510. package/five/utils/typedCache.d.ts +10 -0
  511. package/five/utils/uniform.d.ts +15 -0
  512. package/five/utils/url.d.ts +35 -0
  513. package/five/utils/uuid.d.ts +5 -0
  514. package/five/utils/values.d.ts +2 -0
  515. package/five/utils/vectorCoordinates.d.ts +29 -0
  516. package/five/utils/volume.d.ts +111 -0
  517. package/five/utils/webglError.d.ts +7 -0
  518. package/five/utils/worker.d.ts +26 -0
  519. package/five/webxr/XRControllerModelFactory.d.ts +28 -0
  520. package/five/webxr/motionHelper.d.ts +68 -0
  521. package/five/webxr/xrButton.d.ts +4 -0
  522. package/five/webxr/xrController.d.ts +24 -0
  523. package/five/webxr/xrManager.d.ts +84 -0
  524. package/five/work/_ALLOW_HOST.d.ts +2 -0
  525. package/five/work/index.d.ts +6 -0
  526. package/five/work/keychain.d.ts +5 -0
  527. package/five/work/looseWorkType.d.ts +121 -0
  528. package/five/work/verify.d.ts +7 -0
  529. package/five/work/work.d.ts +236 -0
  530. package/five/work/workFetcher.d.ts +4 -0
  531. package/five/work/workJson.d.ts +3 -0
  532. package/five/work/workJsonType.d.ts +73 -0
  533. package/five/work/workObserverUtils.d.ts +36 -0
  534. package/five/work/workParser.d.ts +6 -0
  535. package/five/work/workResolvedObserver.d.ts +12 -0
  536. package/five/work/workVerify.d.ts +2 -0
  537. package/five/work/works.d.ts +10 -0
  538. package/gltf-loader/gltf-object.d.ts +17 -0
  539. package/gltf-loader/index.d.ts +60 -160
  540. package/gltf-loader/index.js +9 -9
  541. package/gltf-loader/index.mjs +1351 -1451
  542. package/gltf-loader/thirdparty/DDSLoader.d.ts +23 -0
  543. package/gltf-loader/thirdparty/DRACOLoader.d.ts +18 -0
  544. package/gltf-loader/thirdparty/GLTFLoader.d.ts +59 -0
  545. package/line/circle_png.d.ts +1 -0
  546. package/line/index.d.ts +19 -69
  547. package/line/index.js +4 -4
  548. package/line/index.mjs +334 -513
  549. package/line/utils/Line2.d.ts +7 -0
  550. package/line/utils/LineGeometry.d.ts +10 -0
  551. package/line/utils/LineMaterial.d.ts +20 -0
  552. package/line/utils/LineSegments2.d.ts +11 -0
  553. package/line/utils/LineSegmentsGeometry.d.ts +15 -0
  554. package/llms.txt +43 -31
  555. package/package.json +11 -2
  556. package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
  557. package/plugins/BackgroundPlugin/index.d.ts +5 -0
  558. package/plugins/BackgroundPlugin/typings.d.ts +44 -0
  559. package/plugins/BasePlugin/index.d.ts +119 -0
  560. package/plugins/DynamicPathLinePlugin/Controller.d.ts +167 -0
  561. package/plugins/DynamicPathLinePlugin/index.d.ts +5 -0
  562. package/plugins/DynamicPathLinePlugin/line2/Line2.d.ts +7 -0
  563. package/plugins/DynamicPathLinePlugin/line2/LineGeometry.d.ts +10 -0
  564. package/plugins/DynamicPathLinePlugin/line2/LineMaterial.d.ts +17 -0
  565. package/plugins/DynamicPathLinePlugin/line2/LineSegments2.d.ts +11 -0
  566. package/plugins/DynamicPathLinePlugin/line2/LineSegmentsGeometry.d.ts +15 -0
  567. package/plugins/DynamicPathLinePlugin/typing.d.ts +129 -0
  568. package/plugins/DynamicPathLinePlugin/typings.d.ts +72 -0
  569. package/plugins/ItemMaskPlugin/Controller.d.ts +48 -0
  570. package/plugins/ItemMaskPlugin/index.d.ts +5 -0
  571. package/plugins/ItemMaskPlugin/typing.d.ts +58 -0
  572. package/plugins/OrientationPlugin/Controller.d.ts +82 -0
  573. package/plugins/OrientationPlugin/RoundedBoxGeometry.d.ts +11 -0
  574. package/plugins/OrientationPlugin/index.d.ts +6 -0
  575. package/plugins/OrientationPlugin/typing.d.ts +25 -0
  576. package/plugins/PanoAnimePlugin/Controller.d.ts +46 -0
  577. package/plugins/PanoAnimePlugin/index.d.ts +5 -0
  578. package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
  579. package/plugins/PluginTemplate/Controller.d.ts +27 -0
  580. package/plugins/PluginTemplate/index.d.ts +5 -0
  581. package/plugins/PluginTemplate/typing.d.ts +21 -0
  582. package/plugins/TrajectoryPlugin/Controller.d.ts +85 -0
  583. package/plugins/TrajectoryPlugin/index.d.ts +6 -0
  584. package/plugins/TrajectoryPlugin/typing.d.ts +25 -0
  585. package/plugins/index.d.ts +9 -1102
  586. package/plugins/index.js +17 -21
  587. package/plugins/index.mjs +3342 -4245
  588. package/plugins/thirdParty/CSS3DRenderer.d.ts +32 -0
  589. package/plugins/thirdParty/OrbitControls.d.ts +78 -0
  590. package/plugins/utils/absoluteUrl.d.ts +5 -0
  591. package/plugins/utils/clamp.d.ts +2 -0
  592. package/plugins/utils/loadImage.d.ts +1 -0
  593. package/plugins/utils/motion.d.ts +38 -0
  594. package/plugins/utils/now.d.ts +6 -0
  595. package/plugins/utils/uuid.d.ts +5 -0
  596. package/react/canvas.d.ts +19 -0
  597. package/react/context.d.ts +11 -0
  598. package/react/createProvider.d.ts +95 -0
  599. package/react/createStore.d.ts +144 -0
  600. package/react/hooks/unsafe__useFiveInstance.d.ts +9 -0
  601. package/react/hooks/useFiveAction.d.ts +147 -0
  602. package/react/hooks/useFiveCameraDirection.d.ts +7 -0
  603. package/react/hooks/useFiveCameraRaycaster.d.ts +7 -0
  604. package/react/hooks/useFiveCurrentObserver.d.ts +11 -0
  605. package/react/hooks/useFiveCurrentState.d.ts +15 -0
  606. package/react/hooks/useFiveEventCallback.d.ts +12 -0
  607. package/react/hooks/useFiveFloor.d.ts +15 -0
  608. package/react/hooks/useFiveHelper.d.ts +14 -0
  609. package/react/hooks/useFiveModelBounding.d.ts +5 -0
  610. package/react/hooks/useFiveModelEffect.d.ts +14 -0
  611. package/react/hooks/useFiveModelIntersectRaycaster.d.ts +22 -0
  612. package/react/hooks/useFiveModelReadyState.d.ts +8 -0
  613. package/react/hooks/useFiveProject2d.d.ts +20 -0
  614. package/react/hooks/useFiveSceneEffect.d.ts +21 -0
  615. package/react/hooks/useFiveState.d.ts +6 -0
  616. package/react/hooks/useFiveWork.d.ts +29 -0
  617. package/react/index.d.ts +24 -830
  618. package/react/index.js +3 -3
  619. package/react/index.mjs +572 -783
  620. package/react/rendererPool.d.ts +7 -0
  621. package/react/withFive.d.ts +213 -0
  622. package/shader-lib/EvenessPlane/index.d.ts +10 -0
  623. package/shader-lib/PointCloudExpand/index.d.ts +59 -0
  624. package/shader-lib/PolygonCuter/index.d.ts +52 -0
  625. package/shader-lib/PolygonCuter/worker.d.ts +14 -0
  626. package/shader-lib/ShineModel/index.d.ts +7 -0
  627. package/shader-lib/SweepModel/index.d.ts +7 -0
  628. package/shader-lib/index.d.ts +5 -86
  629. package/shader-lib/index.js +13 -14
  630. package/shader-lib/index.mjs +424 -824
  631. package/sticker/geometry.d.ts +3 -0
  632. package/sticker/index.d.ts +68 -71
  633. package/sticker/index.js +3 -3
  634. package/sticker/index.mjs +102 -142
  635. package/umd/five-gltf-loader.js +9 -9
  636. package/umd/five-line.js +4 -4
  637. package/umd/five-plugins.js +17 -21
  638. package/umd/five-react.js +3 -3
  639. package/umd/five-shader-lib.js +13 -14
  640. package/umd/five-sticker.js +3 -3
  641. package/umd/five-vfx.js +21 -21
  642. package/umd/five-vue.js +3 -3
  643. package/umd/five.js +188 -336
  644. package/vfx/airflow/airflow.d.ts +18 -0
  645. package/vfx/airflow/fragment-shader.d.ts +2 -0
  646. package/vfx/airflow/vertex-shader.d.ts +2 -0
  647. package/vfx/common/scale-shader.d.ts +2 -0
  648. package/vfx/common/simplex-noise-shader.d.ts +2 -0
  649. package/vfx/frame/fragment-shader.d.ts +2 -0
  650. package/vfx/frame/frame.d.ts +22 -0
  651. package/vfx/frame/vertex-shader.d.ts +2 -0
  652. package/vfx/index.d.ts +7 -363
  653. package/vfx/index.js +21 -21
  654. package/vfx/index.mjs +454 -910
  655. package/vfx/particle/fragment-shader.d.ts +2 -0
  656. package/vfx/particle/instance.d.ts +36 -0
  657. package/vfx/particle/particle.d.ts +205 -0
  658. package/vfx/particle/utils.d.ts +11 -0
  659. package/vfx/particle/vertex-shader.d.ts +2 -0
  660. package/vfx/particle-gpu/fragment-shader.d.ts +2 -0
  661. package/vfx/particle-gpu/instance.d.ts +36 -0
  662. package/vfx/particle-gpu/particle.d.ts +95 -0
  663. package/vfx/particle-gpu/utils.d.ts +11 -0
  664. package/vfx/particle-gpu/vertex-shader.d.ts +2 -0
  665. package/vfx/spotLight/fragment-shader.d.ts +2 -0
  666. package/vfx/spotLight/spotLight.d.ts +15 -0
  667. package/vfx/spotLight/vertex-shader.d.ts +2 -0
  668. package/vue/context.d.ts +7 -0
  669. package/vue/hooks/FiveCanvas.d.ts +36 -0
  670. package/vue/hooks/FiveProvider.d.ts +35 -0
  671. package/vue/hooks/unsafe__useFiveInject.d.ts +9 -0
  672. package/vue/hooks/useFiveAction.d.ts +178 -0
  673. package/vue/hooks/useFiveCameraDirection.d.ts +8 -0
  674. package/vue/hooks/useFiveCameraRaycaster.d.ts +8 -0
  675. package/vue/hooks/useFiveCurrentObserver.d.ts +12 -0
  676. package/vue/hooks/useFiveCurrentState.d.ts +16 -0
  677. package/vue/hooks/useFiveEventCallback.d.ts +11 -0
  678. package/vue/hooks/useFiveFloor.d.ts +16 -0
  679. package/vue/hooks/useFiveHelper.d.ts +15 -0
  680. package/vue/hooks/useFiveModel.d.ts +7 -0
  681. package/vue/hooks/useFiveModelBounding.d.ts +7 -0
  682. package/vue/hooks/useFiveModelIntersectRaycaster.d.ts +23 -0
  683. package/vue/hooks/useFiveModelReadyState.d.ts +9 -0
  684. package/vue/hooks/useFiveProject2d.d.ts +26 -0
  685. package/vue/hooks/useFiveScene.d.ts +6 -0
  686. package/vue/hooks/useFiveState.d.ts +16 -0
  687. package/vue/hooks/useFiveWork.d.ts +30 -0
  688. package/vue/index.d.ts +23 -467
  689. package/vue/index.js +3 -3
  690. package/vue/index.mjs +309 -301
  691. package/vue/rendererPool.d.ts +10 -0
  692. package/work-downloader/components/model-3d-tile.d.ts +2 -0
  693. package/work-downloader/components/model.d.ts +3 -0
  694. package/work-downloader/components/observer.d.ts +7 -0
  695. package/work-downloader/download.d.ts +16 -0
  696. package/work-downloader/index.d.ts +2 -33
  697. package/work-downloader/index.js +3 -3
  698. package/work-downloader/index.mjs +317 -556
  699. package/work-downloader/type.d.ts +28 -0
  700. package/work-downloader/utils/download-to-file.d.ts +1 -0
  701. package/work-downloader/utils/image-processing.d.ts +7 -0
  702. package/work-downloader/utils/join-url.d.ts +2 -0
  703. package/work-downloader/utils/log.d.ts +1 -0
  704. package/work-downloader/utils/relative-url.d.ts +1 -0
  705. package/docs/documents/five.FivePlugin.plugin.html +0 -60
  706. package/docs/documents/plugin.html +0 -60
  707. package/docs/media/five.ts +0 -2881
  708. package/docs/media/pass.ts +0 -64
  709. package/guides/ai-doc-guidelines.md +0 -72
  710. package/guides/features/3dtile.md +0 -264
  711. package/guides/features/parameter.md +0 -178
  712. package/guides/plugin.md +0 -206
  713. /package/{guides → ai_guides}/release_notes/6.6.md +0 -0
  714. /package/{guides → ai_guides}/release_notes/6.7.md +0 -0
  715. /package/{guides → ai_guides}/support.md +0 -0
package/vfx/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/1/28
5
- * Version: 6.8.0-alpha.2
4
+ * Generated: 3/19/2026
5
+ * Version: 6.8.0-alpha.21
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,152 +252,9 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import * as n from "three";
256
- var ae = function(o, i) {
257
- return ae = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
258
- e.__proto__ = t;
259
- } || function(e, t) {
260
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
261
- }, ae(o, i);
262
- };
263
- function Y(o, i) {
264
- if (typeof i != "function" && i !== null)
265
- throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
266
- ae(o, i);
267
- function e() {
268
- this.constructor = o;
269
- }
270
- o.prototype = i === null ? Object.create(i) : (e.prototype = i.prototype, new e());
271
- }
272
- var be = `
273
- uniform vec3 uColor1;
274
- uniform vec3 uColor2;
275
- uniform float uOpacity;
276
-
277
- varying vec3 vPosition;
278
- varying float vNoise;
279
-
280
- void main() {
281
- float alpha = 1.0;
282
- float gradient = mix(0.0, 1.0, -vPosition.y + 1.75);
283
- if(vNoise > 0.3 * gradient) {
284
- alpha = 0.0;
285
- }
286
- float mask = mix(0.3, 1.0, -vPosition.y + 0.5);
287
- alpha = clamp(alpha * (mask * 10.0), 0.0, 1.0);
288
- vec3 color = mix(uColor1, uColor2, -vPosition.y + 0.5);
289
- color.g = color.g * (1.0 + gradient * vNoise);
290
- gl_FragColor = vec4(color, alpha * uOpacity);
291
- }
292
- `, le = `
293
- // Simplex 4D Noise
294
- // by Ian McEwan, Ashima Arts
295
- //
296
- vec4 permute(vec4 x) {
297
- return mod((x * 34.0 + 1.0) * x, 289.0);
298
- }
299
- float permute(float x) {
300
- return floor( mod((x * 34.0 + 1.0) * x, 289.0) );
301
- }
302
- vec4 taylorInvSqrt(vec4 r) {
303
- return 1.79284291400159 - 0.85373472095314 * r;
304
- }
305
- float taylorInvSqrt(float r) {
306
- return 1.79284291400159 - 0.85373472095314 * r;
307
- }
308
-
309
- vec4 grad4(float j, vec4 ip) {
310
- const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);
311
- vec4 p,s;
312
-
313
- p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;
314
- p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
315
- s = vec4(lessThan(p, vec4(0.0)));
316
- p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;
317
-
318
- return p;
319
- }
320
-
321
- float simplexNoise(vec4 v) {
322
- const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
323
- 0.309016994374947451); // (sqrt(5) - 1)/4 F4
324
- // First corner
325
- vec4 i = floor(v + dot(v, C.yyyy) );
326
- vec4 x0 = v - i + dot(i, C.xxxx);
327
-
328
- // Other corners
329
-
330
- // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
331
- vec4 i0;
332
-
333
- vec3 isX = step( x0.yzw, x0.xxx );
334
- vec3 isYZ = step( x0.zww, x0.yyz );
335
-
336
- // i0.x = dot( isX, vec3( 1.0 ) );
337
- i0.x = isX.x + isX.y + isX.z;
338
- i0.yzw = 1.0 - isX;
339
-
340
- // i0.y += dot( isYZ.xy, vec2( 1.0 ) );
341
- i0.y += isYZ.x + isYZ.y;
342
- i0.zw += 1.0 - isYZ.xy;
343
-
344
- i0.z += isYZ.z;
345
- i0.w += 1.0 - isYZ.z;
346
-
347
- // i0 now contains the unique values 0,1,2,3 in each channel
348
- vec4 i3 = clamp( i0, 0.0, 1.0 );
349
- vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );
350
- vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );
351
-
352
- // x0 = x0 - 0.0 + 0.0 * C
353
- vec4 x1 = x0 - i1 + 1.0 * C.xxxx;
354
- vec4 x2 = x0 - i2 + 2.0 * C.xxxx;
355
- vec4 x3 = x0 - i3 + 3.0 * C.xxxx;
356
- vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;
357
-
358
- // Permutations
359
- i = mod(i, 289.0);
360
- float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);
361
- vec4 j1 = permute( permute( permute( permute (
362
- i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))
363
- + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))
364
- + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))
365
- + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));
366
-
367
- // Gradients
368
- // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)
369
- // 7*7*6 = 294, which is close to the ring size 17*17 = 289.
370
-
371
- vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;
372
-
373
- vec4 p0 = grad4(j0, ip);
374
- vec4 p1 = grad4(j1.x, ip);
375
- vec4 p2 = grad4(j1.y, ip);
376
- vec4 p3 = grad4(j1.z, ip);
377
- vec4 p4 = grad4(j1.w, ip);
378
-
379
- // Normalise gradients
380
- vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
381
- p0 *= norm.x;
382
- p1 *= norm.y;
383
- p2 *= norm.z;
384
- p3 *= norm.w;
385
- p4 *= taylorInvSqrt(dot(p4,p4));
386
-
387
- // Mix contributions from the five corners
388
- vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);
389
- vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);
390
- m0 = m0 * m0;
391
- m1 = m1 * m1;
392
- return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
393
- + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
394
-
395
- }
396
- `, se = `
397
- float scale(float value, float fromMin, float fromMax, float toMin, float toMax) {
398
- return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);
399
- }
400
- `, Ae = `
255
+ */import * as e from "three";
256
+ //#region build/vfx/frame/fragment-shader.js
257
+ var t = "\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform float uOpacity;\n\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float alpha = 1.0;\n float gradient = mix(0.0, 1.0, -vPosition.y + 1.75);\n if(vNoise > 0.3 * gradient) {\n alpha = 0.0;\n }\n float mask = mix(0.3, 1.0, -vPosition.y + 0.5);\n alpha = clamp(alpha * (mask * 10.0), 0.0, 1.0);\n vec3 color = mix(uColor1, uColor2, -vPosition.y + 0.5);\n color.g = color.g * (1.0 + gradient * vNoise);\n gl_FragColor = vec4(color, alpha * uOpacity);\n}\n", n = "\n// Simplex 4D Noise\n// by Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x) {\n return mod((x * 34.0 + 1.0) * x, 289.0);\n}\nfloat permute(float x) {\n return floor( mod((x * 34.0 + 1.0) * x, 289.0) );\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\nfloat simplexNoise(vec4 v) {\n const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4\n 0.309016994374947451); // (sqrt(5) - 1)/4 F4\n // First corner\n vec4 i = floor(v + dot(v, C.yyyy) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C\n vec4 x1 = x0 - i1 + 1.0 * C.xxxx;\n vec4 x2 = x0 - i2 + 2.0 * C.xxxx;\n vec4 x3 = x0 - i3 + 3.0 * C.xxxx;\n vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;\n\n // Permutations\n i = mod(i, 289.0);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients\n // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n", r = "\nfloat scale(float value, float fromMin, float fromMax, float toMin, float toMax) {\n return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);\n}\n", i = `
401
258
  uniform float uTime;
402
259
  uniform float uNoise;
403
260
  uniform float uSpeed;
@@ -405,8 +262,8 @@ uniform float uSpeed;
405
262
  varying vec3 vPosition;
406
263
  varying float vNoise;
407
264
 
408
- `.concat(le, `
409
- `).concat(se, `
265
+ ${n}
266
+ ${r}
410
267
 
411
268
  float fbm(vec4 x) {
412
269
  float v = 0.0;
@@ -429,151 +286,90 @@ void main() {
429
286
 
430
287
  gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);
431
288
  }
432
- `), Pe = new n.SphereBufferGeometry(1, 300, 300), xe = [];
433
- for (var Q = 0; Q < 2; Q++)
434
- xe.push(new n.Vector2(Math.sin(Q) / 2 + 1, Q * 2 - 0.8));
435
- var Te = new n.LatheBufferGeometry(xe, 300), je = (
436
- /** @class */
437
- (function(o) {
438
- Y(i, o);
439
- function i(e) {
440
- var t = o.call(this) || this;
441
- t.needsRender = !0;
442
- var r;
443
- if (e instanceof n.BufferGeometry)
444
- r = e;
445
- else
446
- switch (e) {
447
- case "ring":
448
- r = Te;
449
- break;
450
- case "circle":
451
- default:
452
- r = Pe;
453
- break;
454
- }
455
- t.uniforms = {
456
- uTime: {
457
- value: 0
458
- },
459
- uColor1: {
460
- value: new n.Color("rgb(255, 177, 20)")
461
- },
462
- uColor2: {
463
- value: new n.Color("rgb(255, 0, 0)")
464
- },
465
- uNoise: {
466
- value: 1.2
467
- },
468
- uSpeed: {
469
- value: 1
470
- },
471
- uOpacity: {
472
- value: 1
473
- }
474
- }, t.defines = {
475
- FRAGMENTATION_DEGREE: 2
476
- };
477
- var u = new n.Mesh(r, new n.ShaderMaterial({
478
- uniforms: t.uniforms,
479
- defines: t.defines,
480
- vertexShader: Ae,
481
- fragmentShader: be,
482
- transparent: !0,
483
- depthWrite: !1,
484
- side: n.BackSide
485
- })), a = new n.Mesh(r, new n.ShaderMaterial({
486
- uniforms: t.uniforms,
487
- defines: t.defines,
488
- vertexShader: Ae,
489
- fragmentShader: be,
490
- transparent: !0,
491
- depthWrite: !1,
492
- side: n.FrontSide
493
- }));
494
- return u.scale.setScalar(0.1), a.scale.setScalar(0.1), t.add(u), t.add(a), t;
495
- }
496
- return i.prototype.setTime = function(e) {
497
- this.startTime === void 0 && (this.startTime = e), this.uniforms.uTime.value = (e - this.startTime) / 1e3, this.needsRender = !0;
498
- }, Object.defineProperty(i.prototype, "color1", {
499
- get: function() {
500
- return this.uniforms.uColor1.value;
501
- },
502
- set: function(e) {
503
- this.uniforms.uColor1.value = e, this.needsRender = !0;
504
- },
505
- enumerable: !1,
506
- configurable: !0
507
- }), Object.defineProperty(i.prototype, "color2", {
508
- get: function() {
509
- return this.uniforms.uColor2.value;
510
- },
511
- set: function(e) {
512
- this.uniforms.uColor2.value = e, this.needsRender = !0;
513
- },
514
- enumerable: !1,
515
- configurable: !0
516
- }), Object.defineProperty(i.prototype, "speed", {
517
- get: function() {
518
- return this.uniforms.uSpeed.value;
519
- },
520
- set: function(e) {
521
- this.uniforms.uSpeed.value = e;
522
- },
523
- enumerable: !1,
524
- configurable: !0
525
- }), Object.defineProperty(i.prototype, "noise", {
526
- get: function() {
527
- return this.uniforms.uSpeed.value;
528
- },
529
- set: function(e) {
530
- this.uniforms.uSpeed.value = e, this.needsRender = !0;
531
- },
532
- enumerable: !1,
533
- configurable: !0
534
- }), Object.defineProperty(i.prototype, "opacity", {
535
- get: function() {
536
- return this.uniforms.opacity.value;
537
- },
538
- set: function(e) {
539
- this.uniforms.uOpacity.value = e, this.needsRender = !0;
540
- },
541
- enumerable: !1,
542
- configurable: !0
543
- }), Object.defineProperty(i.prototype, "fragmentationDegree", {
544
- get: function() {
545
- return this.defines.FRAGMENTATION_DEGREE;
546
- },
547
- set: function(e) {
548
- this.defines.FRAGMENTATION_DEGREE = e, this.traverse(function(t) {
549
- t instanceof n.Mesh && t.material instanceof n.ShaderMaterial && (t.material.needsUpdate = !0);
550
- }), this.needsRender = !0;
551
- },
552
- enumerable: !1,
553
- configurable: !0
554
- }), i;
555
- })(n.Group)
556
- ), Me = `
557
- uniform vec3 uLightColor;
558
- uniform vec3 uSpotPosition;
559
- uniform float uAttenuation;
560
- uniform float uAnglePower;
561
-
562
- varying vec3 vNormal;
563
- varying vec3 vWorldPosition;
564
- varying float vNoise;
565
-
566
- void main() {
567
- float intensity;
568
- intensity = distance(vWorldPosition, uSpotPosition) / uAttenuation;
569
- intensity = 1.0 - clamp(intensity, 0.1, 1.0);
570
-
571
- vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));
572
- float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );
573
- intensity = intensity * angleIntensity * vNoise;
574
- gl_FragColor = vec4( uLightColor, intensity );
575
- }
576
- `, ze = `
289
+ `, a = new e.SphereBufferGeometry(1, 300, 300), o = [];
290
+ for (let t = 0; t < 2; t++) o.push(new e.Vector2(Math.sin(t) / 2 + 1, t * 2 - .8));
291
+ var s = new e.LatheBufferGeometry(o, 300), c = class extends e.Group {
292
+ constructor(n) {
293
+ super(), this.needsRender = !0;
294
+ let r;
295
+ if (n instanceof e.BufferGeometry) r = n;
296
+ else switch (n) {
297
+ case "ring":
298
+ r = s;
299
+ break;
300
+ default:
301
+ r = a;
302
+ break;
303
+ }
304
+ this.uniforms = {
305
+ uTime: { value: 0 },
306
+ uColor1: { value: new e.Color("rgb(255, 177, 20)") },
307
+ uColor2: { value: new e.Color("rgb(255, 0, 0)") },
308
+ uNoise: { value: 1.2 },
309
+ uSpeed: { value: 1 },
310
+ uOpacity: { value: 1 }
311
+ }, this.defines = { FRAGMENTATION_DEGREE: 2 };
312
+ let o = new e.Mesh(r, new e.ShaderMaterial({
313
+ uniforms: this.uniforms,
314
+ defines: this.defines,
315
+ vertexShader: i,
316
+ fragmentShader: t,
317
+ transparent: !0,
318
+ depthWrite: !1,
319
+ side: e.BackSide
320
+ })), c = new e.Mesh(r, new e.ShaderMaterial({
321
+ uniforms: this.uniforms,
322
+ defines: this.defines,
323
+ vertexShader: i,
324
+ fragmentShader: t,
325
+ transparent: !0,
326
+ depthWrite: !1,
327
+ side: e.FrontSide
328
+ }));
329
+ o.scale.setScalar(.1), c.scale.setScalar(.1), this.add(o), this.add(c);
330
+ }
331
+ setTime(e) {
332
+ this.startTime === void 0 && (this.startTime = e), this.uniforms.uTime.value = (e - this.startTime) / 1e3, this.needsRender = !0;
333
+ }
334
+ set color1(e) {
335
+ this.uniforms.uColor1.value = e, this.needsRender = !0;
336
+ }
337
+ get color1() {
338
+ return this.uniforms.uColor1.value;
339
+ }
340
+ set color2(e) {
341
+ this.uniforms.uColor2.value = e, this.needsRender = !0;
342
+ }
343
+ get color2() {
344
+ return this.uniforms.uColor2.value;
345
+ }
346
+ set speed(e) {
347
+ this.uniforms.uSpeed.value = e;
348
+ }
349
+ get speed() {
350
+ return this.uniforms.uSpeed.value;
351
+ }
352
+ set noise(e) {
353
+ this.uniforms.uSpeed.value = e, this.needsRender = !0;
354
+ }
355
+ get noise() {
356
+ return this.uniforms.uSpeed.value;
357
+ }
358
+ set opacity(e) {
359
+ this.uniforms.uOpacity.value = e, this.needsRender = !0;
360
+ }
361
+ get opacity() {
362
+ return this.uniforms.opacity.value;
363
+ }
364
+ set fragmentationDegree(t) {
365
+ this.defines.FRAGMENTATION_DEGREE = t, this.traverse((t) => {
366
+ t instanceof e.Mesh && t.material instanceof e.ShaderMaterial && (t.material.needsUpdate = !0);
367
+ }), this.needsRender = !0;
368
+ }
369
+ get fragmentationDegree() {
370
+ return this.defines.FRAGMENTATION_DEGREE;
371
+ }
372
+ }, l = "\nuniform vec3 uLightColor;\nuniform vec3 uSpotPosition;\nuniform float uAttenuation;\nuniform float uAnglePower;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\nvoid main() {\n float intensity;\n intensity = distance(vWorldPosition, uSpotPosition) / uAttenuation;\n intensity = 1.0 - clamp(intensity, 0.1, 1.0);\n\n vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );\n intensity = intensity * angleIntensity * vNoise;\n gl_FragColor = vec4( uLightColor, intensity );\n}\n", u = `
577
373
 
578
374
  uniform float uTime;
579
375
 
@@ -581,8 +377,8 @@ varying vec3 vNormal;
581
377
  varying vec3 vWorldPosition;
582
378
  varying float vNoise;
583
379
 
584
- `.concat(le, `
585
- `).concat(se, `
380
+ ${n}
381
+ ${r}
586
382
 
587
383
  void main(){
588
384
 
@@ -594,84 +390,49 @@ void main(){
594
390
 
595
391
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
596
392
  }
597
- `), Ge = (
598
- /** @class */
599
- (function(o) {
600
- Y(i, o);
601
- function i(e, t, r) {
602
- e === void 0 && (e = 1), t === void 0 && (t = 0.1), r === void 0 && (r = 0.2);
603
- var u = o.call(this) || this;
604
- u.needsRender = !0, u.uniforms = {
605
- uTime: {
606
- value: 0
607
- },
608
- uAttenuation: {
609
- value: e * 0.9
610
- },
611
- uAnglePower: {
612
- value: 2
613
- },
614
- uSpotPosition: {
615
- value: u.position
616
- },
617
- uLightColor: {
618
- value: new n.Color(16777215)
619
- }
620
- };
621
- var a = new n.CylinderBufferGeometry(t, r, e, 64, 20, !0);
622
- a.applyMatrix4(new n.Matrix4().makeTranslation(0, -e / 2, 0)), a.applyMatrix4(new n.Matrix4().makeRotationX(-Math.PI / 2));
623
- var s = new n.Mesh(a, new n.ShaderMaterial({
624
- uniforms: u.uniforms,
625
- vertexShader: ze,
626
- fragmentShader: Me,
627
- transparent: !0,
628
- side: n.FrontSide,
629
- depthWrite: !1
630
- }));
631
- return u.add(s), u;
632
- }
633
- return i.prototype.setTime = function(e) {
634
- this.startTime === void 0 && (this.startTime = e), this.uniforms.uTime.value = (e - this.startTime) / 1e3, this.needsRender = !0;
635
- }, Object.defineProperty(i.prototype, "attenuation", {
636
- get: function() {
637
- return this.uniforms.uAttenuation.value;
638
- },
639
- set: function(e) {
640
- this.uniforms.uAttenuation.value = e, this.needsRender = !0;
641
- },
642
- enumerable: !1,
643
- configurable: !0
644
- }), Object.defineProperty(i.prototype, "anglePower", {
645
- get: function() {
646
- return this.uniforms.uAnglePower.value;
647
- },
648
- set: function(e) {
649
- this.uniforms.uAnglePower.value = e, this.needsRender = !0;
650
- },
651
- enumerable: !1,
652
- configurable: !0
653
- }), Object.defineProperty(i.prototype, "color", {
654
- get: function() {
655
- return this.uniforms.uLightColor.value;
656
- },
657
- set: function(e) {
658
- this.uniforms.uLightColor.value = e, this.needsRender = !0;
659
- },
660
- enumerable: !1,
661
- configurable: !0
662
- }), i;
663
- })(n.Group)
664
- ), Se = `
665
- uniform vec3 uColor;
666
- uniform float uOpacity;
667
- varying vec3 vPosition;
668
- varying float vNoise;
669
-
670
- void main() {
671
- float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);
672
- gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);
673
- }
674
- `, we = `
393
+ `, d = class extends e.Group {
394
+ constructor(t = 1, n = .1, r = .2) {
395
+ super(), this.needsRender = !0, this.uniforms = {
396
+ uTime: { value: 0 },
397
+ uAttenuation: { value: t * .9 },
398
+ uAnglePower: { value: 2 },
399
+ uSpotPosition: { value: this.position },
400
+ uLightColor: { value: new e.Color(16777215) }
401
+ };
402
+ let i = new e.CylinderBufferGeometry(n, r, t, 64, 20, !0);
403
+ i.applyMatrix4(new e.Matrix4().makeTranslation(0, -t / 2, 0)), i.applyMatrix4(new e.Matrix4().makeRotationX(-Math.PI / 2));
404
+ let a = new e.Mesh(i, new e.ShaderMaterial({
405
+ uniforms: this.uniforms,
406
+ vertexShader: u,
407
+ fragmentShader: l,
408
+ transparent: !0,
409
+ side: e.FrontSide,
410
+ depthWrite: !1
411
+ }));
412
+ this.add(a);
413
+ }
414
+ setTime(e) {
415
+ this.startTime === void 0 && (this.startTime = e), this.uniforms.uTime.value = (e - this.startTime) / 1e3, this.needsRender = !0;
416
+ }
417
+ set attenuation(e) {
418
+ this.uniforms.uAttenuation.value = e, this.needsRender = !0;
419
+ }
420
+ get attenuation() {
421
+ return this.uniforms.uAttenuation.value;
422
+ }
423
+ set anglePower(e) {
424
+ this.uniforms.uAnglePower.value = e, this.needsRender = !0;
425
+ }
426
+ get anglePower() {
427
+ return this.uniforms.uAnglePower.value;
428
+ }
429
+ set color(e) {
430
+ this.uniforms.uLightColor.value = e, this.needsRender = !0;
431
+ }
432
+ get color() {
433
+ return this.uniforms.uLightColor.value;
434
+ }
435
+ }, f = "\nuniform vec3 uColor;\nuniform float uOpacity;\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);\n gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);\n}\n", p = `
675
436
 
676
437
  uniform float uTime;
677
438
  uniform float uSpeed;
@@ -680,8 +441,8 @@ uniform float uExpand;
680
441
  varying float vNoise;
681
442
  varying vec3 vPosition;
682
443
 
683
- `.concat(le, `
684
- `).concat(se, `
444
+ ${n}
445
+ ${r}
685
446
 
686
447
  void main(){
687
448
 
@@ -694,544 +455,327 @@ void main(){
694
455
 
695
456
  gl_Position = projectionMatrix * modelViewMatrix * transformed;
696
457
  }
697
- `), ue = new n.PlaneBufferGeometry(1, 1, 200, 200);
698
- ue.translate(0, -0.5, 0);
699
- var Ie = (
700
- /** @class */
701
- (function(o) {
702
- Y(i, o);
703
- function i() {
704
- var e = o.call(this) || this;
705
- e.needsRender = !0;
706
- var t = e.outer = new n.Mesh(ue, new n.ShaderMaterial({
707
- uniforms: {
708
- uTime: {
709
- value: 0
710
- },
711
- uSpeed: {
712
- value: 0.75
713
- },
714
- uScale: {
715
- value: 2
716
- },
717
- uExpand: {
718
- value: 1.2
719
- },
720
- uColor: {
721
- value: new n.Color(0.5, 0.5, 0.9)
722
- },
723
- uOpacity: {
724
- value: 1
725
- }
726
- },
727
- vertexShader: we,
728
- fragmentShader: Se,
729
- transparent: !0,
730
- side: n.DoubleSide,
731
- depthWrite: !1
732
- })), r = e.inner = new n.Mesh(ue, new n.ShaderMaterial({
733
- uniforms: {
734
- uTime: {
735
- value: 0
736
- },
737
- uSpeed: {
738
- value: 2
739
- },
740
- uScale: {
741
- value: 20
742
- },
743
- uExpand: {
744
- value: 1.2
745
- },
746
- uColor: {
747
- value: new n.Color(1, 1, 1)
748
- },
749
- uOpacity: {
750
- value: 0.1
751
- }
752
- },
753
- vertexShader: we,
754
- fragmentShader: Se,
755
- transparent: !0,
756
- side: n.DoubleSide,
757
- depthWrite: !1
758
- }));
759
- return t.rotateX(-Math.PI / 2), r.rotateX(-Math.PI / 2), e.add(t), e.add(r), e;
760
- }
761
- return i.prototype.setTime = function(e) {
762
- this.startTime === void 0 && (this.startTime = e);
763
- var t = (e - this.startTime) / 1e3;
764
- this.inner.material.uniforms.uTime.value = t, this.outer.material.uniforms.uTime.value = t, this.needsRender = !0;
765
- }, Object.defineProperty(i.prototype, "expand", {
766
- get: function() {
767
- return this.outer.material.uniforms.uExpand.value;
768
- },
769
- set: function(e) {
770
- this.outer.material.uniforms.uExpand.value = e, this.inner.material.uniforms.uExpand.value = e, this.needsRender = !0;
771
- },
772
- enumerable: !1,
773
- configurable: !0
774
- }), Object.defineProperty(i.prototype, "speed", {
775
- get: function() {
776
- return this.inner.material.uniforms.speed.value;
777
- },
778
- set: function(e) {
779
- this.inner.material.uniforms.speed.value = e, this.needsRender = !0;
780
- },
781
- enumerable: !1,
782
- configurable: !0
783
- }), Object.defineProperty(i.prototype, "color", {
784
- get: function() {
785
- return this.outer.material.uniforms.color.value;
786
- },
787
- set: function(e) {
788
- this.outer.material.uniforms.color.value = e, this.needsRender = !0;
789
- },
790
- enumerable: !1,
791
- configurable: !0
792
- }), Object.defineProperty(i.prototype, "flowColor", {
793
- get: function() {
794
- return this.inner.material.uniforms.color.value;
795
- },
796
- set: function(e) {
797
- this.inner.material.uniforms.color.value = e, this.needsRender = !0;
798
- },
799
- enumerable: !1,
800
- configurable: !0
801
- }), i;
802
- })(n.Group)
803
- );
804
- function q(o, i) {
805
- return o + i * (Math.random() - 0.5);
806
- }
807
- function K(o, i) {
808
- var e = new n.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
809
- return new n.Vector3().addVectors(o, new n.Vector3().multiplyVectors(i, e));
810
- }
811
- function te(o, i, e) {
812
- return o * e + i * e * e / 2;
813
- }
814
- function Ve(o, i, e) {
815
- return new n.Vector3(te(o.x, i.x, e), te(o.y, i.y, e), te(o.z, i.z, e));
816
- }
817
- function oe(o, i) {
818
- for (var e = o.times.length, t = 0; t < e && i > o.times[t]; )
819
- t++;
820
- if (t == 0)
821
- return o.values[0];
822
- if (t == e)
823
- return o.values[e - 1];
824
- var r = (i - o.times[t - 1]) / (o.times[t] - o.times[t - 1]), u = o.values[t - 1], a = o.values[t];
825
- return typeof o.values[0] == "number" ? u + r * (a - u) : u.clone().lerp(a, r);
826
- }
827
- var De = (
828
- /** @class */
829
- (function() {
830
- function o(i, e, t, r, u, a, s, c, f, m, h, d, y, b) {
831
- this.birthTime = i, this.deathAge = e, this.position = t.clone(), this.velocity = r.clone(), this.acceleration = u.clone(), this.angle = a, this.angleVelocity = s, this.angleAcceleration = c, this.color = f, this.colorTween = m, this.size = h, this.sizeTween = d, this.opacity = y, this.opacityTween = b;
832
- }
833
- return o.prototype.getAlive = function(i) {
834
- return this.deathAge > i - this.birthTime;
835
- }, o.prototype.getState = function(i) {
836
- var e = this.getAlive(i), t = Math.min(this.deathAge, i - this.birthTime), r = Ve(this.velocity, this.acceleration, t).add(this.position), u = te(this.angleVelocity, this.angleAcceleration, t) + this.angle, a = (this.sizeTween ? oe(this.sizeTween, t) : 0) + this.size, s = (this.colorTween ? oe(this.colorTween, t) : new n.Vector3()).add(this.color), c = new n.Color().setHSL(s.x, s.y, s.z), f = (this.opacityTween ? oe(this.opacityTween, t) : 0) + this.opacity;
837
- return { alive: e, age: t, position: r, angle: u, size: a, color: c, opacity: f };
838
- }, o;
839
- })()
840
- ), Re = `
841
- attribute vec3 color;
842
- attribute float opacity;
843
- attribute float size;
844
- attribute float alive; // float used as boolean (0 = false, 1 = true)
845
-
846
- varying vec4 vColor;
847
-
848
- #if defined(USE_MAP)
849
- attribute float angle;
850
- varying float vAngle;
851
- #endif
852
-
853
- void main() {
854
- if (alive > 0.5) {
855
- vColor = vec4(color, opacity);
856
- } else {
857
- vColor = vec4(0.0, 0.0, 0.0, 0.0);
858
- }
859
- #if defined(USE_MAP)
860
- vAngle = angle;
861
- #endif
862
- vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
863
- gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );
864
- gl_Position = projectionMatrix * mvPosition;
865
- }
866
- `, Ne = `
867
- varying vec4 vColor;
868
-
869
- #if defined(USE_MAP)
870
- uniform sampler2D map;
871
- varying float vAngle;
872
- #endif
873
-
874
- void main() {
875
- gl_FragColor = vColor;
876
-
877
- #if defined(USE_MAP)
878
- float c = cos(vAngle);
879
- float s = sin(vAngle);
880
-
881
- // rotate UV coordinates to rotate texture
882
- vec2 rotatedUV = vec2(
883
- c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,
884
- c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5
885
- );
886
- vec4 rotatedTexture = texture2D(map, rotatedUV);
887
- gl_FragColor = vColor * rotatedTexture;
888
- #endif
458
+ `, m = new e.PlaneBufferGeometry(1, 1, 200, 200);
459
+ m.translate(0, -.5, 0);
460
+ var h = class extends e.Group {
461
+ constructor() {
462
+ super(), this.needsRender = !0;
463
+ let t = this.outer = new e.Mesh(m, new e.ShaderMaterial({
464
+ uniforms: {
465
+ uTime: { value: 0 },
466
+ uSpeed: { value: .75 },
467
+ uScale: { value: 2 },
468
+ uExpand: { value: 1.2 },
469
+ uColor: { value: new e.Color(.5, .5, .9) },
470
+ uOpacity: { value: 1 }
471
+ },
472
+ vertexShader: p,
473
+ fragmentShader: f,
474
+ transparent: !0,
475
+ side: e.DoubleSide,
476
+ depthWrite: !1
477
+ })), n = this.inner = new e.Mesh(m, new e.ShaderMaterial({
478
+ uniforms: {
479
+ uTime: { value: 0 },
480
+ uSpeed: { value: 2 },
481
+ uScale: { value: 20 },
482
+ uExpand: { value: 1.2 },
483
+ uColor: { value: new e.Color(1, 1, 1) },
484
+ uOpacity: { value: .1 }
485
+ },
486
+ vertexShader: p,
487
+ fragmentShader: f,
488
+ transparent: !0,
489
+ side: e.DoubleSide,
490
+ depthWrite: !1
491
+ }));
492
+ t.rotateX(-Math.PI / 2), n.rotateX(-Math.PI / 2), this.add(t), this.add(n);
493
+ }
494
+ setTime(e) {
495
+ this.startTime === void 0 && (this.startTime = e);
496
+ let t = (e - this.startTime) / 1e3;
497
+ this.inner.material.uniforms.uTime.value = t, this.outer.material.uniforms.uTime.value = t, this.needsRender = !0;
498
+ }
499
+ get expand() {
500
+ return this.outer.material.uniforms.uExpand.value;
501
+ }
502
+ set expand(e) {
503
+ this.outer.material.uniforms.uExpand.value = e, this.inner.material.uniforms.uExpand.value = e, this.needsRender = !0;
504
+ }
505
+ get speed() {
506
+ return this.inner.material.uniforms.speed.value;
507
+ }
508
+ set speed(e) {
509
+ this.inner.material.uniforms.speed.value = e, this.needsRender = !0;
510
+ }
511
+ get color() {
512
+ return this.outer.material.uniforms.color.value;
513
+ }
514
+ set color(e) {
515
+ this.outer.material.uniforms.color.value = e, this.needsRender = !0;
516
+ }
517
+ get flowColor() {
518
+ return this.inner.material.uniforms.color.value;
519
+ }
520
+ set flowColor(e) {
521
+ this.inner.material.uniforms.color.value = e, this.needsRender = !0;
522
+ }
523
+ };
524
+ //#endregion
525
+ //#region build/vfx/particle/utils.js
526
+ function g(e, t) {
527
+ return e + t * (Math.random() - .5);
889
528
  }
890
- `, Xe = (
891
- /** @class */
892
- (function(o) {
893
- Y(i, o);
894
- function i(e) {
895
- var t = this, r, u, a, s, c, f, m, h, d, y, b, S, g, _, C, B, E, F, P, T, M, z, V, D, R, N, U, O, j, G, I, X, H, k, v, p, w, x, A = new n.BufferGeometry();
896
- A.setAttribute("position", new n.BufferAttribute(new Float32Array(), 3)), A.setAttribute("alive", new n.BufferAttribute(new Float32Array(), 1)), A.setAttribute("color", new n.BufferAttribute(new Float32Array(), 3)), A.setAttribute("opacity", new n.BufferAttribute(new Float32Array(), 1)), A.setAttribute("size", new n.BufferAttribute(new Float32Array(), 1)), A.setAttribute("angle", new n.BufferAttribute(new Float32Array(), 1));
897
- var Z = new n.ShaderMaterial({
898
- uniforms: {
899
- map: { value: (r = e.texture) !== null && r !== void 0 ? r : null }
900
- },
901
- defines: {
902
- USE_MAP: !!e.texture
903
- },
904
- vertexShader: Re,
905
- fragmentShader: Ne,
906
- transparent: !0,
907
- blending: (u = e.blending) !== null && u !== void 0 ? u : n.NormalBlending,
908
- depthWrite: !1
909
- });
910
- return t = o.call(this, A, Z) || this, t.instances = [], t.needsRender = !0, t.birthTime = Date.now() / 1e3, t.disposed = !1, t.paused = !1, t.positionBase = (s = (a = e.positionBase) === null || a === void 0 ? void 0 : a.clone()) !== null && s !== void 0 ? s : new n.Vector3(), t.positionStyle = (c = e.positionStyle) !== null && c !== void 0 ? c : "CUBE", t.positionCubeSpread = (m = (f = e.positionCubeSpread) === null || f === void 0 ? void 0 : f.clone()) !== null && m !== void 0 ? m : new n.Vector3(), t.positionSphereSpread = (h = e.positionSphereSpread) !== null && h !== void 0 ? h : 0, t.velocityStyle = (d = e.velocityStyle) !== null && d !== void 0 ? d : "CUBE", t.velocityCubeBase = (b = (y = e.velocityCubeBase) === null || y === void 0 ? void 0 : y.clone()) !== null && b !== void 0 ? b : new n.Vector3(), t.velocityCubeSpread = (g = (S = e.velocityCubeSpread) === null || S === void 0 ? void 0 : S.clone()) !== null && g !== void 0 ? g : new n.Vector3(), t.velocitySphereBase = (_ = e.velocitySphereBase) !== null && _ !== void 0 ? _ : 0, t.velocitySphereSpread = (C = e.velocitySphereSpread) !== null && C !== void 0 ? C : 0, t.accelerationBase = (E = (B = e.accelerationBase) === null || B === void 0 ? void 0 : B.clone()) !== null && E !== void 0 ? E : new n.Vector3(), t.accelerationSpread = (P = (F = e.accelerationSpread) === null || F === void 0 ? void 0 : F.clone()) !== null && P !== void 0 ? P : new n.Vector3(), t.angleBase = (T = e.angleBase) !== null && T !== void 0 ? T : 0, t.angleSpread = (M = e.angleSpread) !== null && M !== void 0 ? M : 0, t.angleVelocityBase = (z = e.angleVelocityBase) !== null && z !== void 0 ? z : 0, t.angleVelocitySpread = (V = e.angleVelocitySpread) !== null && V !== void 0 ? V : 0, t.angleAccelerationBase = (D = e.angleAccelerationBase) !== null && D !== void 0 ? D : 0, t.angleAccelerationSpread = (R = e.angleAccelerationSpread) !== null && R !== void 0 ? R : 0, t.sizeBase = (N = e.sizeBase) !== null && N !== void 0 ? N : 0.1, t.sizeSpread = (U = e.sizeSpread) !== null && U !== void 0 ? U : 0, t.sizeTween = (O = e.sizeTween) !== null && O !== void 0 ? O : null, t.colorBase = (G = (j = e.colorBase) === null || j === void 0 ? void 0 : j.clone()) !== null && G !== void 0 ? G : new n.Vector3(), t.colorSpread = (X = (I = e.colorSpread) === null || I === void 0 ? void 0 : I.clone()) !== null && X !== void 0 ? X : new n.Vector3(), t.colorTween = (H = e.colorTween) !== null && H !== void 0 ? H : null, t.opacityBase = ((k = e.opacityBase) !== null && k !== void 0 ? k : e.opacityTween) ? 0 : 1, t.opacitySpread = (v = e.opacitySpread) !== null && v !== void 0 ? v : 0, t.opacityTween = (p = e.opacityTween) !== null && p !== void 0 ? p : null, t.particlesPerSecond = (w = e.particlesPerSecond) !== null && w !== void 0 ? w : 60, t.particleDeathAge = (x = e.particleDeathAge) !== null && x !== void 0 ? x : 1, t;
911
- }
912
- return Object.defineProperty(i.prototype, "texture", {
913
- /** 贴图素材 */
914
- get: function() {
915
- return this.material.uniforms.map.value;
916
- },
917
- set: function(e) {
918
- this.material.uniforms.map.value = e, e === null ? this.material.defines.USE_MAP !== !1 && (this.material.defines.USE_MAP = !1, this.material.needsUpdate = !0) : this.material.defines.USE_MAP !== !0 && (this.material.defines.USE_MAP = !0, this.material.needsUpdate = !0);
919
- },
920
- enumerable: !1,
921
- configurable: !0
922
- }), Object.defineProperty(i.prototype, "blending", {
923
- /** 材质混合方式 */
924
- get: function() {
925
- return this.material.blending;
926
- },
927
- set: function(e) {
928
- this.material.blending = e;
929
- },
930
- enumerable: !1,
931
- configurable: !0
932
- }), i.prototype.createInstance = function(e) {
933
- var t = this.positionBase.clone();
934
- switch (this.positionStyle) {
935
- case "CUBE": {
936
- t = K(this.positionBase, this.positionCubeSpread);
937
- break;
938
- }
939
- case "SPHERE": {
940
- var r = 2 * Math.random() - 1, u = Math.PI * 2 * Math.random(), a = Math.sqrt(1 - r * r), s = new n.Vector3(a * Math.cos(u), a * Math.sin(u), r);
941
- t = new n.Vector3().addVectors(this.positionBase, s.multiplyScalar(this.positionSphereSpread));
942
- break;
943
- }
944
- }
945
- var c = new n.Vector3();
946
- switch (this.velocityStyle) {
947
- case "CUBE": {
948
- c = K(this.velocityCubeBase, this.velocityCubeSpread);
949
- break;
950
- }
951
- case "SPHERE": {
952
- var f = new n.Vector3().subVectors(t, this.positionBase), m = q(this.velocitySphereBase, this.velocitySphereSpread);
953
- c = f.normalize().multiplyScalar(m);
954
- break;
955
- }
956
- }
957
- var h = new De(e, this.particleDeathAge, t, c, K(this.accelerationBase, this.accelerationSpread), q(this.angleBase, this.angleSpread), q(this.angleVelocityBase, this.angleVelocitySpread), q(this.angleAccelerationBase, this.angleAccelerationSpread), K(this.colorBase, this.colorSpread), this.colorTween, q(this.sizeBase, this.sizeSpread), this.sizeTween, q(this.opacityBase, this.opacitySpread), this.opacityTween);
958
- return h;
959
- }, i.prototype.pause = function() {
960
- this.paused !== !0 && (this.paused = !0, this.birthTime = Date.now() / 1e3);
961
- }, i.prototype.play = function() {
962
- this.paused !== !1 && (this.paused = !1, this.birthTime = Date.now() / 1e3);
963
- }, i.prototype.setTime = function(e) {
964
- if (!this.disposed) {
965
- e /= 1e3;
966
- var t = e - this.birthTime, r = Math.ceil(this.particlesPerSecond * this.particleDeathAge);
967
- if (this.geometry.attributes.position.count < r) {
968
- var u = new Float32Array(r * 3);
969
- u.set(this.geometry.attributes.position.array, 0);
970
- var a = new n.BufferAttribute(u, 3);
971
- a.needsUpdate = !0, this.geometry.setAttribute("position", a);
972
- }
973
- if (this.geometry.attributes.alive.count < r) {
974
- var s = new Float32Array(r);
975
- s.set(this.geometry.attributes.alive.array, 0);
976
- var a = new n.BufferAttribute(s, 1);
977
- a.needsUpdate = !0, this.geometry.setAttribute("alive", a);
978
- }
979
- if (this.geometry.attributes.color.count < r) {
980
- var c = new Float32Array(r * 3);
981
- c.set(this.geometry.attributes.color.array, 0);
982
- var a = new n.BufferAttribute(c, 3);
983
- a.needsUpdate = !0, this.geometry.setAttribute("color", a);
984
- }
985
- if (this.geometry.attributes.opacity.count < r) {
986
- var f = new Float32Array(r);
987
- f.set(this.geometry.attributes.opacity.array, 0);
988
- var a = new n.BufferAttribute(f, 1);
989
- a.needsUpdate = !0, this.geometry.setAttribute("opacity", a);
990
- }
991
- if (this.geometry.attributes.size.count < r) {
992
- var m = new Float32Array(r);
993
- m.set(this.geometry.attributes.size.array, 0);
994
- var a = new n.BufferAttribute(m, 1);
995
- a.needsUpdate = !0, this.geometry.setAttribute("size", a);
996
- }
997
- if (this.geometry.attributes.angle.count < r) {
998
- var h = new Float32Array(r);
999
- h.set(this.geometry.attributes.angle.array, 0);
1000
- var a = new n.BufferAttribute(h, 1);
1001
- a.needsUpdate = !0, this.geometry.setAttribute("angle", a);
1002
- }
1003
- this.instances.length < r && (this.instances.length = r);
1004
- for (var d = 0; d < this.instances.length; d++) {
1005
- var y = this.instances[d];
1006
- if (d < r && this.paused === !1 && (y === void 0 || y.getAlive(e) === !1)) {
1007
- var b = this.particleDeathAge / r * d;
1008
- if (t > b) {
1009
- var S = e - (t - b) % this.particleDeathAge;
1010
- this.instances[d] = y = this.createInstance(S);
1011
- }
1012
- }
1013
- if (y) {
1014
- var g = y.getState(e), u = g.position, s = g.alive, c = g.color, f = g.opacity, m = g.size, h = g.angle;
1015
- this.geometry.attributes.position.setXYZ(d, u.x, u.y, u.z), this.geometry.attributes.position.needsUpdate = !0, this.geometry.attributes.alive.setX(d, s ? 1 : 0), this.geometry.attributes.alive.needsUpdate = !0, this.geometry.attributes.color.setXYZ(d, c.r, c.g, c.b), this.geometry.attributes.color.needsUpdate = !0, this.geometry.attributes.opacity.setX(d, f), this.geometry.attributes.opacity.needsUpdate = !0, this.geometry.attributes.size.setX(d, m), this.geometry.attributes.size.needsUpdate = !0, this.geometry.attributes.angle.setX(d, h), this.geometry.attributes.angle.needsUpdate = !0;
1016
- }
1017
- }
1018
- this.geometry.computeBoundingBox(), this.geometry.boundingSphere || (this.geometry.boundingSphere = new n.Sphere()), this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere), this.needsRender = !0;
1019
- }
1020
- }, i.prototype.dispose = function() {
1021
- var e;
1022
- this.disposed = !0, this.geometry.dispose(), (e = this.texture) === null || e === void 0 || e.dispose(), this.material.dispose();
1023
- }, i;
1024
- })(n.Points)
1025
- );
1026
- function $(o, i) {
1027
- return o + i * (Math.random() - 0.5);
529
+ function _(t, n) {
530
+ let r = new e.Vector3(Math.random() - .5, Math.random() - .5, Math.random() - .5);
531
+ return new e.Vector3().addVectors(t, new e.Vector3().multiplyVectors(n, r));
1028
532
  }
1029
- function ee(o, i) {
1030
- var e = new n.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
1031
- return new n.Vector3().addVectors(o, new n.Vector3().multiplyVectors(i, e));
533
+ function v(e, t, n) {
534
+ return e * n + t * n * n / 2;
1032
535
  }
1033
- var Ue = `
1034
- // 粒子初始属性
1035
- attribute vec3 initialVelocity;
1036
- attribute vec3 acceleration;
1037
- attribute float birthTime;
1038
- attribute float lifeTime;
1039
- attribute float initialSize;
1040
- attribute float sizeGrowth;
1041
- attribute vec3 initialColor;
1042
- attribute float initialOpacity;
1043
- attribute float initialAngle;
1044
- attribute float angleVelocity;
1045
- attribute float particleIndex;
1046
-
1047
- // 全局uniform参数
1048
- uniform float uTime;
1049
-
1050
- // 传递给fragment shader的变量
1051
- varying vec4 vColor;
1052
- varying float vAngle;
1053
-
1054
- // 简单噪声函数
1055
- float random(vec2 st) {
1056
- return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
536
+ function y(t, n, r) {
537
+ return new e.Vector3(v(t.x, n.x, r), v(t.y, n.y, r), v(t.z, n.z, r));
1057
538
  }
1058
-
1059
- // HSL转RGB函数
1060
- vec3 hsl2rgb(vec3 c) {
1061
- vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0), 6.0)-3.0)-1.0, 0.0, 1.0);
1062
- return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
539
+ function b(e, t) {
540
+ let n = e.times.length, r = 0;
541
+ for (; r < n && t > e.times[r];) r++;
542
+ if (r == 0) return e.values[0];
543
+ if (r == n) return e.values[n - 1];
544
+ let i = (t - e.times[r - 1]) / (e.times[r] - e.times[r - 1]), a = e.values[r - 1], o = e.values[r];
545
+ return typeof e.values[0] == "number" ? a + i * (o - a) : a.clone().lerp(o, i);
1063
546
  }
1064
-
1065
- void main() {
1066
- // 计算粒子的实际年龄,考虑循环重生
1067
- float totalCycleTime = lifeTime;
1068
- float adjustedTime = uTime + birthTime;
1069
- float cycleTime = mod(adjustedTime, totalCycleTime);
1070
- float age = cycleTime;
1071
- float normalizedAge = clamp(age / lifeTime, 0.0, 1.0);
1072
-
1073
- // 如果粒子年龄超过生命周期,让它重新开始
1074
- if (age > lifeTime) {
1075
- age = 0.0;
1076
- normalizedAge = 0.0;
1077
- }
1078
-
1079
- // 计算当前位置(物理模拟)
1080
- vec3 currentVelocity = initialVelocity + acceleration * age;
1081
-
1082
- vec3 currentPosition = position + currentVelocity * age;
1083
-
1084
- // 计算当前大小(随时间变化)
1085
- float currentSize = initialSize + sizeGrowth * normalizedAge;
1086
-
1087
- // 计算当前角度
1088
- vAngle = initialAngle + angleVelocity * age;
1089
-
1090
- // 计算当前颜色和透明度(生命周期渐变)
1091
- vec3 currentColor = initialColor;
1092
- float currentOpacity = initialOpacity;
1093
-
1094
- // 生命周期透明度渐变(出生和死亡时渐变)
1095
- if (normalizedAge < 0.1) {
1096
- currentOpacity *= normalizedAge / 0.1; // 淡入
1097
- } else if (normalizedAge > 0.8) {
1098
- currentOpacity *= (1.0 - normalizedAge) / 0.2; // 淡出
1099
- }
1100
-
1101
- // 将HSL颜色转换为RGB
1102
- vec3 rgbColor = hsl2rgb(currentColor);
1103
- vColor = vec4(rgbColor, currentOpacity);
1104
-
1105
- // 计算最终位置和大小
1106
- vec4 mvPosition = modelViewMatrix * vec4(currentPosition, 1.0);
1107
- gl_PointSize = currentSize * (300.0 / length(mvPosition.xyz));
1108
- gl_Position = projectionMatrix * mvPosition;
547
+ //#endregion
548
+ //#region build/vfx/particle/instance.js
549
+ var x = class {
550
+ constructor(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
551
+ this.birthTime = e, this.deathAge = t, this.position = n.clone(), this.velocity = r.clone(), this.acceleration = i.clone(), this.angle = a, this.angleVelocity = o, this.angleAcceleration = s, this.color = c, this.colorTween = l, this.size = u, this.sizeTween = d, this.opacity = f, this.opacityTween = p;
552
+ }
553
+ getAlive(e) {
554
+ return this.deathAge > e - this.birthTime;
555
+ }
556
+ getState(t) {
557
+ let n = this.getAlive(t), r = Math.min(this.deathAge, t - this.birthTime), i = y(this.velocity, this.acceleration, r).add(this.position), a = v(this.angleVelocity, this.angleAcceleration, r) + this.angle, o = (this.sizeTween ? b(this.sizeTween, r) : 0) + this.size, s = (this.colorTween ? b(this.colorTween, r) : new e.Vector3()).add(this.color);
558
+ return {
559
+ alive: n,
560
+ age: r,
561
+ position: i,
562
+ angle: a,
563
+ size: o,
564
+ color: new e.Color().setHSL(s.x, s.y, s.z),
565
+ opacity: (this.opacityTween ? b(this.opacityTween, r) : 0) + this.opacity
566
+ };
567
+ }
568
+ }, S = "\nattribute vec3 color;\nattribute float opacity;\nattribute float size;\nattribute float alive; // float used as boolean (0 = false, 1 = true)\n\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n attribute float angle;\n varying float vAngle;\n#endif\n\nvoid main() {\n if (alive > 0.5) {\n vColor = vec4(color, opacity);\n } else {\n vColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n #if defined(USE_MAP)\n vAngle = angle;\n #endif\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );\n gl_Position = projectionMatrix * mvPosition;\n}\n", C = "\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n varying float vAngle;\n#endif\n\nvoid main() {\n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // rotate UV coordinates to rotate texture\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n vec4 rotatedTexture = texture2D(map, rotatedUV);\n gl_FragColor = vColor * rotatedTexture;\n #endif\n}\n", w = class extends e.Points {
569
+ constructor(t) {
570
+ var n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, w, T, E, D, O, k, A, j, M, N, P, F, I, L, R, z, B, V;
571
+ let H = new e.BufferGeometry();
572
+ H.setAttribute("position", new e.BufferAttribute(new Float32Array(), 3)), H.setAttribute("alive", new e.BufferAttribute(new Float32Array(), 1)), H.setAttribute("color", new e.BufferAttribute(new Float32Array(), 3)), H.setAttribute("opacity", new e.BufferAttribute(new Float32Array(), 1)), H.setAttribute("size", new e.BufferAttribute(new Float32Array(), 1)), H.setAttribute("angle", new e.BufferAttribute(new Float32Array(), 1));
573
+ let U = new e.ShaderMaterial({
574
+ uniforms: { map: { value: (n = t.texture) == null ? null : n } },
575
+ defines: { USE_MAP: !!t.texture },
576
+ vertexShader: S,
577
+ fragmentShader: C,
578
+ transparent: !0,
579
+ blending: (r = t.blending) == null ? e.NormalBlending : r,
580
+ depthWrite: !1
581
+ });
582
+ super(H, U), this.instances = [], this.needsRender = !0, this.birthTime = Date.now() / 1e3, this.disposed = !1, this.paused = !1, this.positionBase = (a = (i = t.positionBase) == null ? void 0 : i.clone()) == null ? new e.Vector3() : a, this.positionStyle = (o = t.positionStyle) == null ? "CUBE" : o, this.positionCubeSpread = (c = (s = t.positionCubeSpread) == null ? void 0 : s.clone()) == null ? new e.Vector3() : c, this.positionSphereSpread = (l = t.positionSphereSpread) == null ? 0 : l, this.velocityStyle = (u = t.velocityStyle) == null ? "CUBE" : u, this.velocityCubeBase = (f = (d = t.velocityCubeBase) == null ? void 0 : d.clone()) == null ? new e.Vector3() : f, this.velocityCubeSpread = (m = (p = t.velocityCubeSpread) == null ? void 0 : p.clone()) == null ? new e.Vector3() : m, this.velocitySphereBase = (h = t.velocitySphereBase) == null ? 0 : h, this.velocitySphereSpread = (g = t.velocitySphereSpread) == null ? 0 : g, this.accelerationBase = (v = (_ = t.accelerationBase) == null ? void 0 : _.clone()) == null ? new e.Vector3() : v, this.accelerationSpread = (b = (y = t.accelerationSpread) == null ? void 0 : y.clone()) == null ? new e.Vector3() : b, this.angleBase = (x = t.angleBase) == null ? 0 : x, this.angleSpread = (w = t.angleSpread) == null ? 0 : w, this.angleVelocityBase = (T = t.angleVelocityBase) == null ? 0 : T, this.angleVelocitySpread = (E = t.angleVelocitySpread) == null ? 0 : E, this.angleAccelerationBase = (D = t.angleAccelerationBase) == null ? 0 : D, this.angleAccelerationSpread = (O = t.angleAccelerationSpread) == null ? 0 : O, this.sizeBase = (k = t.sizeBase) == null ? .1 : k, this.sizeSpread = (A = t.sizeSpread) == null ? 0 : A, this.sizeTween = (j = t.sizeTween) == null ? null : j, this.colorBase = (N = (M = t.colorBase) == null ? void 0 : M.clone()) == null ? new e.Vector3() : N, this.colorSpread = (F = (P = t.colorSpread) == null ? void 0 : P.clone()) == null ? new e.Vector3() : F, this.colorTween = (I = t.colorTween) == null ? null : I, this.opacityBase = ((L = t.opacityBase) == null ? t.opacityTween : L) ? 0 : 1, this.opacitySpread = (R = t.opacitySpread) == null ? 0 : R, this.opacityTween = (z = t.opacityTween) == null ? null : z, this.particlesPerSecond = (B = t.particlesPerSecond) == null ? 60 : B, this.particleDeathAge = (V = t.particleDeathAge) == null ? 1 : V;
583
+ }
584
+ get texture() {
585
+ return this.material.uniforms.map.value;
586
+ }
587
+ set texture(e) {
588
+ this.material.uniforms.map.value = e, e === null ? this.material.defines.USE_MAP !== !1 && (this.material.defines.USE_MAP = !1, this.material.needsUpdate = !0) : this.material.defines.USE_MAP !== !0 && (this.material.defines.USE_MAP = !0, this.material.needsUpdate = !0);
589
+ }
590
+ get blending() {
591
+ return this.material.blending;
592
+ }
593
+ set blending(e) {
594
+ this.material.blending = e;
595
+ }
596
+ createInstance(t) {
597
+ let n = this.positionBase.clone();
598
+ switch (this.positionStyle) {
599
+ case "CUBE":
600
+ n = _(this.positionBase, this.positionCubeSpread);
601
+ break;
602
+ case "SPHERE": {
603
+ let t = 2 * Math.random() - 1, r = Math.PI * 2 * Math.random(), i = Math.sqrt(1 - t * t), a = new e.Vector3(i * Math.cos(r), i * Math.sin(r), t);
604
+ n = new e.Vector3().addVectors(this.positionBase, a.multiplyScalar(this.positionSphereSpread));
605
+ break;
606
+ }
607
+ default: break;
608
+ }
609
+ let r = new e.Vector3();
610
+ switch (this.velocityStyle) {
611
+ case "CUBE":
612
+ r = _(this.velocityCubeBase, this.velocityCubeSpread);
613
+ break;
614
+ case "SPHERE": {
615
+ let t = new e.Vector3().subVectors(n, this.positionBase), i = g(this.velocitySphereBase, this.velocitySphereSpread);
616
+ r = t.normalize().multiplyScalar(i);
617
+ break;
618
+ }
619
+ default: break;
620
+ }
621
+ return new x(t, this.particleDeathAge, n, r, _(this.accelerationBase, this.accelerationSpread), g(this.angleBase, this.angleSpread), g(this.angleVelocityBase, this.angleVelocitySpread), g(this.angleAccelerationBase, this.angleAccelerationSpread), _(this.colorBase, this.colorSpread), this.colorTween, g(this.sizeBase, this.sizeSpread), this.sizeTween, g(this.opacityBase, this.opacitySpread), this.opacityTween);
622
+ }
623
+ pause() {
624
+ this.paused !== !0 && (this.paused = !0, this.birthTime = Date.now() / 1e3);
625
+ }
626
+ play() {
627
+ this.paused !== !1 && (this.paused = !1, this.birthTime = Date.now() / 1e3);
628
+ }
629
+ setTime(t) {
630
+ if (this.disposed) return;
631
+ t /= 1e3;
632
+ let n = t - this.birthTime, r = Math.ceil(this.particlesPerSecond * this.particleDeathAge);
633
+ if (this.geometry.attributes.position.count < r) {
634
+ let t = new Float32Array(r * 3);
635
+ t.set(this.geometry.attributes.position.array, 0);
636
+ let n = new e.BufferAttribute(t, 3);
637
+ n.needsUpdate = !0, this.geometry.setAttribute("position", n);
638
+ }
639
+ if (this.geometry.attributes.alive.count < r) {
640
+ let t = new Float32Array(r);
641
+ t.set(this.geometry.attributes.alive.array, 0);
642
+ let n = new e.BufferAttribute(t, 1);
643
+ n.needsUpdate = !0, this.geometry.setAttribute("alive", n);
644
+ }
645
+ if (this.geometry.attributes.color.count < r) {
646
+ let t = new Float32Array(r * 3);
647
+ t.set(this.geometry.attributes.color.array, 0);
648
+ let n = new e.BufferAttribute(t, 3);
649
+ n.needsUpdate = !0, this.geometry.setAttribute("color", n);
650
+ }
651
+ if (this.geometry.attributes.opacity.count < r) {
652
+ let t = new Float32Array(r);
653
+ t.set(this.geometry.attributes.opacity.array, 0);
654
+ let n = new e.BufferAttribute(t, 1);
655
+ n.needsUpdate = !0, this.geometry.setAttribute("opacity", n);
656
+ }
657
+ if (this.geometry.attributes.size.count < r) {
658
+ let t = new Float32Array(r);
659
+ t.set(this.geometry.attributes.size.array, 0);
660
+ let n = new e.BufferAttribute(t, 1);
661
+ n.needsUpdate = !0, this.geometry.setAttribute("size", n);
662
+ }
663
+ if (this.geometry.attributes.angle.count < r) {
664
+ let t = new Float32Array(r);
665
+ t.set(this.geometry.attributes.angle.array, 0);
666
+ let n = new e.BufferAttribute(t, 1);
667
+ n.needsUpdate = !0, this.geometry.setAttribute("angle", n);
668
+ }
669
+ this.instances.length < r && (this.instances.length = r);
670
+ for (let e = 0; e < this.instances.length; e++) {
671
+ let i = this.instances[e];
672
+ if (e < r && this.paused === !1 && (i === void 0 || i.getAlive(t) === !1)) {
673
+ let a = this.particleDeathAge / r * e;
674
+ if (n > a) {
675
+ let r = t - (n - a) % this.particleDeathAge;
676
+ this.instances[e] = i = this.createInstance(r);
677
+ }
678
+ }
679
+ if (i) {
680
+ let { position: n, alive: r, color: a, opacity: o, size: s, angle: c } = i.getState(t);
681
+ this.geometry.attributes.position.setXYZ(e, n.x, n.y, n.z), this.geometry.attributes.position.needsUpdate = !0, this.geometry.attributes.alive.setX(e, r ? 1 : 0), this.geometry.attributes.alive.needsUpdate = !0, this.geometry.attributes.color.setXYZ(e, a.r, a.g, a.b), this.geometry.attributes.color.needsUpdate = !0, this.geometry.attributes.opacity.setX(e, o), this.geometry.attributes.opacity.needsUpdate = !0, this.geometry.attributes.size.setX(e, s), this.geometry.attributes.size.needsUpdate = !0, this.geometry.attributes.angle.setX(e, c), this.geometry.attributes.angle.needsUpdate = !0;
682
+ }
683
+ }
684
+ this.geometry.computeBoundingBox(), this.geometry.boundingSphere || (this.geometry.boundingSphere = new e.Sphere()), this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere), this.needsRender = !0;
685
+ }
686
+ dispose() {
687
+ var e;
688
+ this.disposed = !0, this.geometry.dispose(), (e = this.texture) == null || e.dispose(), this.material.dispose();
689
+ }
690
+ };
691
+ //#endregion
692
+ //#region build/vfx/particle-gpu/utils.js
693
+ function T(e, t) {
694
+ return e + t * (Math.random() - .5);
1109
695
  }
1110
- `, Oe = `
1111
- varying vec4 vColor;
1112
- varying float vAngle;
1113
-
1114
- #if defined(USE_MAP)
1115
- uniform sampler2D map;
1116
- #endif
1117
-
1118
- void main() {
1119
- // 如果粒子透明度为0,直接丢弃
1120
- if (vColor.a <= 0.0) {
1121
- discard;
1122
- }
1123
-
1124
- gl_FragColor = vColor;
1125
-
1126
- #if defined(USE_MAP)
1127
- float c = cos(vAngle);
1128
- float s = sin(vAngle);
1129
-
1130
- // 旋转UV坐标以旋转纹理
1131
- vec2 rotatedUV = vec2(
1132
- c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,
1133
- c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5
1134
- );
1135
-
1136
- vec4 textureColor = texture2D(map, rotatedUV);
1137
- gl_FragColor = vColor * textureColor;
1138
- #endif
696
+ function E(t, n) {
697
+ let r = new e.Vector3(Math.random() - .5, Math.random() - .5, Math.random() - .5);
698
+ return new e.Vector3().addVectors(t, new e.Vector3().multiplyVectors(n, r));
1139
699
  }
1140
- `, He = (
1141
- /** @class */
1142
- (function(o) {
1143
- Y(i, o);
1144
- function i(e) {
1145
- for (var t = this, r, u, a, s, c, f, m, h, d, y, b, S, g, _, C, B, E, F, P, T, M, z, V, D, R, N, U, O, j, G, I, X, H, k, v = Math.ceil(((r = e.particlesPerSecond) !== null && r !== void 0 ? r : 60) * ((u = e.particleDeathAge) !== null && u !== void 0 ? u : 1)), p = new n.BufferGeometry(), w = new Float32Array(v * 3), x = new Float32Array(v * 3), A = new Float32Array(v * 3), Z = new Float32Array(v), ce = new Float32Array(v), de = new Float32Array(v), ve = new Float32Array(v), J = new Float32Array(v * 3), fe = new Float32Array(v), pe = new Float32Array(v), me = new Float32Array(v), he = new Float32Array(v), l = 0; l < v; l++) {
1146
- var _e = ((a = e.particleDeathAge) !== null && a !== void 0 ? a : 1) / v * l;
1147
- Z[l] = _e, ce[l] = (s = e.particleDeathAge) !== null && s !== void 0 ? s : 1, he[l] = l;
1148
- var L = (f = (c = e.positionBase) === null || c === void 0 ? void 0 : c.clone()) !== null && f !== void 0 ? f : new n.Vector3();
1149
- switch ((m = e.positionStyle) !== null && m !== void 0 ? m : "CUBE") {
1150
- case "CUBE": {
1151
- L = ee((h = e.positionBase) !== null && h !== void 0 ? h : new n.Vector3(), (d = e.positionCubeSpread) !== null && d !== void 0 ? d : new n.Vector3());
1152
- break;
1153
- }
1154
- case "SPHERE": {
1155
- var ne = 2 * Math.random() - 1, ye = Math.PI * 2 * Math.random(), ge = Math.sqrt(1 - ne * ne), Ce = new n.Vector3(ge * Math.cos(ye), ge * Math.sin(ye), ne);
1156
- L = new n.Vector3().addVectors((y = e.positionBase) !== null && y !== void 0 ? y : new n.Vector3(), Ce.multiplyScalar((b = e.positionSphereSpread) !== null && b !== void 0 ? b : 0));
1157
- break;
1158
- }
1159
- }
1160
- w[l * 3] = L.x, w[l * 3 + 1] = L.y, w[l * 3 + 2] = L.z;
1161
- var W = new n.Vector3();
1162
- switch ((S = e.velocityStyle) !== null && S !== void 0 ? S : "CUBE") {
1163
- case "CUBE": {
1164
- W = ee((g = e.velocityCubeBase) !== null && g !== void 0 ? g : new n.Vector3(), (_ = e.velocityCubeSpread) !== null && _ !== void 0 ? _ : new n.Vector3());
1165
- break;
1166
- }
1167
- case "SPHERE": {
1168
- var Be = new n.Vector3().subVectors(L, (C = e.positionBase) !== null && C !== void 0 ? C : new n.Vector3()), Ee = $((B = e.velocitySphereBase) !== null && B !== void 0 ? B : 0, (E = e.velocitySphereSpread) !== null && E !== void 0 ? E : 0);
1169
- W = Be.normalize().multiplyScalar(Ee);
1170
- break;
1171
- }
1172
- }
1173
- x[l * 3] = W.x, x[l * 3 + 1] = W.y, x[l * 3 + 2] = W.z;
1174
- var ie = ee((F = e.accelerationBase) !== null && F !== void 0 ? F : new n.Vector3(), (P = e.accelerationSpread) !== null && P !== void 0 ? P : new n.Vector3());
1175
- A[l * 3] = ie.x, A[l * 3 + 1] = ie.y, A[l * 3 + 2] = ie.z, de[l] = $((T = e.sizeBase) !== null && T !== void 0 ? T : 0.1, (M = e.sizeSpread) !== null && M !== void 0 ? M : 0), ve[l] = (z = e.sizeGrowth) !== null && z !== void 0 ? z : 0;
1176
- var re = ee((V = e.colorBase) !== null && V !== void 0 ? V : new n.Vector3(), (D = e.colorSpread) !== null && D !== void 0 ? D : new n.Vector3());
1177
- J[l * 3] = re.x, J[l * 3 + 1] = re.y, J[l * 3 + 2] = re.z, fe[l] = $((R = e.opacityBase) !== null && R !== void 0 ? R : 1, (N = e.opacitySpread) !== null && N !== void 0 ? N : 0), pe[l] = $((U = e.angleBase) !== null && U !== void 0 ? U : 0, (O = e.angleSpread) !== null && O !== void 0 ? O : 0), me[l] = $((j = e.angleVelocityBase) !== null && j !== void 0 ? j : 0, (G = e.angleVelocitySpread) !== null && G !== void 0 ? G : 0);
1178
- }
1179
- p.setAttribute("position", new n.BufferAttribute(w, 3)), p.setAttribute("initialVelocity", new n.BufferAttribute(x, 3)), p.setAttribute("acceleration", new n.BufferAttribute(A, 3)), p.setAttribute("birthTime", new n.BufferAttribute(Z, 1)), p.setAttribute("lifeTime", new n.BufferAttribute(ce, 1)), p.setAttribute("initialSize", new n.BufferAttribute(de, 1)), p.setAttribute("sizeGrowth", new n.BufferAttribute(ve, 1)), p.setAttribute("initialColor", new n.BufferAttribute(J, 3)), p.setAttribute("initialOpacity", new n.BufferAttribute(fe, 1)), p.setAttribute("initialAngle", new n.BufferAttribute(pe, 1)), p.setAttribute("angleVelocity", new n.BufferAttribute(me, 1)), p.setAttribute("particleIndex", new n.BufferAttribute(he, 1));
1180
- var Fe = new n.ShaderMaterial({
1181
- uniforms: {
1182
- map: { value: (I = e.texture) !== null && I !== void 0 ? I : null },
1183
- uTime: { value: 0 }
1184
- },
1185
- defines: {
1186
- USE_MAP: !!e.texture
1187
- },
1188
- vertexShader: Ue,
1189
- fragmentShader: Oe,
1190
- transparent: !0,
1191
- blending: (X = e.blending) !== null && X !== void 0 ? X : n.NormalBlending,
1192
- depthWrite: !1
1193
- });
1194
- return t = o.call(this, p, Fe) || this, t.needsRender = !0, t.startTime = Date.now() / 1e3, t.disposed = !1, t.paused = !1, t.particleCount = v, t.particlesPerSecond = (H = e.particlesPerSecond) !== null && H !== void 0 ? H : 60, t.particleDeathAge = (k = e.particleDeathAge) !== null && k !== void 0 ? k : 1, t;
1195
- }
1196
- return Object.defineProperty(i.prototype, "texture", {
1197
- /** 贴图素材 */
1198
- get: function() {
1199
- return this.material.uniforms.map.value;
1200
- },
1201
- set: function(e) {
1202
- this.material.uniforms.map.value = e, e === null ? this.material.defines.USE_MAP !== !1 && (this.material.defines.USE_MAP = !1, this.material.needsUpdate = !0) : this.material.defines.USE_MAP !== !0 && (this.material.defines.USE_MAP = !0, this.material.needsUpdate = !0);
1203
- },
1204
- enumerable: !1,
1205
- configurable: !0
1206
- }), Object.defineProperty(i.prototype, "blending", {
1207
- /** 材质混合方式 */
1208
- get: function() {
1209
- return this.material.blending;
1210
- },
1211
- set: function(e) {
1212
- this.material.blending = e;
1213
- },
1214
- enumerable: !1,
1215
- configurable: !0
1216
- }), i.prototype.pause = function() {
1217
- this.paused !== !0 && (this.paused = !0, this.startTime = Date.now() / 1e3);
1218
- }, i.prototype.play = function() {
1219
- this.paused !== !1 && (this.paused = !1, this.startTime = Date.now() / 1e3);
1220
- }, i.prototype.setTime = function(e) {
1221
- if (!(this.disposed || this.paused)) {
1222
- var t = e / 1e3, r = t - this.startTime;
1223
- this.material.uniforms.uTime.value = r, this.needsRender = !0;
1224
- }
1225
- }, i.prototype.dispose = function() {
1226
- var e;
1227
- this.disposed = !0, this.geometry.dispose(), (e = this.texture) === null || e === void 0 || e.dispose(), this.material.dispose();
1228
- }, i;
1229
- })(n.Points)
1230
- );
1231
- export {
1232
- Ie as Airflow,
1233
- je as Flame,
1234
- Xe as Particle,
1235
- He as ParticleGPU,
1236
- Ge as SpotLight
700
+ //#endregion
701
+ //#region build/vfx/particle-gpu/vertex-shader.js
702
+ var D = "\n// 粒子初始属性\nattribute vec3 initialVelocity;\nattribute vec3 acceleration;\nattribute float birthTime;\nattribute float lifeTime;\nattribute float initialSize;\nattribute float sizeGrowth;\nattribute vec3 initialColor;\nattribute float initialOpacity;\nattribute float initialAngle;\nattribute float angleVelocity;\nattribute float particleIndex;\n\n// 全局uniform参数\nuniform float uTime;\n\n// 传递给fragment shader的变量\nvarying vec4 vColor;\nvarying float vAngle;\n\n// 简单噪声函数\nfloat random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n}\n\n// HSL转RGB函数\nvec3 hsl2rgb(vec3 c) {\n vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0), 6.0)-3.0)-1.0, 0.0, 1.0);\n return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));\n}\n\nvoid main() {\n // 计算粒子的实际年龄,考虑循环重生\n float totalCycleTime = lifeTime;\n float adjustedTime = uTime + birthTime;\n float cycleTime = mod(adjustedTime, totalCycleTime);\n float age = cycleTime;\n float normalizedAge = clamp(age / lifeTime, 0.0, 1.0);\n \n // 如果粒子年龄超过生命周期,让它重新开始\n if (age > lifeTime) {\n age = 0.0;\n normalizedAge = 0.0;\n }\n \n // 计算当前位置(物理模拟)\n vec3 currentVelocity = initialVelocity + acceleration * age;\n \n vec3 currentPosition = position + currentVelocity * age;\n \n // 计算当前大小(随时间变化)\n float currentSize = initialSize + sizeGrowth * normalizedAge;\n \n // 计算当前角度\n vAngle = initialAngle + angleVelocity * age;\n \n // 计算当前颜色和透明度(生命周期渐变)\n vec3 currentColor = initialColor;\n float currentOpacity = initialOpacity;\n \n // 生命周期透明度渐变(出生和死亡时渐变)\n if (normalizedAge < 0.1) {\n currentOpacity *= normalizedAge / 0.1; // 淡入\n } else if (normalizedAge > 0.8) {\n currentOpacity *= (1.0 - normalizedAge) / 0.2; // 淡出\n }\n \n // 将HSL颜色转换为RGB\n vec3 rgbColor = hsl2rgb(currentColor);\n vColor = vec4(rgbColor, currentOpacity);\n \n // 计算最终位置和大小\n vec4 mvPosition = modelViewMatrix * vec4(currentPosition, 1.0);\n gl_PointSize = currentSize * (300.0 / length(mvPosition.xyz));\n gl_Position = projectionMatrix * mvPosition;\n}\n", O = "\nvarying vec4 vColor;\nvarying float vAngle;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n#endif\n\nvoid main() {\n // 如果粒子透明度为0,直接丢弃\n if (vColor.a <= 0.0) {\n discard;\n }\n \n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // 旋转UV坐标以旋转纹理\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n \n vec4 textureColor = texture2D(map, rotatedUV);\n gl_FragColor = vColor * textureColor;\n #endif\n}\n", k = class extends e.Points {
703
+ constructor(t) {
704
+ var n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, k, A, j, M, N, P, F, I, L, R, z;
705
+ let B = Math.ceil(((n = t.particlesPerSecond) == null ? 60 : n) * ((r = t.particleDeathAge) == null ? 1 : r)), V = new e.BufferGeometry(), H = new Float32Array(B * 3), U = new Float32Array(B * 3), W = new Float32Array(B * 3), G = new Float32Array(B), K = new Float32Array(B), q = new Float32Array(B), J = new Float32Array(B), Y = new Float32Array(B * 3), X = new Float32Array(B), Z = new Float32Array(B), Q = new Float32Array(B), $ = new Float32Array(B);
706
+ for (let n = 0; n < B; n++) {
707
+ G[n] = ((i = t.particleDeathAge) == null ? 1 : i) / B * n, K[n] = (a = t.particleDeathAge) == null ? 1 : a, $[n] = n;
708
+ let r = (s = (o = t.positionBase) == null ? void 0 : o.clone()) == null ? new e.Vector3() : s;
709
+ switch ((c = t.positionStyle) == null ? "CUBE" : c) {
710
+ case "CUBE":
711
+ r = E((l = t.positionBase) == null ? new e.Vector3() : l, (u = t.positionCubeSpread) == null ? new e.Vector3() : u);
712
+ break;
713
+ case "SPHERE": {
714
+ let n = 2 * Math.random() - 1, i = Math.PI * 2 * Math.random(), a = Math.sqrt(1 - n * n), o = new e.Vector3(a * Math.cos(i), a * Math.sin(i), n);
715
+ r = new e.Vector3().addVectors((d = t.positionBase) == null ? new e.Vector3() : d, o.multiplyScalar((f = t.positionSphereSpread) == null ? 0 : f));
716
+ break;
717
+ }
718
+ }
719
+ H[n * 3] = r.x, H[n * 3 + 1] = r.y, H[n * 3 + 2] = r.z;
720
+ let D = new e.Vector3();
721
+ switch ((p = t.velocityStyle) == null ? "CUBE" : p) {
722
+ case "CUBE":
723
+ D = E((m = t.velocityCubeBase) == null ? new e.Vector3() : m, (h = t.velocityCubeSpread) == null ? new e.Vector3() : h);
724
+ break;
725
+ case "SPHERE": {
726
+ let n = new e.Vector3().subVectors(r, (g = t.positionBase) == null ? new e.Vector3() : g), i = T((_ = t.velocitySphereBase) == null ? 0 : _, (v = t.velocitySphereSpread) == null ? 0 : v);
727
+ D = n.normalize().multiplyScalar(i);
728
+ break;
729
+ }
730
+ }
731
+ U[n * 3] = D.x, U[n * 3 + 1] = D.y, U[n * 3 + 2] = D.z;
732
+ let O = E((y = t.accelerationBase) == null ? new e.Vector3() : y, (b = t.accelerationSpread) == null ? new e.Vector3() : b);
733
+ W[n * 3] = O.x, W[n * 3 + 1] = O.y, W[n * 3 + 2] = O.z, q[n] = T((x = t.sizeBase) == null ? .1 : x, (S = t.sizeSpread) == null ? 0 : S), J[n] = (C = t.sizeGrowth) == null ? 0 : C;
734
+ let I = E((w = t.colorBase) == null ? new e.Vector3() : w, (k = t.colorSpread) == null ? new e.Vector3() : k);
735
+ Y[n * 3] = I.x, Y[n * 3 + 1] = I.y, Y[n * 3 + 2] = I.z, X[n] = T((A = t.opacityBase) == null ? 1 : A, (j = t.opacitySpread) == null ? 0 : j), Z[n] = T((M = t.angleBase) == null ? 0 : M, (N = t.angleSpread) == null ? 0 : N), Q[n] = T((P = t.angleVelocityBase) == null ? 0 : P, (F = t.angleVelocitySpread) == null ? 0 : F);
736
+ }
737
+ V.setAttribute("position", new e.BufferAttribute(H, 3)), V.setAttribute("initialVelocity", new e.BufferAttribute(U, 3)), V.setAttribute("acceleration", new e.BufferAttribute(W, 3)), V.setAttribute("birthTime", new e.BufferAttribute(G, 1)), V.setAttribute("lifeTime", new e.BufferAttribute(K, 1)), V.setAttribute("initialSize", new e.BufferAttribute(q, 1)), V.setAttribute("sizeGrowth", new e.BufferAttribute(J, 1)), V.setAttribute("initialColor", new e.BufferAttribute(Y, 3)), V.setAttribute("initialOpacity", new e.BufferAttribute(X, 1)), V.setAttribute("initialAngle", new e.BufferAttribute(Z, 1)), V.setAttribute("angleVelocity", new e.BufferAttribute(Q, 1)), V.setAttribute("particleIndex", new e.BufferAttribute($, 1));
738
+ let ee = new e.ShaderMaterial({
739
+ uniforms: {
740
+ map: { value: (I = t.texture) == null ? null : I },
741
+ uTime: { value: 0 }
742
+ },
743
+ defines: { USE_MAP: !!t.texture },
744
+ vertexShader: D,
745
+ fragmentShader: O,
746
+ transparent: !0,
747
+ blending: (L = t.blending) == null ? e.NormalBlending : L,
748
+ depthWrite: !1
749
+ });
750
+ super(V, ee), this.needsRender = !0, this.startTime = Date.now() / 1e3, this.disposed = !1, this.paused = !1, this.particleCount = B, this.particlesPerSecond = (R = t.particlesPerSecond) == null ? 60 : R, this.particleDeathAge = (z = t.particleDeathAge) == null ? 1 : z;
751
+ }
752
+ get texture() {
753
+ return this.material.uniforms.map.value;
754
+ }
755
+ set texture(e) {
756
+ this.material.uniforms.map.value = e, e === null ? this.material.defines.USE_MAP !== !1 && (this.material.defines.USE_MAP = !1, this.material.needsUpdate = !0) : this.material.defines.USE_MAP !== !0 && (this.material.defines.USE_MAP = !0, this.material.needsUpdate = !0);
757
+ }
758
+ get blending() {
759
+ return this.material.blending;
760
+ }
761
+ set blending(e) {
762
+ this.material.blending = e;
763
+ }
764
+ pause() {
765
+ this.paused !== !0 && (this.paused = !0, this.startTime = Date.now() / 1e3);
766
+ }
767
+ play() {
768
+ this.paused !== !1 && (this.paused = !1, this.startTime = Date.now() / 1e3);
769
+ }
770
+ setTime(e) {
771
+ if (this.disposed || this.paused) return;
772
+ let t = e / 1e3 - this.startTime;
773
+ this.material.uniforms.uTime.value = t, this.needsRender = !0;
774
+ }
775
+ dispose() {
776
+ var e;
777
+ this.disposed = !0, this.geometry.dispose(), (e = this.texture) == null || e.dispose(), this.material.dispose();
778
+ }
1237
779
  };
780
+ //#endregion
781
+ export { h as Airflow, c as Flame, w as Particle, k as ParticleGPU, d as SpotLight };