@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.
- package/AGENTS_READ_ME.md +4 -0
- package/AI_CONTEXT.md +4 -0
- package/README.md +9 -6
- package/{guides → ai_guides}/README.md +12 -2
- package/ai_guides/ai-doc-guidelines.md +102 -0
- package/{guides → ai_guides}/api.md +24 -1
- package/ai_guides/features/3dtile.md +172 -0
- package/{guides → ai_guides}/features/camera-animation.md +24 -3
- package/{guides → ai_guides}/features/clipper.md +2 -0
- package/{guides/features/coordnate-system.md → ai_guides/features/coordinate-system.md} +2 -0
- package/{guides → ai_guides}/features/event.md +2 -0
- package/{guides → ai_guides}/features/five.md +4 -0
- package/ai_guides/features/flowing-light-2d-pass.md +438 -0
- package/ai_guides/features/flowing-light-3d-pass.md +420 -0
- package/ai_guides/features/gaussian-blur-pass.md +202 -0
- package/{guides → ai_guides}/features/gesture.md +3 -0
- package/{guides → ai_guides}/features/get-screen-pixels.md +2 -0
- package/{guides → ai_guides}/features/image-options.md +3 -0
- package/{guides → ai_guides}/features/load-external-model.md +21 -0
- package/ai_guides/features/load-progress.md +140 -0
- package/ai_guides/features/material.md +153 -0
- package/{guides → ai_guides}/features/mode.md +4 -0
- package/{guides → ai_guides}/features/model.md +4 -1
- package/{guides → ai_guides}/features/move-pano-effect.md +2 -0
- package/{guides → ai_guides}/features/multi-work.md +2 -0
- package/ai_guides/features/pano-filter.md +148 -0
- package/{guides → ai_guides}/features/pano-tile.md +7 -14
- package/ai_guides/features/pano-uv.md +131 -0
- package/ai_guides/features/parameter.md +153 -0
- package/ai_guides/features/plugin.md +210 -0
- package/{guides → ai_guides}/features/postprocessing.md +39 -4
- package/{guides → ai_guides}/features/raycast.md +11 -0
- package/{guides → ai_guides}/features/request-proxy.md +2 -0
- package/{guides → ai_guides}/features/screen-project.md +2 -0
- package/{guides → ai_guides}/features/state.md +2 -0
- package/ai_guides/features/view-layer.md +187 -0
- package/{guides → ai_guides}/features/work.md +63 -2
- package/{guides → ai_guides}/glossary.md +26 -5
- package/{guides → ai_guides}/intro.md +1 -1
- package/{guides → ai_guides}/quick-start.md +1 -0
- package/ai_guides/release_notes/6.8.md +208 -0
- package/{guides → ai_guides}/template.md +17 -3
- package/docs/00_FOR_AI_AGENTS.md +11 -0
- package/docs/README.md +4 -7
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
- package/docs/classes/five.BoundingMesh.html +2 -2
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +73 -72
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.Histogram.html +19 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +31 -31
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +42 -3
- package/docs/classes/five.PBMGSObject.html +5 -3
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +16 -7
- package/docs/classes/five.PBMPanoFilter.html +61 -0
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +41 -0
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +57 -53
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3D.html +30 -26
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Trajectory.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +27 -2
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.GLTFParser.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/README.html +11 -2
- package/docs/documents/ai-doc-guidelines.html +60 -15
- package/docs/documents/api.html +40 -15
- package/docs/documents/features_3dtile.html +142 -45
- package/docs/documents/features_camera-animation.html +62 -5
- package/docs/documents/features_clipper.html +3 -0
- package/docs/documents/{features_coordnate-system.html → features_coordinate-system.html} +4 -1
- package/docs/documents/features_event.html +3 -0
- package/docs/documents/features_five.html +4 -0
- package/docs/documents/features_flowing-light-2d-pass.html +356 -0
- package/docs/documents/features_flowing-light-3d-pass.html +351 -0
- package/docs/documents/features_gaussian-blur-pass.html +182 -0
- package/docs/documents/features_gesture.html +4 -0
- package/docs/documents/features_get-screen-pixels.html +3 -0
- package/docs/documents/features_image-options.html +3 -0
- package/docs/documents/features_load-external-model.html +25 -2
- package/docs/documents/features_load-progress.html +110 -0
- package/docs/documents/features_material.html +341 -0
- package/docs/documents/features_mode.html +5 -0
- package/docs/documents/features_model.html +5 -1
- package/docs/documents/features_move-pano-effect.html +3 -0
- package/docs/documents/features_multi-work.html +3 -0
- package/docs/documents/features_pano-filter.html +122 -0
- package/docs/documents/features_pano-tile.html +34 -19
- package/docs/documents/features_pano-uv.html +82 -0
- package/docs/documents/features_parameter.html +76 -56
- package/docs/documents/features_plugin.html +105 -0
- package/docs/documents/features_postprocessing.html +22 -5
- package/docs/documents/features_raycast.html +4 -1
- package/docs/documents/features_request-proxy.html +3 -0
- package/docs/documents/features_screen-project.html +3 -0
- package/docs/documents/features_state.html +3 -0
- package/docs/documents/features_view-layer.html +158 -0
- package/docs/documents/features_work.html +63 -2
- package/docs/documents/glossary.html +31 -6
- package/docs/documents/intro.html +1 -1
- package/docs/documents/quick-start.html +1 -0
- package/docs/documents/release_notes_6.8.html +189 -0
- package/docs/documents/template.html +45 -4
- package/docs/functions/five.loadAt3d.html +1 -1
- package/docs/functions/five.loadB3dm.html +1 -1
- package/docs/functions/five.loadDome.html +1 -1
- package/docs/functions/five.loadDomez.html +1 -1
- package/docs/functions/five.loadFbx.html +1 -1
- package/docs/functions/five.loadGltf.html +1 -1
- package/docs/functions/five.loadPbm.html +1 -1
- package/docs/functions/five.loadPly.html +1 -1
- package/docs/functions/five.loadPnts.html +1 -1
- package/docs/functions/five.loadSplat.html +1 -1
- package/docs/functions/five.loadSpz.html +1 -1
- package/docs/functions/five.loadX3p.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/vue.useFiveWorks.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +11 -2
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +2 -2
- package/docs/interfaces/five.EventCallback.html +53 -47
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.GestureEvent.html +2 -2
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +2 -2
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +4 -3
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.ModeChangeEvent.html +2 -2
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +2 -2
- package/docs/interfaces/five.ModelSceneEvent.html +2 -2
- package/docs/interfaces/five.ModelTileEvent.html +8 -0
- package/docs/interfaces/five.MovePanoOptions.html +7 -7
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +2 -2
- package/docs/interfaces/five.PBMClipperParameter.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
- package/docs/interfaces/five.PBMPanoDepth.html +5 -5
- package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
- package/docs/interfaces/five.PBMPanoPicture.html +8 -6
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
- package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +2 -2
- package/docs/interfaces/five.PanoTextureEvent.html +2 -2
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +42 -38
- package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/five.ParameterValue.html +56 -52
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +2 -2
- package/docs/interfaces/five.ResolvedParameterValue.html +56 -52
- package/docs/interfaces/five.RgbaData.html +7 -0
- package/docs/interfaces/five.SplatData.html +2 -2
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +2 -2
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DOptions.html +2 -2
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +30 -26
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkModel.html +8 -8
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +27 -2
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +2 -2
- package/docs/interfaces/five.XRControllerEvent.html +2 -2
- package/docs/interfaces/five.XRGestureEvent.html +2 -2
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +2 -2
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
- package/docs/modules/five.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/five.ControllerEventTypes.html +27 -25
- package/docs/types/five.EasingFunction.html +1 -0
- package/docs/types/five.EventTypes.html +27 -25
- package/docs/types/five.FivePlugin.html +1 -1
- package/docs/types/five.FivePluginInit.html +1 -1
- package/docs/types/five.FivePluginInstance.html +1 -1
- package/docs/types/five.NetworkProgressCallback.html +1 -1
- package/docs/types/five.PBMAlphaMode.html +1 -1
- package/docs/types/five.PBMColorStyle.html +1 -1
- package/docs/types/five.PBMFloorStyle.html +1 -1
- package/docs/types/five.PBMMeshShaderType.html +1 -1
- package/docs/types/five.PBMPointBack.html +1 -1
- package/docs/types/five.PBMPointCloudShaderType.html +1 -1
- package/docs/types/five.PBMPointShape.html +1 -1
- package/docs/types/five.PBMPointSize.html +1 -1
- package/docs/types/five.PBMTransition.html +1 -1
- package/docs/types/five.ParseOptions.html +6 -6
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/five/application/analysis.d.ts +40 -0
- package/five/application/controllers.d.ts +41 -0
- package/five/application/events-legacy.d.ts +454 -0
- package/five/application/events.d.ts +69 -0
- package/five/application/five.d.ts +519 -0
- package/five/application/fiveInitArgs.d.ts +176 -0
- package/five/application/fiveLoadOptions.d.ts +21 -0
- package/five/application/generateDefaultVideoElement.d.ts +2 -0
- package/five/application/getViewportScale.d.ts +2 -0
- package/five/application/initLights.d.ts +3 -0
- package/five/application/mode.d.ts +28 -0
- package/five/application/renderPoweredByRealsee.d.ts +3 -0
- package/five/assets/cardboard-png-data-url.d.ts +2 -0
- package/five/assets/gradient-png-data-url.d.ts +2 -0
- package/five/assets/loading-png-data-url.d.ts +2 -0
- package/five/assets/phone-png-data-url.d.ts +2 -0
- package/five/assets/realsee-png-data-url.d.ts +2 -0
- package/five/bvh/bvhMath.d.ts +33 -0
- package/five/bvh/bvhMesh.d.ts +7 -0
- package/five/bvh/bvhNode.d.ts +29 -0
- package/five/bvh/bvhObject.d.ts +18 -0
- package/five/bvh/bvhPoints.d.ts +6 -0
- package/five/bvh/index.d.ts +10 -0
- package/five/bvh/worker.d.ts +35 -0
- package/five/cardboard/helper.d.ts +2 -0
- package/five/cardboard/index.d.ts +13 -0
- package/five/cardboard/sensor.d.ts +158 -0
- package/five/certificates/hardware.d.ts +1 -0
- package/five/controllers/base.d.ts +167 -0
- package/five/controllers/events.d.ts +71 -0
- package/five/controllers/floorplan.d.ts +119 -0
- package/five/controllers/mapview.d.ts +139 -0
- package/five/controllers/model.d.ts +57 -0
- package/five/controllers/panorama.d.ts +143 -0
- package/five/controllers/panoramaLike.d.ts +87 -0
- package/five/controllers/topview.d.ts +42 -0
- package/five/controllers/vrPanorama.d.ts +56 -0
- package/five/controllers/xrPanorama.d.ts +81 -0
- package/five/core/camera.d.ts +65 -0
- package/five/core/internalWebGLRenderer.d.ts +14 -0
- package/five/core/panoVideo.d.ts +18 -0
- package/five/core/scene.d.ts +10 -0
- package/five/core/tiling.d.ts +43 -0
- package/five/declare.d.ts +2 -1
- package/five/gaussian-splatting/util/renderData.d.ts +52 -0
- package/five/gaussian-splatting/wasm/data.d.ts +20 -0
- package/five/gaussian-splatting/wasm/sort.d.ts +18 -0
- package/five/gaussian-splatting/worker/dataWorker.d.ts +1 -0
- package/five/gaussian-splatting/worker/sortWorker.d.ts +1 -0
- package/five/index.d.ts +60 -4637
- package/five/index.js +193 -341
- package/five/index.mjs +26455 -31011
- package/five/meshes/boundingMesh.d.ts +12 -0
- package/five/meshes/intersectMesh.d.ts +8 -0
- package/five/meshes/panoCircleMesh.d.ts +35 -0
- package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
- package/five/meshes/panoCircleMeshSolid.d.ts +34 -0
- package/five/meshes/panoSphereMesh.d.ts +27 -0
- package/five/model/helpers/coordinate-transform.d.ts +3 -0
- package/five/model/helpers/ellipsoid-coordinates.d.ts +14 -0
- package/five/model/helpers/get-edges-by-sphere.d.ts +8 -0
- package/five/model/helpers/get-recommend-tile3d-parameters.d.ts +8 -0
- package/five/model/index.d.ts +70 -0
- package/five/model/intersection.d.ts +18 -0
- package/five/model/loaders/at3d.d.ts +12 -0
- package/five/model/loaders/b3dm.d.ts +9 -0
- package/five/model/loaders/dome.d.ts +22 -0
- package/five/model/loaders/domez.d.ts +11 -0
- package/five/model/loaders/fbx.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/CESIUM_RTC.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_meshopt_compression.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_texture_webp.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +25 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_draco_mesh_compression.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_clearcoat.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_emissive_strength.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_sheen.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_transmission.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_unlit.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_mesh_quantization.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_basisu.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_transform.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/REALSEE_materials_lightmap.d.ts +7 -0
- package/five/model/loaders/glTF-helpers/extensions/base.d.ts +24 -0
- package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
- package/five/model/loaders/glTF-helpers/index.d.ts +47 -0
- package/five/model/loaders/glTF-helpers/parser.d.ts +114 -0
- package/five/model/loaders/glTF-helpers/type.d.ts +14 -0
- package/five/model/loaders/gltf.d.ts +10 -0
- package/five/model/loaders/obj.d.ts +9 -0
- package/five/model/loaders/pbm.d.ts +26 -0
- package/five/model/loaders/ply.d.ts +24 -0
- package/five/model/loaders/pnts.d.ts +8 -0
- package/five/model/loaders/protobuf/dome.d.ts +540 -0
- package/five/model/loaders/protobuf/pbm.d.ts +203 -0
- package/five/model/loaders/shared.d.ts +16 -0
- package/five/model/loaders/splat.d.ts +8 -0
- package/five/model/loaders/spz.d.ts +14 -0
- package/five/model/loaders/tile3d-helpers/feature-table.d.ts +15 -0
- package/five/model/loaders/tile3d-helpers/gl-type.d.ts +20 -0
- package/five/model/loaders/tile3d-helpers/parse-gltf-array-buffer.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-header.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.worker.d.ts +6 -0
- package/five/model/loaders/tile3d-helpers/parse-table.d.ts +3 -0
- package/five/model/loaders/tile3d-helpers/tile3d-type.d.ts +35 -0
- package/five/model/loaders/x3p.d.ts +22 -0
- package/five/model/materials/pbmMaterial.d.ts +137 -0
- package/five/model/materials/pbmMeshMaterial.d.ts +126 -0
- package/five/model/materials/pbmPointCloudMaterial.d.ts +70 -0
- package/five/model/model-scene.d.ts +172 -0
- package/five/model/model.d.ts +209 -0
- package/five/model/objects/pbmContainer.d.ts +28 -0
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +43 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +55 -0
- package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
- package/five/model/objects/pbmGroup.d.ts +8 -0
- package/five/model/objects/pbmMesh.d.ts +10 -0
- package/five/model/objects/pbmPointCloud.d.ts +7 -0
- package/five/model/parameter.d.ts +140 -0
- package/five/model/shaders/pbm_gaussian_splatting/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_gaussian_splatting/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/vertex.d.ts +2 -0
- package/five/model/tile3d/header.d.ts +88 -0
- package/five/model/tile3d/index.d.ts +214 -0
- package/five/model/tile3d/tile-cache.d.ts +18 -0
- package/five/model/tile3d/tile-content.d.ts +10 -0
- package/five/model/tile3d/tile-node.d.ts +24 -0
- package/five/model/tile3d/tile-request-scheduler.d.ts +17 -0
- package/five/model/tile3d/tile.d.ts +79 -0
- package/five/model/tile3d/tileset-base-traverser.d.ts +59 -0
- package/five/model/tile3d/tileset-most-detail-traverser.d.ts +14 -0
- package/five/model/tile3d/tileset-normal-traverser.d.ts +15 -0
- package/five/model/tile3d/tileset-skip-traverser.d.ts +60 -0
- package/five/model/tile3d/tileset.d.ts +69 -0
- package/five/model/tile3d/trajectory-content.d.ts +9 -0
- package/five/model/tile3d/trajectory-node.d.ts +15 -0
- package/five/model/tile3d/trajectory.d.ts +30 -0
- package/five/model/tile3d/types.d.ts +33 -0
- package/five/model/view-layer.d.ts +20 -0
- package/five/renderer/five-renderer.d.ts +17 -0
- package/five/renderer/index.d.ts +3 -0
- package/five/renderer/postprocessing/composer.d.ts +37 -0
- package/five/renderer/postprocessing/index.d.ts +7 -0
- package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +17 -0
- package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +14 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +12 -0
- package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
- package/five/renderer/scene-renderers/point-cloud-high-quality-scene-renderer.d.ts +11 -0
- package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
- package/five/renderer/scene-renderers/ssaa-scene-renderer.d.ts +15 -0
- package/five/renderer/tools/full-screen-quad.d.ts +15 -0
- package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
- package/five/renderer/tools/render-full-screen-depth.d.ts +2 -0
- package/five/renderer/tools/render-full-screen.d.ts +2 -0
- package/five/texture/histogram.d.ts +54 -0
- package/five/texture/imageBitmap.d.ts +13 -0
- package/five/texture/initTexture.d.ts +3 -0
- package/five/texture/loader.d.ts +39 -0
- package/five/texture/textureData.d.ts +11 -0
- package/five/thirdparty/fflate.d.ts +1407 -0
- package/five/thirdparty/hammer.d.ts +375 -0
- package/five/thirdparty/jsrsasign.d.ts +753 -0
- package/five/thirdparty/meshopt_decoder.d.ts +15 -0
- package/five/three-version-check.d.ts +1 -0
- package/five/types/addableObject.d.ts +12 -0
- package/five/types/cube.d.ts +1 -0
- package/five/types/gestureInput.d.ts +24 -0
- package/five/types/imageOptions.d.ts +20 -0
- package/five/types/intersectMeshInterface.d.ts +8 -0
- package/five/types/movePanoEffect.d.ts +13 -0
- package/five/types/movePanoOptions.d.ts +36 -0
- package/five/types/panoCircleMeshInterface.d.ts +34 -0
- package/five/types/plugin.d.ts +25 -0
- package/five/types/pose.d.ts +17 -0
- package/five/types/state.d.ts +20 -0
- package/five/types/viewport.d.ts +22 -0
- package/five/utils/ajax.d.ts +66 -0
- package/five/utils/animationFrameLoop.d.ts +45 -0
- package/five/utils/array.d.ts +31 -0
- package/five/utils/asyncTaskQueue.d.ts +8 -0
- package/five/utils/bufferGeometry.d.ts +33 -0
- package/five/utils/calculateProgress.d.ts +39 -0
- package/five/utils/calculateThreeMouse.d.ts +13 -0
- package/five/utils/canplayVideo.d.ts +2 -0
- package/five/utils/clamp.d.ts +2 -0
- package/five/utils/clock.d.ts +17 -0
- package/five/utils/createSymbol.d.ts +5 -0
- package/five/utils/decodeText.d.ts +2 -0
- package/five/utils/deepEqual.d.ts +2 -0
- package/five/utils/deepFreeze.d.ts +2 -0
- package/five/utils/defineProperty.d.ts +9 -0
- package/five/utils/detector.d.ts +14 -0
- package/five/utils/distance.d.ts +10 -0
- package/five/utils/draco.d.ts +26 -0
- package/five/utils/easing.d.ts +63 -0
- package/five/utils/event.d.ts +159 -0
- package/five/utils/formatRad.d.ts +7 -0
- package/five/utils/imageSupport.d.ts +6 -0
- package/five/utils/imageURL.d.ts +42 -0
- package/five/utils/isEmptyObject.d.ts +2 -0
- package/five/utils/isNil.d.ts +6 -0
- package/five/utils/isNumber.d.ts +2 -0
- package/five/utils/isPowerOfTwo.d.ts +2 -0
- package/five/utils/isPromise.d.ts +2 -0
- package/five/utils/isSimilar.d.ts +6 -0
- package/five/utils/json.d.ts +7 -0
- package/five/utils/ktx2.d.ts +30 -0
- package/five/utils/lzma/index.d.ts +2 -0
- package/five/utils/lzma/lzma.d.ts +3 -0
- package/five/utils/lzma/lzmaWASM.d.ts +2 -0
- package/five/utils/lzma/lzmaWorker.d.ts +14 -0
- package/five/utils/memoryUsage.d.ts +29 -0
- package/five/utils/motion.d.ts +38 -0
- package/five/utils/noop.d.ts +6 -0
- package/five/utils/now.d.ts +7 -0
- package/five/utils/pano.d.ts +9 -0
- package/five/utils/pick.d.ts +3 -0
- package/five/utils/poseUtils.d.ts +5 -0
- package/five/utils/renderCubeTextureToCubeRenderTarget.d.ts +3 -0
- package/five/utils/renderDepth.d.ts +2 -0
- package/five/utils/renderTexturesToCubeRenderTarget.d.ts +10 -0
- package/five/utils/requestPermission.d.ts +3 -0
- package/five/utils/shaderContentFix.d.ts +7 -0
- package/five/utils/shaderMaterial.d.ts +20 -0
- package/five/utils/stateUtils.d.ts +5 -0
- package/five/utils/string-pattern.d.ts +8 -0
- package/five/utils/subscribe.d.ts +67 -0
- package/five/utils/tileCube.d.ts +19 -0
- package/five/utils/toFastProperties.d.ts +1 -0
- package/five/utils/typedCache.d.ts +10 -0
- package/five/utils/uniform.d.ts +15 -0
- package/five/utils/url.d.ts +35 -0
- package/five/utils/uuid.d.ts +5 -0
- package/five/utils/values.d.ts +2 -0
- package/five/utils/vectorCoordinates.d.ts +29 -0
- package/five/utils/volume.d.ts +111 -0
- package/five/utils/webglError.d.ts +7 -0
- package/five/utils/worker.d.ts +26 -0
- package/five/webxr/XRControllerModelFactory.d.ts +28 -0
- package/five/webxr/motionHelper.d.ts +68 -0
- package/five/webxr/xrButton.d.ts +4 -0
- package/five/webxr/xrController.d.ts +24 -0
- package/five/webxr/xrManager.d.ts +84 -0
- package/five/work/_ALLOW_HOST.d.ts +2 -0
- package/five/work/index.d.ts +6 -0
- package/five/work/keychain.d.ts +5 -0
- package/five/work/looseWorkType.d.ts +121 -0
- package/five/work/verify.d.ts +7 -0
- package/five/work/work.d.ts +236 -0
- package/five/work/workFetcher.d.ts +4 -0
- package/five/work/workJson.d.ts +3 -0
- package/five/work/workJsonType.d.ts +73 -0
- package/five/work/workObserverUtils.d.ts +36 -0
- package/five/work/workParser.d.ts +6 -0
- package/five/work/workResolvedObserver.d.ts +12 -0
- package/five/work/workVerify.d.ts +2 -0
- package/five/work/works.d.ts +10 -0
- package/gltf-loader/gltf-object.d.ts +17 -0
- package/gltf-loader/index.d.ts +60 -160
- package/gltf-loader/index.js +9 -9
- package/gltf-loader/index.mjs +1351 -1451
- package/gltf-loader/thirdparty/DDSLoader.d.ts +23 -0
- package/gltf-loader/thirdparty/DRACOLoader.d.ts +18 -0
- package/gltf-loader/thirdparty/GLTFLoader.d.ts +59 -0
- package/line/circle_png.d.ts +1 -0
- package/line/index.d.ts +19 -69
- package/line/index.js +4 -4
- package/line/index.mjs +334 -513
- package/line/utils/Line2.d.ts +7 -0
- package/line/utils/LineGeometry.d.ts +10 -0
- package/line/utils/LineMaterial.d.ts +20 -0
- package/line/utils/LineSegments2.d.ts +11 -0
- package/line/utils/LineSegmentsGeometry.d.ts +15 -0
- package/llms.txt +43 -31
- package/package.json +11 -2
- package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
- package/plugins/BackgroundPlugin/index.d.ts +5 -0
- package/plugins/BackgroundPlugin/typings.d.ts +44 -0
- package/plugins/BasePlugin/index.d.ts +119 -0
- package/plugins/DynamicPathLinePlugin/Controller.d.ts +167 -0
- package/plugins/DynamicPathLinePlugin/index.d.ts +5 -0
- package/plugins/DynamicPathLinePlugin/line2/Line2.d.ts +7 -0
- package/plugins/DynamicPathLinePlugin/line2/LineGeometry.d.ts +10 -0
- package/plugins/DynamicPathLinePlugin/line2/LineMaterial.d.ts +17 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegments2.d.ts +11 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegmentsGeometry.d.ts +15 -0
- package/plugins/DynamicPathLinePlugin/typing.d.ts +129 -0
- package/plugins/DynamicPathLinePlugin/typings.d.ts +72 -0
- package/plugins/ItemMaskPlugin/Controller.d.ts +48 -0
- package/plugins/ItemMaskPlugin/index.d.ts +5 -0
- package/plugins/ItemMaskPlugin/typing.d.ts +58 -0
- package/plugins/OrientationPlugin/Controller.d.ts +82 -0
- package/plugins/OrientationPlugin/RoundedBoxGeometry.d.ts +11 -0
- package/plugins/OrientationPlugin/index.d.ts +6 -0
- package/plugins/OrientationPlugin/typing.d.ts +25 -0
- package/plugins/PanoAnimePlugin/Controller.d.ts +46 -0
- package/plugins/PanoAnimePlugin/index.d.ts +5 -0
- package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
- package/plugins/PluginTemplate/Controller.d.ts +27 -0
- package/plugins/PluginTemplate/index.d.ts +5 -0
- package/plugins/PluginTemplate/typing.d.ts +21 -0
- package/plugins/TrajectoryPlugin/Controller.d.ts +85 -0
- package/plugins/TrajectoryPlugin/index.d.ts +6 -0
- package/plugins/TrajectoryPlugin/typing.d.ts +25 -0
- package/plugins/index.d.ts +9 -1102
- package/plugins/index.js +17 -21
- package/plugins/index.mjs +3342 -4245
- package/plugins/thirdParty/CSS3DRenderer.d.ts +32 -0
- package/plugins/thirdParty/OrbitControls.d.ts +78 -0
- package/plugins/utils/absoluteUrl.d.ts +5 -0
- package/plugins/utils/clamp.d.ts +2 -0
- package/plugins/utils/loadImage.d.ts +1 -0
- package/plugins/utils/motion.d.ts +38 -0
- package/plugins/utils/now.d.ts +6 -0
- package/plugins/utils/uuid.d.ts +5 -0
- package/react/canvas.d.ts +19 -0
- package/react/context.d.ts +11 -0
- package/react/createProvider.d.ts +95 -0
- package/react/createStore.d.ts +144 -0
- package/react/hooks/unsafe__useFiveInstance.d.ts +9 -0
- package/react/hooks/useFiveAction.d.ts +147 -0
- package/react/hooks/useFiveCameraDirection.d.ts +7 -0
- package/react/hooks/useFiveCameraRaycaster.d.ts +7 -0
- package/react/hooks/useFiveCurrentObserver.d.ts +11 -0
- package/react/hooks/useFiveCurrentState.d.ts +15 -0
- package/react/hooks/useFiveEventCallback.d.ts +12 -0
- package/react/hooks/useFiveFloor.d.ts +15 -0
- package/react/hooks/useFiveHelper.d.ts +14 -0
- package/react/hooks/useFiveModelBounding.d.ts +5 -0
- package/react/hooks/useFiveModelEffect.d.ts +14 -0
- package/react/hooks/useFiveModelIntersectRaycaster.d.ts +22 -0
- package/react/hooks/useFiveModelReadyState.d.ts +8 -0
- package/react/hooks/useFiveProject2d.d.ts +20 -0
- package/react/hooks/useFiveSceneEffect.d.ts +21 -0
- package/react/hooks/useFiveState.d.ts +6 -0
- package/react/hooks/useFiveWork.d.ts +29 -0
- package/react/index.d.ts +24 -830
- package/react/index.js +3 -3
- package/react/index.mjs +572 -783
- package/react/rendererPool.d.ts +7 -0
- package/react/withFive.d.ts +213 -0
- package/shader-lib/EvenessPlane/index.d.ts +10 -0
- package/shader-lib/PointCloudExpand/index.d.ts +59 -0
- package/shader-lib/PolygonCuter/index.d.ts +52 -0
- package/shader-lib/PolygonCuter/worker.d.ts +14 -0
- package/shader-lib/ShineModel/index.d.ts +7 -0
- package/shader-lib/SweepModel/index.d.ts +7 -0
- package/shader-lib/index.d.ts +5 -86
- package/shader-lib/index.js +13 -14
- package/shader-lib/index.mjs +424 -824
- package/sticker/geometry.d.ts +3 -0
- package/sticker/index.d.ts +68 -71
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +102 -142
- package/umd/five-gltf-loader.js +9 -9
- package/umd/five-line.js +4 -4
- package/umd/five-plugins.js +17 -21
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +13 -14
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +21 -21
- package/umd/five-vue.js +3 -3
- package/umd/five.js +188 -336
- package/vfx/airflow/airflow.d.ts +18 -0
- package/vfx/airflow/fragment-shader.d.ts +2 -0
- package/vfx/airflow/vertex-shader.d.ts +2 -0
- package/vfx/common/scale-shader.d.ts +2 -0
- package/vfx/common/simplex-noise-shader.d.ts +2 -0
- package/vfx/frame/fragment-shader.d.ts +2 -0
- package/vfx/frame/frame.d.ts +22 -0
- package/vfx/frame/vertex-shader.d.ts +2 -0
- package/vfx/index.d.ts +7 -363
- package/vfx/index.js +21 -21
- package/vfx/index.mjs +454 -910
- package/vfx/particle/fragment-shader.d.ts +2 -0
- package/vfx/particle/instance.d.ts +36 -0
- package/vfx/particle/particle.d.ts +205 -0
- package/vfx/particle/utils.d.ts +11 -0
- package/vfx/particle/vertex-shader.d.ts +2 -0
- package/vfx/particle-gpu/fragment-shader.d.ts +2 -0
- package/vfx/particle-gpu/instance.d.ts +36 -0
- package/vfx/particle-gpu/particle.d.ts +95 -0
- package/vfx/particle-gpu/utils.d.ts +11 -0
- package/vfx/particle-gpu/vertex-shader.d.ts +2 -0
- package/vfx/spotLight/fragment-shader.d.ts +2 -0
- package/vfx/spotLight/spotLight.d.ts +15 -0
- package/vfx/spotLight/vertex-shader.d.ts +2 -0
- package/vue/context.d.ts +7 -0
- package/vue/hooks/FiveCanvas.d.ts +36 -0
- package/vue/hooks/FiveProvider.d.ts +35 -0
- package/vue/hooks/unsafe__useFiveInject.d.ts +9 -0
- package/vue/hooks/useFiveAction.d.ts +178 -0
- package/vue/hooks/useFiveCameraDirection.d.ts +8 -0
- package/vue/hooks/useFiveCameraRaycaster.d.ts +8 -0
- package/vue/hooks/useFiveCurrentObserver.d.ts +12 -0
- package/vue/hooks/useFiveCurrentState.d.ts +16 -0
- package/vue/hooks/useFiveEventCallback.d.ts +11 -0
- package/vue/hooks/useFiveFloor.d.ts +16 -0
- package/vue/hooks/useFiveHelper.d.ts +15 -0
- package/vue/hooks/useFiveModel.d.ts +7 -0
- package/vue/hooks/useFiveModelBounding.d.ts +7 -0
- package/vue/hooks/useFiveModelIntersectRaycaster.d.ts +23 -0
- package/vue/hooks/useFiveModelReadyState.d.ts +9 -0
- package/vue/hooks/useFiveProject2d.d.ts +26 -0
- package/vue/hooks/useFiveScene.d.ts +6 -0
- package/vue/hooks/useFiveState.d.ts +16 -0
- package/vue/hooks/useFiveWork.d.ts +30 -0
- package/vue/index.d.ts +23 -467
- package/vue/index.js +3 -3
- package/vue/index.mjs +309 -301
- package/vue/rendererPool.d.ts +10 -0
- package/work-downloader/components/model-3d-tile.d.ts +2 -0
- package/work-downloader/components/model.d.ts +3 -0
- package/work-downloader/components/observer.d.ts +7 -0
- package/work-downloader/download.d.ts +16 -0
- package/work-downloader/index.d.ts +2 -33
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +317 -556
- package/work-downloader/type.d.ts +28 -0
- package/work-downloader/utils/download-to-file.d.ts +1 -0
- package/work-downloader/utils/image-processing.d.ts +7 -0
- package/work-downloader/utils/join-url.d.ts +2 -0
- package/work-downloader/utils/log.d.ts +1 -0
- package/work-downloader/utils/relative-url.d.ts +1 -0
- package/docs/documents/five.FivePlugin.plugin.html +0 -60
- package/docs/documents/plugin.html +0 -60
- package/docs/media/five.ts +0 -2881
- package/docs/media/pass.ts +0 -64
- package/guides/ai-doc-guidelines.md +0 -72
- package/guides/features/3dtile.md +0 -264
- package/guides/features/parameter.md +0 -178
- package/guides/plugin.md +0 -206
- /package/{guides → ai_guides}/release_notes/6.6.md +0 -0
- /package/{guides → ai_guides}/release_notes/6.7.md +0 -0
- /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:
|
|
5
|
-
* Version: 6.8.0-alpha.
|
|
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
|
|
256
|
-
|
|
257
|
-
return
|
|
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
|
-
|
|
409
|
-
|
|
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
|
-
|
|
433
|
-
for (
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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
|
-
|
|
585
|
-
|
|
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
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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
|
-
|
|
684
|
-
|
|
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
|
-
|
|
698
|
-
|
|
699
|
-
var
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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
|
-
|
|
891
|
-
|
|
892
|
-
|
|
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
|
|
1030
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
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
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
float
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
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
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
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
|
-
|
|
1141
|
-
|
|
1142
|
-
(
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
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 };
|