@3driseai/3drise-viewer 0.1.1
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/dist/components/AnimatedObject.d.ts +22 -0
- package/dist/components/AnimatedObject.d.ts.map +1 -0
- package/dist/components/AnimatedObject.js +65 -0
- package/dist/components/Bubbles.d.ts +9 -0
- package/dist/components/Bubbles.d.ts.map +1 -0
- package/dist/components/Bubbles.js +105 -0
- package/dist/components/CameraController.d.ts +10 -0
- package/dist/components/CameraController.d.ts.map +1 -0
- package/dist/components/CameraController.js +158 -0
- package/dist/components/Clouds.d.ts +9 -0
- package/dist/components/Clouds.d.ts.map +1 -0
- package/dist/components/Clouds.js +278 -0
- package/dist/components/Corona.d.ts +18 -0
- package/dist/components/Corona.d.ts.map +1 -0
- package/dist/components/Corona.js +12 -0
- package/dist/components/CreatedObject.d.ts +14 -0
- package/dist/components/CreatedObject.d.ts.map +1 -0
- package/dist/components/CreatedObject.js +103 -0
- package/dist/components/CustomPrimitive.d.ts +12 -0
- package/dist/components/CustomPrimitive.d.ts.map +1 -0
- package/dist/components/CustomPrimitive.js +87 -0
- package/dist/components/Earth.d.ts +8 -0
- package/dist/components/Earth.d.ts.map +1 -0
- package/dist/components/Earth.js +38 -0
- package/dist/components/EffectsGenerator.d.ts +10 -0
- package/dist/components/EffectsGenerator.d.ts.map +1 -0
- package/dist/components/EffectsGenerator.js +71 -0
- package/dist/components/EffectsGroup.d.ts +8 -0
- package/dist/components/EffectsGroup.d.ts.map +1 -0
- package/dist/components/EffectsGroup.js +11 -0
- package/dist/components/EnvironmentManager.d.ts +9 -0
- package/dist/components/EnvironmentManager.d.ts.map +1 -0
- package/dist/components/EnvironmentManager.js +74 -0
- package/dist/components/EnvironmentObject.d.ts +8 -0
- package/dist/components/EnvironmentObject.d.ts.map +1 -0
- package/dist/components/EnvironmentObject.js +14 -0
- package/dist/components/Flares.d.ts +24 -0
- package/dist/components/Flares.d.ts.map +1 -0
- package/dist/components/Flares.js +134 -0
- package/dist/components/Frame.d.ts +23 -0
- package/dist/components/Frame.d.ts.map +1 -0
- package/dist/components/Frame.js +55 -0
- package/dist/components/FrameGeometry.d.ts +10 -0
- package/dist/components/FrameGeometry.d.ts.map +1 -0
- package/dist/components/FrameGeometry.js +17 -0
- package/dist/components/FrameImage.d.ts +2 -0
- package/dist/components/FrameImage.d.ts.map +1 -0
- package/dist/components/FrameImage.js +15 -0
- package/dist/components/Galaxy.d.ts +10 -0
- package/dist/components/Galaxy.d.ts.map +1 -0
- package/dist/components/Galaxy.js +29 -0
- package/dist/components/GalleryLayout.d.ts +12 -0
- package/dist/components/GalleryLayout.d.ts.map +1 -0
- package/dist/components/GalleryLayout.js +20 -0
- package/dist/components/GeometryShape.d.ts +54 -0
- package/dist/components/GeometryShape.d.ts.map +1 -0
- package/dist/components/GeometryShape.js +318 -0
- package/dist/components/Glyphs.d.ts +9 -0
- package/dist/components/Glyphs.d.ts.map +1 -0
- package/dist/components/Glyphs.js +58 -0
- package/dist/components/GridHelper.d.ts +23 -0
- package/dist/components/GridHelper.d.ts.map +1 -0
- package/dist/components/GridHelper.js +36 -0
- package/dist/components/GridsGenerator.d.ts +10 -0
- package/dist/components/GridsGenerator.d.ts.map +1 -0
- package/dist/components/GridsGenerator.js +14 -0
- package/dist/components/HdrPlaylistRenderer.d.ts +10 -0
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -0
- package/dist/components/HdrPlaylistRenderer.js +364 -0
- package/dist/components/ImageGeometry.d.ts +13 -0
- package/dist/components/ImageGeometry.d.ts.map +1 -0
- package/dist/components/ImageGeometry.js +62 -0
- package/dist/components/Lensflare.d.ts +12 -0
- package/dist/components/Lensflare.d.ts.map +1 -0
- package/dist/components/Lensflare.js +66 -0
- package/dist/components/Letter.d.ts +19 -0
- package/dist/components/Letter.d.ts.map +1 -0
- package/dist/components/Letter.js +83 -0
- package/dist/components/Letters.d.ts +16 -0
- package/dist/components/Letters.d.ts.map +1 -0
- package/dist/components/Letters.js +18 -0
- package/dist/components/LightObject.d.ts +8 -0
- package/dist/components/LightObject.d.ts.map +1 -0
- package/dist/components/LightObject.js +65 -0
- package/dist/components/LightsManager.d.ts +8 -0
- package/dist/components/LightsManager.d.ts.map +1 -0
- package/dist/components/LightsManager.js +104 -0
- package/dist/components/Lines.d.ts +9 -0
- package/dist/components/Lines.d.ts.map +1 -0
- package/dist/components/Lines.js +19 -0
- package/dist/components/LoadingIndicator.d.ts +10 -0
- package/dist/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/components/LoadingIndicator.js +6 -0
- package/dist/components/MaterialLibrary.d.ts +9 -0
- package/dist/components/MaterialLibrary.d.ts.map +1 -0
- package/dist/components/MaterialLibrary.js +57 -0
- package/dist/components/Moon.d.ts +13 -0
- package/dist/components/Moon.d.ts.map +1 -0
- package/dist/components/Moon.js +66 -0
- package/dist/components/MyGrid.d.ts +15 -0
- package/dist/components/MyGrid.d.ts.map +1 -0
- package/dist/components/MyGrid.js +72 -0
- package/dist/components/ObjectNode.d.ts +13 -0
- package/dist/components/ObjectNode.d.ts.map +1 -0
- package/dist/components/ObjectNode.js +139 -0
- package/dist/components/ObjectNodeApi.d.ts +13 -0
- package/dist/components/ObjectNodeApi.d.ts.map +1 -0
- package/dist/components/ObjectNodeApi.js +18 -0
- package/dist/components/ObjectsRenderer.d.ts +15 -0
- package/dist/components/ObjectsRenderer.d.ts.map +1 -0
- package/dist/components/ObjectsRenderer.js +40 -0
- package/dist/components/ObjectsRendererApi.d.ts +31 -0
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -0
- package/dist/components/ObjectsRendererApi.js +76 -0
- package/dist/components/Ocean.d.ts +8 -0
- package/dist/components/Ocean.d.ts.map +1 -0
- package/dist/components/Ocean.js +169 -0
- package/dist/components/Outline.d.ts +21 -0
- package/dist/components/Outline.d.ts.map +1 -0
- package/dist/components/Outline.js +14 -0
- package/dist/components/ParticlesR3f.d.ts +11 -0
- package/dist/components/ParticlesR3f.d.ts.map +1 -0
- package/dist/components/ParticlesR3f.js +110 -0
- package/dist/components/Path.d.ts +13 -0
- package/dist/components/Path.d.ts.map +1 -0
- package/dist/components/Path.js +41 -0
- package/dist/components/PathGeometry.d.ts +11 -0
- package/dist/components/PathGeometry.d.ts.map +1 -0
- package/dist/components/PathGeometry.js +109 -0
- package/dist/components/PathRenderer.d.ts +12 -0
- package/dist/components/PathRenderer.d.ts.map +1 -0
- package/dist/components/PathRenderer.js +36 -0
- package/dist/components/Planet.d.ts +16 -0
- package/dist/components/Planet.d.ts.map +1 -0
- package/dist/components/Planet.js +60 -0
- package/dist/components/PointCloud.d.ts +10 -0
- package/dist/components/PointCloud.d.ts.map +1 -0
- package/dist/components/PointCloud.js +113 -0
- package/dist/components/ProductionScene.d.ts +5 -0
- package/dist/components/ProductionScene.d.ts.map +1 -0
- package/dist/components/ProductionScene.js +7 -0
- package/dist/components/ProjectLoader.d.ts +16 -0
- package/dist/components/ProjectLoader.d.ts.map +1 -0
- package/dist/components/ProjectLoader.js +85 -0
- package/dist/components/Rain.d.ts +8 -0
- package/dist/components/Rain.d.ts.map +1 -0
- package/dist/components/Rain.js +259 -0
- package/dist/components/RiseLogo.d.ts +19 -0
- package/dist/components/RiseLogo.d.ts.map +1 -0
- package/dist/components/RiseLogo.js +75 -0
- package/dist/components/SceneBuilder.d.ts +5 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -0
- package/dist/components/SceneBuilder.js +133 -0
- package/dist/components/SceneFog.d.ts +8 -0
- package/dist/components/SceneFog.d.ts.map +1 -0
- package/dist/components/SceneFog.js +19 -0
- package/dist/components/Shape.d.ts +5 -0
- package/dist/components/Shape.d.ts.map +1 -0
- package/dist/components/Shape.js +11 -0
- package/dist/components/ShootingStar.d.ts +16 -0
- package/dist/components/ShootingStar.d.ts.map +1 -0
- package/dist/components/ShootingStar.js +92 -0
- package/dist/components/ShootingStars.d.ts +8 -0
- package/dist/components/ShootingStars.d.ts.map +1 -0
- package/dist/components/ShootingStars.js +41 -0
- package/dist/components/SkyController.d.ts +10 -0
- package/dist/components/SkyController.d.ts.map +1 -0
- package/dist/components/SkyController.js +208 -0
- package/dist/components/SkyMesh.d.ts +10 -0
- package/dist/components/SkyMesh.d.ts.map +1 -0
- package/dist/components/SkyMesh.js +36 -0
- package/dist/components/SkySystem.d.ts +32 -0
- package/dist/components/SkySystem.d.ts.map +1 -0
- package/dist/components/SkySystem.js +46 -0
- package/dist/components/Skybox.d.ts +12 -0
- package/dist/components/Skybox.d.ts.map +1 -0
- package/dist/components/Skybox.js +92 -0
- package/dist/components/SolarSystem.d.ts +8 -0
- package/dist/components/SolarSystem.d.ts.map +1 -0
- package/dist/components/SolarSystem.js +77 -0
- package/dist/components/SparklesBurst.d.ts +9 -0
- package/dist/components/SparklesBurst.d.ts.map +1 -0
- package/dist/components/SparklesBurst.js +62 -0
- package/dist/components/Stars.d.ts +15 -0
- package/dist/components/Stars.d.ts.map +1 -0
- package/dist/components/Stars.js +250 -0
- package/dist/components/Sun.d.ts +15 -0
- package/dist/components/Sun.d.ts.map +1 -0
- package/dist/components/Sun.js +7 -0
- package/dist/components/SunCore.d.ts +18 -0
- package/dist/components/SunCore.d.ts.map +1 -0
- package/dist/components/SunCore.js +14 -0
- package/dist/components/SunLight.d.ts +15 -0
- package/dist/components/SunLight.d.ts.map +1 -0
- package/dist/components/SunLight.js +57 -0
- package/dist/components/Text2D.d.ts +9 -0
- package/dist/components/Text2D.d.ts.map +1 -0
- package/dist/components/Text2D.js +56 -0
- package/dist/components/Text3D.d.ts +10 -0
- package/dist/components/Text3D.d.ts.map +1 -0
- package/dist/components/Text3D.js +8 -0
- package/dist/components/VolumePoints.d.ts +19 -0
- package/dist/components/VolumePoints.d.ts.map +1 -0
- package/dist/components/VolumePoints.js +8 -0
- package/dist/components/cursor/AuraCursor.d.ts +6 -0
- package/dist/components/cursor/AuraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuraCursor.js +30 -0
- package/dist/components/cursor/AuroraCursor.d.ts +6 -0
- package/dist/components/cursor/AuroraCursor.d.ts.map +1 -0
- package/dist/components/cursor/AuroraCursor.js +207 -0
- package/dist/components/cursor/BubblesCursor.d.ts +6 -0
- package/dist/components/cursor/BubblesCursor.d.ts.map +1 -0
- package/dist/components/cursor/BubblesCursor.js +184 -0
- package/dist/components/cursor/CometCursor.d.ts +6 -0
- package/dist/components/cursor/CometCursor.d.ts.map +1 -0
- package/dist/components/cursor/CometCursor.js +191 -0
- package/dist/components/cursor/CrosshairCursor.d.ts +6 -0
- package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -0
- package/dist/components/cursor/CrosshairCursor.js +142 -0
- package/dist/components/cursor/CursorActions.d.ts +8 -0
- package/dist/components/cursor/CursorActions.d.ts.map +1 -0
- package/dist/components/cursor/CursorActions.js +124 -0
- package/dist/components/cursor/CursorController.d.ts +10 -0
- package/dist/components/cursor/CursorController.d.ts.map +1 -0
- package/dist/components/cursor/CursorController.js +5 -0
- package/dist/components/cursor/CursorEffects.d.ts +16 -0
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -0
- package/dist/components/cursor/CursorEffects.js +110 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts +6 -0
- package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -0
- package/dist/components/cursor/FerrofluidCursor.js +102 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts +6 -0
- package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -0
- package/dist/components/cursor/GlyphRingCursor.js +123 -0
- package/dist/components/cursor/LightningCursor.d.ts +6 -0
- package/dist/components/cursor/LightningCursor.d.ts.map +1 -0
- package/dist/components/cursor/LightningCursor.js +28 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts +6 -0
- package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -0
- package/dist/components/cursor/LiquidMetalCursor.js +61 -0
- package/dist/components/cursor/OrbCursor.d.ts +6 -0
- package/dist/components/cursor/OrbCursor.d.ts.map +1 -0
- package/dist/components/cursor/OrbCursor.js +32 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts +6 -0
- package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -0
- package/dist/components/cursor/PlasmaWhipCursor.js +134 -0
- package/dist/components/cursor/SparklesCursor.d.ts +6 -0
- package/dist/components/cursor/SparklesCursor.d.ts.map +1 -0
- package/dist/components/cursor/SparklesCursor.js +151 -0
- package/dist/components/cursor/TeslaCursor.d.ts +6 -0
- package/dist/components/cursor/TeslaCursor.d.ts.map +1 -0
- package/dist/components/cursor/TeslaCursor.js +223 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/BoltFlashAction.js +62 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +114 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ImplosionAction.js +93 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PhaseShiftAction.js +71 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/PlasmaBombAction.js +98 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/RealityTearAction.js +92 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/ShockwaveAction.js +55 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/SparklesBurstAction.js +99 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +11 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/VoronoiFractureAction.js +149 -0
- package/dist/components/effects/AuraEffect.d.ts +10 -0
- package/dist/components/effects/AuraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuraEffect.js +127 -0
- package/dist/components/effects/AuroraEffect.d.ts +10 -0
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -0
- package/dist/components/effects/AuroraEffect.js +112 -0
- package/dist/components/effects/BlackHoleEffect.d.ts +10 -0
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -0
- package/dist/components/effects/BlackHoleEffect.js +193 -0
- package/dist/components/effects/ConstellationEffect.d.ts +10 -0
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -0
- package/dist/components/effects/ConstellationEffect.js +189 -0
- package/dist/components/effects/DataStreamEffect.d.ts +10 -0
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -0
- package/dist/components/effects/DataStreamEffect.js +138 -0
- package/dist/components/effects/DnaHelixEffect.d.ts +10 -0
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -0
- package/dist/components/effects/DnaHelixEffect.js +311 -0
- package/dist/components/effects/Fire.d.ts +20 -0
- package/dist/components/effects/Fire.d.ts.map +1 -0
- package/dist/components/effects/Fire.js +208 -0
- package/dist/components/effects/FireEffect.d.ts +10 -0
- package/dist/components/effects/FireEffect.d.ts.map +1 -0
- package/dist/components/effects/FireEffect.js +194 -0
- package/dist/components/effects/ForcefieldEffect.d.ts +10 -0
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -0
- package/dist/components/effects/ForcefieldEffect.js +132 -0
- package/dist/components/effects/HologramEffect.d.ts +10 -0
- package/dist/components/effects/HologramEffect.d.ts.map +1 -0
- package/dist/components/effects/HologramEffect.js +143 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts +10 -0
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -0
- package/dist/components/effects/IceCrystalsEffect.js +190 -0
- package/dist/components/effects/LightningEffect.d.ts +10 -0
- package/dist/components/effects/LightningEffect.d.ts.map +1 -0
- package/dist/components/effects/LightningEffect.js +240 -0
- package/dist/components/effects/MoleculesEffect.d.ts +10 -0
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -0
- package/dist/components/effects/MoleculesEffect.js +173 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts +10 -0
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -0
- package/dist/components/effects/NeuralNetworkEffect.js +188 -0
- package/dist/components/effects/OrbEffect.d.ts +10 -0
- package/dist/components/effects/OrbEffect.d.ts.map +1 -0
- package/dist/components/effects/OrbEffect.js +291 -0
- package/dist/components/effects/PortalEffect.d.ts +10 -0
- package/dist/components/effects/PortalEffect.d.ts.map +1 -0
- package/dist/components/effects/PortalEffect.js +191 -0
- package/dist/components/effects/ShockwaveEffect.d.ts +10 -0
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -0
- package/dist/components/effects/ShockwaveEffect.js +160 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts +10 -0
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokePlumeEffect.js +141 -0
- package/dist/components/effects/SmokeRibbon.d.ts +13 -0
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -0
- package/dist/components/effects/SmokeRibbon.js +69 -0
- package/dist/components/effects/SmokeRingEffect.d.ts +10 -0
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -0
- package/dist/components/effects/SmokeRingEffect.js +158 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts +10 -0
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -0
- package/dist/components/effects/VolumetricFogEffect.js +111 -0
- package/dist/components/extractOutline.d.ts +18 -0
- package/dist/components/extractOutline.d.ts.map +1 -0
- package/dist/components/extractOutline.js +47 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use3driseShader.d.ts +17 -0
- package/dist/hooks/use3driseShader.d.ts.map +1 -0
- package/dist/hooks/use3driseShader.js +100 -0
- package/dist/hooks/useAnimationEvents.d.ts +10 -0
- package/dist/hooks/useAnimationEvents.d.ts.map +1 -0
- package/dist/hooks/useAnimationEvents.js +49 -0
- package/dist/hooks/useCameraAnimation.d.ts +35 -0
- package/dist/hooks/useCameraAnimation.d.ts.map +1 -0
- package/dist/hooks/useCameraAnimation.js +277 -0
- package/dist/hooks/useContinuousEffects.d.ts +15 -0
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -0
- package/dist/hooks/useContinuousEffects.js +177 -0
- package/dist/hooks/useCubeCamera.d.ts +18 -0
- package/dist/hooks/useCubeCamera.d.ts.map +1 -0
- package/dist/hooks/useCubeCamera.js +73 -0
- package/dist/hooks/useEnvironmentEffects.d.ts +12 -0
- package/dist/hooks/useEnvironmentEffects.d.ts.map +1 -0
- package/dist/hooks/useEnvironmentEffects.js +22 -0
- package/dist/hooks/useFrameAnimations.d.ts +24 -0
- package/dist/hooks/useFrameAnimations.d.ts.map +1 -0
- package/dist/hooks/useFrameAnimations.js +217 -0
- package/dist/hooks/useFrameEffects.d.ts +6 -0
- package/dist/hooks/useFrameEffects.d.ts.map +1 -0
- package/dist/hooks/useFrameEffects.js +19 -0
- package/dist/hooks/useGsapAnimation.d.ts +122 -0
- package/dist/hooks/useGsapAnimation.d.ts.map +1 -0
- package/dist/hooks/useGsapAnimation.js +316 -0
- package/dist/hooks/useInteraction.d.ts +12 -0
- package/dist/hooks/useInteraction.d.ts.map +1 -0
- package/dist/hooks/useInteraction.js +273 -0
- package/dist/hooks/useInteractionEffects.d.ts +11 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -0
- package/dist/hooks/useInteractionEffects.js +74 -0
- package/dist/hooks/useKey.d.ts +26 -0
- package/dist/hooks/useKey.d.ts.map +1 -0
- package/dist/hooks/useKey.js +73 -0
- package/dist/hooks/useLightAnimation.d.ts +10 -0
- package/dist/hooks/useLightAnimation.d.ts.map +1 -0
- package/dist/hooks/useLightAnimation.js +34 -0
- package/dist/hooks/useLightHandlers.d.ts +14 -0
- package/dist/hooks/useLightHandlers.d.ts.map +1 -0
- package/dist/hooks/useLightHandlers.js +116 -0
- package/dist/hooks/useLightMouseMove.d.ts +11 -0
- package/dist/hooks/useLightMouseMove.d.ts.map +1 -0
- package/dist/hooks/useLightMouseMove.js +27 -0
- package/dist/hooks/useLightShadow.d.ts +6 -0
- package/dist/hooks/useLightShadow.d.ts.map +1 -0
- package/dist/hooks/useLightShadow.js +63 -0
- package/dist/hooks/useMaterialApplication.d.ts +4 -0
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -0
- package/dist/hooks/useMaterialApplication.js +157 -0
- package/dist/hooks/useMaterialOptions.d.ts +14 -0
- package/dist/hooks/useMaterialOptions.d.ts.map +1 -0
- package/dist/hooks/useMaterialOptions.js +118 -0
- package/dist/hooks/useMaterialUniforms.d.ts +18 -0
- package/dist/hooks/useMaterialUniforms.d.ts.map +1 -0
- package/dist/hooks/useMaterialUniforms.js +96 -0
- package/dist/hooks/useMeshController.d.ts +3 -0
- package/dist/hooks/useMeshController.d.ts.map +1 -0
- package/dist/hooks/useMeshController.js +168 -0
- package/dist/hooks/useMouseHandlers.d.ts +8 -0
- package/dist/hooks/useMouseHandlers.d.ts.map +1 -0
- package/dist/hooks/useMouseHandlers.js +47 -0
- package/dist/hooks/useNumericAnimation.d.ts +5 -0
- package/dist/hooks/useNumericAnimation.d.ts.map +1 -0
- package/dist/hooks/useNumericAnimation.js +42 -0
- package/dist/hooks/useObjectAnimation.d.ts +13 -0
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -0
- package/dist/hooks/useObjectAnimation.js +35 -0
- package/dist/hooks/useObjectEdges.d.ts +3 -0
- package/dist/hooks/useObjectEdges.d.ts.map +1 -0
- package/dist/hooks/useObjectEdges.js +199 -0
- package/dist/hooks/useObjectEffects.d.ts +23 -0
- package/dist/hooks/useObjectEffects.d.ts.map +1 -0
- package/dist/hooks/useObjectEffects.js +162 -0
- package/dist/hooks/useOrbitControls.d.ts +7 -0
- package/dist/hooks/useOrbitControls.d.ts.map +1 -0
- package/dist/hooks/useOrbitControls.js +9 -0
- package/dist/hooks/useOutline.d.ts +9 -0
- package/dist/hooks/useOutline.d.ts.map +1 -0
- package/dist/hooks/useOutline.js +14 -0
- package/dist/hooks/useParticlePositions.d.ts +19 -0
- package/dist/hooks/useParticlePositions.d.ts.map +1 -0
- package/dist/hooks/useParticlePositions.js +56 -0
- package/dist/hooks/useParticlesColors.d.ts +14 -0
- package/dist/hooks/useParticlesColors.d.ts.map +1 -0
- package/dist/hooks/useParticlesColors.js +27 -0
- package/dist/hooks/useParticlesTextures.d.ts +10 -0
- package/dist/hooks/useParticlesTextures.d.ts.map +1 -0
- package/dist/hooks/useParticlesTextures.js +23 -0
- package/dist/hooks/usePathAnimation.d.ts +26 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -0
- package/dist/hooks/usePathAnimation.js +130 -0
- package/dist/hooks/useSequenceAnimation.d.ts +14 -0
- package/dist/hooks/useSequenceAnimation.d.ts.map +1 -0
- package/dist/hooks/useSequenceAnimation.js +260 -0
- package/dist/hooks/useShadowApplication.d.ts +3 -0
- package/dist/hooks/useShadowApplication.d.ts.map +1 -0
- package/dist/hooks/useShadowApplication.js +31 -0
- package/dist/hooks/useShapeGeometry.d.ts +8 -0
- package/dist/hooks/useShapeGeometry.d.ts.map +1 -0
- package/dist/hooks/useShapeGeometry.js +12 -0
- package/dist/hooks/useSkyAnimation.d.ts +13 -0
- package/dist/hooks/useSkyAnimation.d.ts.map +1 -0
- package/dist/hooks/useSkyAnimation.js +36 -0
- package/dist/hooks/useSkySystem.d.ts +25 -0
- package/dist/hooks/useSkySystem.d.ts.map +1 -0
- package/dist/hooks/useSkySystem.js +59 -0
- package/dist/hooks/useSkyUniforms.d.ts +18 -0
- package/dist/hooks/useSkyUniforms.d.ts.map +1 -0
- package/dist/hooks/useSkyUniforms.js +71 -0
- package/dist/hooks/useTransformControls.d.ts +6 -0
- package/dist/hooks/useTransformControls.d.ts.map +1 -0
- package/dist/hooks/useTransformControls.js +111 -0
- package/dist/hooks/useVolumePoints.d.ts +9 -0
- package/dist/hooks/useVolumePoints.d.ts.map +1 -0
- package/dist/hooks/useVolumePoints.js +22 -0
- package/dist/hooks/useWaterEnvironment.d.ts +5 -0
- package/dist/hooks/useWaterEnvironment.d.ts.map +1 -0
- package/dist/hooks/useWaterEnvironment.js +27 -0
- package/dist/hooks/useWaterReflections.d.ts +18 -0
- package/dist/hooks/useWaterReflections.d.ts.map +1 -0
- package/dist/hooks/useWaterReflections.js +84 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/services/AnimationsManager.d.ts +33 -0
- package/dist/services/AnimationsManager.d.ts.map +1 -0
- package/dist/services/AnimationsManager.js +58 -0
- package/dist/services/FontManager.d.ts +32 -0
- package/dist/services/FontManager.d.ts.map +1 -0
- package/dist/services/FontManager.js +76 -0
- package/dist/services/TexturesManager.d.ts +17 -0
- package/dist/services/TexturesManager.d.ts.map +1 -0
- package/dist/services/TexturesManager.js +48 -0
- package/dist/shaders/RainMaterial.d.ts +34 -0
- package/dist/shaders/RainMaterial.d.ts.map +1 -0
- package/dist/shaders/RainMaterial.js +56 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts +228 -0
- package/dist/shaders/ShaderEffectsMaterial.d.ts.map +1 -0
- package/dist/shaders/ShaderEffectsMaterial.js +233 -0
- package/dist/shaders/ShootingStarMaterial.d.ts +14 -0
- package/dist/shaders/ShootingStarMaterial.d.ts.map +1 -0
- package/dist/shaders/ShootingStarMaterial.js +33 -0
- package/dist/shaders/SkyboxMaterial.d.ts +38 -0
- package/dist/shaders/SkyboxMaterial.d.ts.map +1 -0
- package/dist/shaders/SkyboxMaterial.js +57 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts +2 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.d.ts.map +1 -0
- package/dist/shaders/effects/EffectsVertexFunctions.glsl.js +115 -0
- package/dist/utils/CameraSingleton.d.ts +43 -0
- package/dist/utils/CameraSingleton.d.ts.map +1 -0
- package/dist/utils/CameraSingleton.js +199 -0
- package/dist/utils/anchorUtils.d.ts +10 -0
- package/dist/utils/anchorUtils.d.ts.map +1 -0
- package/dist/utils/anchorUtils.js +13 -0
- package/dist/utils/cursorPicking.d.ts +8 -0
- package/dist/utils/cursorPicking.d.ts.map +1 -0
- package/dist/utils/cursorPicking.js +35 -0
- package/dist/utils/extractOutline.d.ts +18 -0
- package/dist/utils/extractOutline.d.ts.map +1 -0
- package/dist/utils/extractOutline.js +47 -0
- package/dist/utils/frameAnimations.d.ts +49 -0
- package/dist/utils/frameAnimations.d.ts.map +1 -0
- package/dist/utils/frameAnimations.js +213 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts +5 -0
- package/dist/utils/handleGenerativeEffectsAnimations.d.ts.map +1 -0
- package/dist/utils/handleGenerativeEffectsAnimations.js +268 -0
- package/dist/utils/hasHoverAnimation.d.ts +3 -0
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -0
- package/dist/utils/hasHoverAnimation.js +15 -0
- package/dist/utils/materialUtils.d.ts +23 -0
- package/dist/utils/materialUtils.d.ts.map +1 -0
- package/dist/utils/materialUtils.js +81 -0
- package/dist/utils/particleAnimations.d.ts +3 -0
- package/dist/utils/particleAnimations.d.ts.map +1 -0
- package/dist/utils/particleAnimations.js +17 -0
- package/dist/utils/sampleVolume.d.ts +21 -0
- package/dist/utils/sampleVolume.d.ts.map +1 -0
- package/dist/utils/sampleVolume.js +44 -0
- package/dist/utils/sceneQuery.d.ts +9 -0
- package/dist/utils/sceneQuery.d.ts.map +1 -0
- package/dist/utils/sceneQuery.js +22 -0
- package/dist/utils/shaderUtils.d.ts +6 -0
- package/dist/utils/shaderUtils.d.ts.map +1 -0
- package/dist/utils/shaderUtils.js +151 -0
- package/dist/utils/shapes.d.ts +74 -0
- package/dist/utils/shapes.d.ts.map +1 -0
- package/dist/utils/shapes.js +443 -0
- package/dist/utils/textEffects.d.ts +31 -0
- package/dist/utils/textEffects.d.ts.map +1 -0
- package/dist/utils/textEffects.js +61 -0
- package/dist/utils/utils3d.d.ts +7 -0
- package/dist/utils/utils3d.d.ts.map +1 -0
- package/dist/utils/utils3d.js +34 -0
- package/package.json +44 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
// ── Shared vert (normal + viewDir) ────────────────────────────────────────────
|
|
7
|
+
const sharedVert = /* glsl */ `
|
|
8
|
+
varying vec3 vNormal;
|
|
9
|
+
varying vec3 vViewDir;
|
|
10
|
+
varying vec3 vWorldNormal;
|
|
11
|
+
void main() {
|
|
12
|
+
vNormal = normalize(normalMatrix * normal);
|
|
13
|
+
vWorldNormal = normalize((modelMatrix * vec4(normal, 0.0)).xyz);
|
|
14
|
+
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
15
|
+
vViewDir = normalize(-mv.xyz);
|
|
16
|
+
gl_Position = projectionMatrix * mv;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
// ── CORE: boiling solar surface ───────────────────────────────────────────────
|
|
20
|
+
const coreFrag = /* glsl */ `
|
|
21
|
+
uniform float u_time;
|
|
22
|
+
uniform vec3 uInnerColor;
|
|
23
|
+
uniform vec3 uOuterColor;
|
|
24
|
+
uniform float uOpacity;
|
|
25
|
+
uniform float uNoiseAmount;
|
|
26
|
+
uniform float uIntensity;
|
|
27
|
+
uniform float uPulseSpeed;
|
|
28
|
+
|
|
29
|
+
varying vec3 vNormal;
|
|
30
|
+
varying vec3 vViewDir;
|
|
31
|
+
varying vec3 vWorldNormal;
|
|
32
|
+
|
|
33
|
+
float hash(vec3 p){ return fract(sin(dot(p,vec3(127.1,311.7,74.7)))*43758.5453); }
|
|
34
|
+
float noise(vec3 p){
|
|
35
|
+
vec3 i=floor(p); vec3 f=fract(p); f=f*f*(3.-2.*f);
|
|
36
|
+
return mix(mix(mix(hash(i),hash(i+vec3(1,0,0)),f.x),mix(hash(i+vec3(0,1,0)),hash(i+vec3(1,1,0)),f.x),f.y),
|
|
37
|
+
mix(mix(hash(i+vec3(0,0,1)),hash(i+vec3(1,0,1)),f.x),mix(hash(i+vec3(0,1,1)),hash(i+vec3(1,1,1)),f.x),f.y),f.z);
|
|
38
|
+
}
|
|
39
|
+
// 6-octave FBM for rich surface detail
|
|
40
|
+
float fbm(vec3 p){
|
|
41
|
+
float v=0., a=0.5;
|
|
42
|
+
for(int i=0;i<6;i++){ v+=a*noise(p); p=p*2.13+vec3(1.7,9.2,3.7); a*=0.5; }
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void main() {
|
|
47
|
+
// Animated surface boiling — rotate noise field over time
|
|
48
|
+
vec3 nCoord = vWorldNormal * 5.5 + vec3(u_time * 0.35, u_time * 0.18, u_time * -0.22);
|
|
49
|
+
float f = fbm(nCoord);
|
|
50
|
+
|
|
51
|
+
// Active regions: bright convective cells
|
|
52
|
+
float cells = smoothstep(0.54, 0.72, f) * 4.0;
|
|
53
|
+
// Cool lanes between cells (slightly darker)
|
|
54
|
+
float cool = (1.0 - smoothstep(0.38, 0.50, f)) * 0.3;
|
|
55
|
+
// Solar flares: ultra-sharp spikes where FBM peaks
|
|
56
|
+
float flares = smoothstep(0.70, 0.85, f) * 6.0;
|
|
57
|
+
|
|
58
|
+
float pulse = 0.85 + 0.15 * sin(u_time * uPulseSpeed * 2.3);
|
|
59
|
+
float limb = 1.0 - abs(dot(vNormal, vViewDir)) * 0.4; // limb darkening
|
|
60
|
+
|
|
61
|
+
// Color: white-hot core cells, outer-color cool lanes
|
|
62
|
+
vec3 col = mix(uOuterColor, uInnerColor, f * 1.8 + cells * 0.3);
|
|
63
|
+
col += uInnerColor * flares;
|
|
64
|
+
col -= uOuterColor * cool;
|
|
65
|
+
col *= pulse * limb * (1.0 + uNoiseAmount * cells);
|
|
66
|
+
|
|
67
|
+
float alpha = (0.85 + cells * 0.15) * uOpacity * uIntensity;
|
|
68
|
+
gl_FragColor = vec4(col, alpha);
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
// ── PLASMA SHELL: iridescent + FBM tendrils ───────────────────────────────────
|
|
72
|
+
const plasmaFrag = /* glsl */ `
|
|
73
|
+
uniform float u_time;
|
|
74
|
+
uniform float uLayerIndex; // 0..1
|
|
75
|
+
uniform vec3 uInnerColor;
|
|
76
|
+
uniform vec3 uOuterColor;
|
|
77
|
+
uniform float uOpacity;
|
|
78
|
+
uniform float uNoiseAmount;
|
|
79
|
+
uniform float uPulseSpeed;
|
|
80
|
+
uniform float uIntensity;
|
|
81
|
+
|
|
82
|
+
varying vec3 vNormal;
|
|
83
|
+
varying vec3 vViewDir;
|
|
84
|
+
varying vec3 vWorldNormal;
|
|
85
|
+
|
|
86
|
+
vec3 hsv2rgb(float h, float s, float v){
|
|
87
|
+
vec3 rgb=clamp(abs(mod(h*6.+vec3(0.,4.,2.),6.)-3.)-1.,0.,1.);
|
|
88
|
+
return v*mix(vec3(1.),rgb,s);
|
|
89
|
+
}
|
|
90
|
+
float hash(vec3 p){ return fract(sin(dot(p,vec3(127.1,311.7,74.7)))*43758.5453); }
|
|
91
|
+
float noise(vec3 p){
|
|
92
|
+
vec3 i=floor(p); vec3 f=fract(p); f=f*f*(3.-2.*f);
|
|
93
|
+
return mix(mix(mix(hash(i),hash(i+vec3(1,0,0)),f.x),mix(hash(i+vec3(0,1,0)),hash(i+vec3(1,1,0)),f.x),f.y),
|
|
94
|
+
mix(mix(hash(i+vec3(0,0,1)),hash(i+vec3(1,0,1)),f.x),mix(hash(i+vec3(0,1,1)),hash(i+vec3(1,1,1)),f.x),f.y),f.z);
|
|
95
|
+
}
|
|
96
|
+
float fbm(vec3 p){ float v=0.,a=0.5; for(int i=0;i<5;i++){v+=a*noise(p);p=p*2.17+vec3(1.7,9.2,3.7);a*=0.5;} return v; }
|
|
97
|
+
|
|
98
|
+
void main() {
|
|
99
|
+
vec3 viewDir = normalize(vViewDir);
|
|
100
|
+
float ndv = abs(dot(vNormal, viewDir));
|
|
101
|
+
|
|
102
|
+
// Fresnel edge glow
|
|
103
|
+
float fresnel = pow(1.0 - ndv, 2.5 - uLayerIndex);
|
|
104
|
+
|
|
105
|
+
// 5-octave FBM driven by world normal + time
|
|
106
|
+
float f = fbm(vWorldNormal * (3.0 + uLayerIndex * 2.0) + vec3(u_time * (0.15 + uLayerIndex * 0.08)));
|
|
107
|
+
|
|
108
|
+
// Iridescent hue: shifts with view angle, layer depth, and time
|
|
109
|
+
float innerHue = 0.0; // derive from innerColor
|
|
110
|
+
float hue = mod(ndv * 0.5 - uLayerIndex * 0.2 + u_time * 0.05 + f * 0.15, 1.0);
|
|
111
|
+
vec3 iriCol = hsv2rgb(hue, 0.9 - uLayerIndex * 0.2, 1.0);
|
|
112
|
+
|
|
113
|
+
// Electric tendrils: sharp bright streamers where FBM exceeds threshold
|
|
114
|
+
float tendril = smoothstep(0.62 - uLayerIndex * 0.04, 0.78, f);
|
|
115
|
+
// Plasma cells: lower threshold dimmer glow
|
|
116
|
+
float plasma = smoothstep(0.50, 0.65, f) * 0.5;
|
|
117
|
+
|
|
118
|
+
float pulse = 0.6 + 0.4 * sin(u_time * uPulseSpeed + uLayerIndex * 2.4);
|
|
119
|
+
|
|
120
|
+
vec3 col = iriCol + iriCol * (tendril * 2.0 + plasma);
|
|
121
|
+
col = mix(col, uInnerColor, tendril * 0.3); // brightest tendrils go white
|
|
122
|
+
|
|
123
|
+
float noiseBlend = (1.0 - uNoiseAmount) + uNoiseAmount * f;
|
|
124
|
+
float alpha = fresnel * noiseBlend * uOpacity * pulse
|
|
125
|
+
* (1.0 - uLayerIndex * 0.28) * uIntensity;
|
|
126
|
+
if (alpha < 0.004) discard;
|
|
127
|
+
|
|
128
|
+
gl_FragColor = vec4(col, alpha);
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
// ── OUTER DIFFUSE GLOW ────────────────────────────────────────────────────────
|
|
132
|
+
const glowFrag = /* glsl */ `
|
|
133
|
+
uniform float u_time;
|
|
134
|
+
uniform vec3 uOuterColor;
|
|
135
|
+
uniform float uOpacity;
|
|
136
|
+
uniform float uPulseSpeed;
|
|
137
|
+
|
|
138
|
+
varying vec3 vNormal;
|
|
139
|
+
varying vec3 vViewDir;
|
|
140
|
+
|
|
141
|
+
void main() {
|
|
142
|
+
float ndv = abs(dot(normalize(vNormal), normalize(vViewDir)));
|
|
143
|
+
float fresnel = pow(1.0 - ndv, 1.2);
|
|
144
|
+
float pulse = 0.55 + 0.45 * sin(u_time * uPulseSpeed * 0.7 + 1.2);
|
|
145
|
+
float alpha = fresnel * uOpacity * pulse * 0.5;
|
|
146
|
+
if (alpha < 0.003) discard;
|
|
147
|
+
// Slowly cycle hue of the outer glow
|
|
148
|
+
float hue = mod(u_time * 0.04, 1.0);
|
|
149
|
+
vec3 tint = mix(uOuterColor, vec3(cos(hue*6.28)*0.5+0.5, cos((hue+0.33)*6.28)*0.5+0.5, cos((hue+0.67)*6.28)*0.5+0.5), 0.25);
|
|
150
|
+
gl_FragColor = vec4(tint, alpha);
|
|
151
|
+
}
|
|
152
|
+
`;
|
|
153
|
+
// ── CORONA RING ───────────────────────────────────────────────────────────────
|
|
154
|
+
const coronaVert = /* glsl */ `
|
|
155
|
+
attribute float aAngle;
|
|
156
|
+
varying float vAngle;
|
|
157
|
+
void main() {
|
|
158
|
+
vAngle = aAngle;
|
|
159
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
const coronaFrag = /* glsl */ `
|
|
163
|
+
uniform float u_time;
|
|
164
|
+
uniform vec3 uCoronaColor;
|
|
165
|
+
uniform float uOpacity;
|
|
166
|
+
uniform float uIntensity;
|
|
167
|
+
varying float vAngle;
|
|
168
|
+
|
|
169
|
+
vec3 hsv2rgb(float h, float s, float v){
|
|
170
|
+
vec3 rgb=clamp(abs(mod(h*6.+vec3(0.,4.,2.),6.)-3.)-1.,0.,1.);
|
|
171
|
+
return v*mix(vec3(1.),rgb,s);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
void main() {
|
|
175
|
+
// Color flows around the ring over time
|
|
176
|
+
float hue = mod(vAngle / 6.28318 + u_time * 0.15, 1.0);
|
|
177
|
+
vec3 col = mix(uCoronaColor, hsv2rgb(hue, 0.8, 1.0), 0.6);
|
|
178
|
+
// Pulse brightness
|
|
179
|
+
float pulse = 0.6 + 0.4 * sin(u_time * 2.5 + vAngle * 3.0);
|
|
180
|
+
float alpha = uOpacity * pulse * uIntensity;
|
|
181
|
+
gl_FragColor = vec4(col * (1.0 + pulse), alpha);
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
const OrbEffect = ({ boundingRadius, config, animations }) => {
|
|
185
|
+
const { coreSize, glowLayers, innerColor, outerColor, coronaEnabled, coronaColor, noiseAmount, pulseSpeed, opacity, speed, intensity } = config;
|
|
186
|
+
const startValuesCacheRef = useRef({});
|
|
187
|
+
const innerColorVec = useMemo(() => { const c = new THREE.Color(innerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerColor]);
|
|
188
|
+
const outerColorVec = useMemo(() => { const c = new THREE.Color(outerColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerColor]);
|
|
189
|
+
const coronaColorVec = useMemo(() => { const c = new THREE.Color(coronaColor); return new THREE.Vector3(c.r, c.g, c.b); }, [coronaColor]);
|
|
190
|
+
const coreR = boundingRadius * coreSize;
|
|
191
|
+
// Core material — boiling solar surface
|
|
192
|
+
const coreMat = useMemo(() => new THREE.ShaderMaterial({
|
|
193
|
+
vertexShader: sharedVert,
|
|
194
|
+
fragmentShader: coreFrag,
|
|
195
|
+
uniforms: {
|
|
196
|
+
u_time: { value: 0 },
|
|
197
|
+
uInnerColor: { value: innerColorVec },
|
|
198
|
+
uOuterColor: { value: outerColorVec },
|
|
199
|
+
uOpacity: { value: opacity },
|
|
200
|
+
uNoiseAmount: { value: noiseAmount },
|
|
201
|
+
uIntensity: { value: intensity },
|
|
202
|
+
uPulseSpeed: { value: pulseSpeed * speed },
|
|
203
|
+
},
|
|
204
|
+
transparent: true,
|
|
205
|
+
depthWrite: false,
|
|
206
|
+
blending: THREE.AdditiveBlending,
|
|
207
|
+
}), [innerColorVec, outerColorVec, opacity, noiseAmount, intensity, pulseSpeed, speed]);
|
|
208
|
+
// Plasma shell materials — one per layer
|
|
209
|
+
const shellMats = useMemo(() => Array.from({ length: glowLayers }, (_, i) => new THREE.ShaderMaterial({
|
|
210
|
+
vertexShader: sharedVert,
|
|
211
|
+
fragmentShader: plasmaFrag,
|
|
212
|
+
uniforms: {
|
|
213
|
+
u_time: { value: 0 },
|
|
214
|
+
uLayerIndex: { value: glowLayers > 1 ? i / (glowLayers - 1) : 0 },
|
|
215
|
+
uInnerColor: { value: innerColorVec },
|
|
216
|
+
uOuterColor: { value: outerColorVec },
|
|
217
|
+
uOpacity: { value: opacity },
|
|
218
|
+
uNoiseAmount: { value: noiseAmount },
|
|
219
|
+
uPulseSpeed: { value: pulseSpeed * speed },
|
|
220
|
+
uIntensity: { value: intensity },
|
|
221
|
+
},
|
|
222
|
+
transparent: true,
|
|
223
|
+
depthWrite: false,
|
|
224
|
+
blending: THREE.AdditiveBlending,
|
|
225
|
+
side: THREE.BackSide,
|
|
226
|
+
})), [glowLayers, innerColorVec, outerColorVec, opacity, noiseAmount, pulseSpeed, speed, intensity]);
|
|
227
|
+
// Outer diffuse glow
|
|
228
|
+
const glowMat = useMemo(() => new THREE.ShaderMaterial({
|
|
229
|
+
vertexShader: sharedVert,
|
|
230
|
+
fragmentShader: glowFrag,
|
|
231
|
+
uniforms: {
|
|
232
|
+
u_time: { value: 0 },
|
|
233
|
+
uOuterColor: { value: outerColorVec },
|
|
234
|
+
uOpacity: { value: opacity * 0.6 },
|
|
235
|
+
uPulseSpeed: { value: pulseSpeed * speed },
|
|
236
|
+
},
|
|
237
|
+
transparent: true,
|
|
238
|
+
depthWrite: false,
|
|
239
|
+
blending: THREE.AdditiveBlending,
|
|
240
|
+
side: THREE.BackSide,
|
|
241
|
+
}), [outerColorVec, opacity, pulseSpeed, speed]);
|
|
242
|
+
// Corona ring geometry — torus with per-vertex angle attribute for color flow
|
|
243
|
+
const { coronaGeo, coronaMat } = useMemo(() => {
|
|
244
|
+
const tubeSegs = 80;
|
|
245
|
+
const geo = new THREE.TorusGeometry(coreR * 2.8, coreR * 0.12, 8, tubeSegs);
|
|
246
|
+
const count = geo.attributes.position.count;
|
|
247
|
+
// Per-vertex angle around the ring (0 → 2π)
|
|
248
|
+
const angles = new Float32Array(count);
|
|
249
|
+
// TorusGeometry vertices go around the major circle; approximate angle from XZ
|
|
250
|
+
const pos = geo.attributes.position;
|
|
251
|
+
for (let i = 0; i < count; i++) {
|
|
252
|
+
angles[i] = Math.atan2(pos.getZ(i), pos.getX(i)) + Math.PI;
|
|
253
|
+
}
|
|
254
|
+
geo.setAttribute('aAngle', new THREE.BufferAttribute(angles, 1));
|
|
255
|
+
const mat = new THREE.ShaderMaterial({
|
|
256
|
+
vertexShader: coronaVert,
|
|
257
|
+
fragmentShader: coronaFrag,
|
|
258
|
+
uniforms: {
|
|
259
|
+
u_time: { value: 0 },
|
|
260
|
+
uCoronaColor: { value: coronaColorVec },
|
|
261
|
+
uOpacity: { value: opacity * 0.85 },
|
|
262
|
+
uIntensity: { value: intensity },
|
|
263
|
+
},
|
|
264
|
+
transparent: true,
|
|
265
|
+
depthWrite: false,
|
|
266
|
+
blending: THREE.AdditiveBlending,
|
|
267
|
+
});
|
|
268
|
+
return { coronaGeo: geo, coronaMat: mat };
|
|
269
|
+
}, [coreR, coronaColorVec, opacity, intensity]);
|
|
270
|
+
const coronaGroupRef = useRef(null);
|
|
271
|
+
const allMats = useMemo(() => [coreMat, ...shellMats, glowMat, coronaMat], [coreMat, shellMats, glowMat, coronaMat]);
|
|
272
|
+
useFrame((state, delta) => {
|
|
273
|
+
const t = state.clock.getElapsedTime();
|
|
274
|
+
for (const mat of allMats)
|
|
275
|
+
mat.uniforms.u_time.value = t;
|
|
276
|
+
// Tilt the corona ring and rotate slowly
|
|
277
|
+
if (coronaGroupRef.current) {
|
|
278
|
+
coronaGroupRef.current.rotation.z += delta * speed * 0.4;
|
|
279
|
+
}
|
|
280
|
+
if (animations?.length) {
|
|
281
|
+
applyGenerativeAnimations(allMats, animations, startValuesCacheRef.current, Date.now(), false);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
const glowR = coreR * (3.5 + glowLayers * 0.6);
|
|
285
|
+
return (_jsxs("group", { children: [_jsx("mesh", { material: coreMat, children: _jsx("sphereGeometry", { args: [coreR, 48, 48] }) }), Array.from({ length: glowLayers }, (_, i) => {
|
|
286
|
+
const layerT = glowLayers > 1 ? i / (glowLayers - 1) : 0;
|
|
287
|
+
const r = coreR * (1.35 + layerT * layerT * 1.8);
|
|
288
|
+
return (_jsx("mesh", { material: shellMats[i], children: _jsx("sphereGeometry", { args: [r, 40, 40] }) }, i));
|
|
289
|
+
}), _jsx("mesh", { material: glowMat, children: _jsx("sphereGeometry", { args: [glowR, 32, 32] }) }), coronaEnabled && (_jsx("group", { ref: coronaGroupRef, rotation: [Math.PI * 0.18, 0, Math.PI * 0.08], children: _jsx("mesh", { geometry: coronaGeo, material: coronaMat }) }))] }));
|
|
290
|
+
};
|
|
291
|
+
export default OrbEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PortalConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface PortalEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: PortalConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const PortalEffect: React.FC<PortalEffectProps>;
|
|
9
|
+
export default PortalEffect;
|
|
10
|
+
//# sourceMappingURL=PortalEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortalEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/PortalEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,UAAU,iBAAiB;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAgHD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2E7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
// Multi-layer vortex disc
|
|
7
|
+
const discVertShader = /* glsl */ `
|
|
8
|
+
varying vec2 vUv;
|
|
9
|
+
void main() {
|
|
10
|
+
vUv = uv;
|
|
11
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const discFragShader = /* glsl */ `
|
|
15
|
+
uniform float u_time;
|
|
16
|
+
uniform float uSpiralTurns;
|
|
17
|
+
uniform float uRotationSpeed;
|
|
18
|
+
uniform vec3 uInnerColor;
|
|
19
|
+
uniform vec3 uOuterColor;
|
|
20
|
+
uniform float uOpacity;
|
|
21
|
+
uniform float uIntensity;
|
|
22
|
+
|
|
23
|
+
varying vec2 vUv;
|
|
24
|
+
|
|
25
|
+
float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
|
|
26
|
+
|
|
27
|
+
void main() {
|
|
28
|
+
vec2 centered = vUv * 2.0 - 1.0;
|
|
29
|
+
float dist = length(centered);
|
|
30
|
+
if (dist > 1.0) discard;
|
|
31
|
+
|
|
32
|
+
float angle = atan(centered.y, centered.x);
|
|
33
|
+
const float TAU = 6.28318530718;
|
|
34
|
+
float t = u_time * uRotationSpeed;
|
|
35
|
+
|
|
36
|
+
// Three counter-rotating spiral layers
|
|
37
|
+
float s1 = fract(dist * uSpiralTurns - angle / TAU + t);
|
|
38
|
+
float s2 = fract(dist * uSpiralTurns * 0.6 + angle / TAU - t * 1.4);
|
|
39
|
+
float s3 = fract(dist * uSpiralTurns * 2.2 - angle / TAU * 1.5 + t * 2.1);
|
|
40
|
+
|
|
41
|
+
float w3 = pow(1.0 - dist, 2.0);
|
|
42
|
+
float vortex = s1 * 0.45 + s2 * 0.30 * (1.0 - w3) + s3 * 0.60 * w3;
|
|
43
|
+
|
|
44
|
+
// Gravitational lensing rim
|
|
45
|
+
float rimRing = exp(-pow((dist - 0.92) / 0.04, 2.0)) * 3.0;
|
|
46
|
+
float rim = pow(smoothstep(0.85, 1.0, dist), 0.7) * 1.5;
|
|
47
|
+
|
|
48
|
+
// Singularity core
|
|
49
|
+
float core = exp(-dist * dist * 22.0) * 4.0;
|
|
50
|
+
float singularity = exp(-dist * dist * 90.0) * 8.0;
|
|
51
|
+
|
|
52
|
+
float edgeFade = 1.0 - smoothstep(0.72, 1.0, dist);
|
|
53
|
+
float noise = hash(vec2(dist * 8.0 + t * 0.3, angle));
|
|
54
|
+
float flux = 0.85 + 0.15 * noise;
|
|
55
|
+
|
|
56
|
+
vec3 rimLight = mix(uOuterColor * 2.0, vec3(1.0, 0.9, 0.7), rimRing * 0.5);
|
|
57
|
+
vec3 col = mix(rimLight, uInnerColor, vortex * 0.7 + core * 0.3) * flux;
|
|
58
|
+
col += vec3(1.0, 0.95, 0.85) * (singularity + core * 0.4);
|
|
59
|
+
col += uOuterColor * rim * 0.8;
|
|
60
|
+
|
|
61
|
+
float alpha = (vortex * 0.5 + edgeFade * 0.25 + core * 0.5 + rim * 0.4 + singularity * 0.3)
|
|
62
|
+
* uOpacity * uIntensity;
|
|
63
|
+
if (alpha < 0.008) discard;
|
|
64
|
+
gl_FragColor = vec4(col, alpha);
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
// ── Event-horizon dust — GPU animated, all motion in vertex shader ────────────
|
|
68
|
+
// Each particle orbits independently at a slightly perturbed radius, height, and speed.
|
|
69
|
+
const dustVertShader = /* glsl */ `
|
|
70
|
+
attribute float aAngle; // initial angle 0..TAU
|
|
71
|
+
attribute float aRadiusOff; // -0.12..+0.12 (fractional deviation from rim radius)
|
|
72
|
+
attribute float aHeightOff; // -0.08..+0.08 relative height deviation
|
|
73
|
+
attribute float aSpeed; // orbit speed multiplier 0.3..1.7
|
|
74
|
+
attribute float aPhase; // twinkle phase
|
|
75
|
+
|
|
76
|
+
uniform float u_time;
|
|
77
|
+
uniform float uRadius;
|
|
78
|
+
uniform float uPointSize;
|
|
79
|
+
uniform float u_speed;
|
|
80
|
+
|
|
81
|
+
varying float vAlpha;
|
|
82
|
+
|
|
83
|
+
void main() {
|
|
84
|
+
const float TAU = 6.28318530718;
|
|
85
|
+
|
|
86
|
+
float angle = aAngle + u_time * u_speed * aSpeed;
|
|
87
|
+
float r = uRadius * (1.0 + aRadiusOff);
|
|
88
|
+
float y = uRadius * aHeightOff * sin(angle * 2.3 + aPhase + u_time * 0.7);
|
|
89
|
+
|
|
90
|
+
vec3 pos = vec3(cos(angle) * r, y, sin(angle) * r);
|
|
91
|
+
|
|
92
|
+
// Subtle twinkle — most dust is nearly invisible, occasionally flickers bright
|
|
93
|
+
float twinkle = pow(max(0.0, sin(u_time * 1.8 + aPhase)), 6.0); // sharp spikes
|
|
94
|
+
float base = 0.08 + 0.12 * (0.5 + 0.5 * sin(aPhase + u_time * 0.4));
|
|
95
|
+
vAlpha = base + twinkle * 0.7;
|
|
96
|
+
|
|
97
|
+
vec4 mv = modelViewMatrix * vec4(pos, 1.0);
|
|
98
|
+
gl_PointSize = uPointSize * (0.4 + twinkle * 1.6) * (180.0 / -mv.z);
|
|
99
|
+
gl_Position = projectionMatrix * mv;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
const dustFragShader = /* glsl */ `
|
|
103
|
+
uniform vec3 uColor;
|
|
104
|
+
uniform float uOpacity;
|
|
105
|
+
varying float vAlpha;
|
|
106
|
+
|
|
107
|
+
void main() {
|
|
108
|
+
vec2 coord = gl_PointCoord - 0.5;
|
|
109
|
+
float dist = length(coord);
|
|
110
|
+
if (dist > 0.5) discard;
|
|
111
|
+
float glow = exp(-dist * dist * 9.0);
|
|
112
|
+
gl_FragColor = vec4(uColor, vAlpha * uOpacity * glow);
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
const PortalEffect = ({ boundingRadius, config, animations }) => {
|
|
116
|
+
const { radius, spiralTurns, innerGlowColor, outerGlowColor, rotationSpeed, particleRingEnabled, particleCount, opacity, speed, intensity } = config;
|
|
117
|
+
const startValuesCacheRef = useRef({});
|
|
118
|
+
const r = boundingRadius * radius;
|
|
119
|
+
const innerColorVec = useMemo(() => { const c = new THREE.Color(innerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [innerGlowColor]);
|
|
120
|
+
const outerColorVec = useMemo(() => { const c = new THREE.Color(outerGlowColor); return new THREE.Vector3(c.r, c.g, c.b); }, [outerGlowColor]);
|
|
121
|
+
const discMaterial = useMemo(() => new THREE.ShaderMaterial({
|
|
122
|
+
vertexShader: discVertShader,
|
|
123
|
+
fragmentShader: discFragShader,
|
|
124
|
+
uniforms: {
|
|
125
|
+
u_time: { value: 0 },
|
|
126
|
+
uSpiralTurns: { value: spiralTurns },
|
|
127
|
+
uRotationSpeed: { value: rotationSpeed * speed },
|
|
128
|
+
uInnerColor: { value: innerColorVec },
|
|
129
|
+
uOuterColor: { value: outerColorVec },
|
|
130
|
+
uOpacity: { value: opacity },
|
|
131
|
+
uIntensity: { value: intensity },
|
|
132
|
+
},
|
|
133
|
+
transparent: true,
|
|
134
|
+
depthWrite: false,
|
|
135
|
+
blending: THREE.AdditiveBlending,
|
|
136
|
+
side: THREE.DoubleSide,
|
|
137
|
+
}), [spiralTurns, rotationSpeed, speed, innerColorVec, outerColorVec, opacity, intensity]);
|
|
138
|
+
// ── Event-horizon dust ──────────────────────────────────────────────────────
|
|
139
|
+
const { dustGeo, dustMat } = useMemo(() => {
|
|
140
|
+
const count = particleCount;
|
|
141
|
+
const angles = new Float32Array(count);
|
|
142
|
+
const radOffsets = new Float32Array(count);
|
|
143
|
+
const heightOffs = new Float32Array(count);
|
|
144
|
+
const speeds = new Float32Array(count);
|
|
145
|
+
const phases = new Float32Array(count);
|
|
146
|
+
for (let i = 0; i < count; i++) {
|
|
147
|
+
angles[i] = (i / count) * Math.PI * 2 + Math.random() * 0.2;
|
|
148
|
+
radOffsets[i] = (Math.random() - 0.5) * 0.24;
|
|
149
|
+
heightOffs[i] = (Math.random() - 0.5) * 0.16;
|
|
150
|
+
speeds[i] = 0.3 + Math.random() * 1.4; // wide speed spread
|
|
151
|
+
phases[i] = Math.random() * Math.PI * 2;
|
|
152
|
+
}
|
|
153
|
+
const geo = new THREE.BufferGeometry();
|
|
154
|
+
// Positions are computed entirely in vertex shader; use dummy zero positions
|
|
155
|
+
geo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(count * 3), 3));
|
|
156
|
+
geo.setAttribute('aAngle', new THREE.BufferAttribute(angles, 1));
|
|
157
|
+
geo.setAttribute('aRadiusOff', new THREE.BufferAttribute(radOffsets, 1));
|
|
158
|
+
geo.setAttribute('aHeightOff', new THREE.BufferAttribute(heightOffs, 1));
|
|
159
|
+
geo.setAttribute('aSpeed', new THREE.BufferAttribute(speeds, 1));
|
|
160
|
+
geo.setAttribute('aPhase', new THREE.BufferAttribute(phases, 1));
|
|
161
|
+
// Dust color: mostly white, very slightly tinted toward innerGlowColor
|
|
162
|
+
const dustCol = new THREE.Color(innerGlowColor).lerp(new THREE.Color('#ffffff'), 0.75);
|
|
163
|
+
const dustColVec = new THREE.Vector3(dustCol.r, dustCol.g, dustCol.b);
|
|
164
|
+
const mat = new THREE.ShaderMaterial({
|
|
165
|
+
vertexShader: dustVertShader,
|
|
166
|
+
fragmentShader: dustFragShader,
|
|
167
|
+
uniforms: {
|
|
168
|
+
u_time: { value: 0 },
|
|
169
|
+
uRadius: { value: r },
|
|
170
|
+
uPointSize: { value: 5 * intensity },
|
|
171
|
+
u_speed: { value: speed * 0.5 },
|
|
172
|
+
uColor: { value: dustColVec },
|
|
173
|
+
uOpacity: { value: opacity * 0.6 },
|
|
174
|
+
},
|
|
175
|
+
transparent: true,
|
|
176
|
+
depthWrite: false,
|
|
177
|
+
blending: THREE.AdditiveBlending,
|
|
178
|
+
});
|
|
179
|
+
return { dustGeo: geo, dustMat: mat };
|
|
180
|
+
}, [particleCount, r, innerGlowColor, intensity, speed, opacity]);
|
|
181
|
+
useFrame((state) => {
|
|
182
|
+
const t = state.clock.getElapsedTime();
|
|
183
|
+
discMaterial.uniforms.u_time.value = t;
|
|
184
|
+
dustMat.uniforms.u_time.value = t;
|
|
185
|
+
if (animations?.length) {
|
|
186
|
+
applyGenerativeAnimations([discMaterial, dustMat], animations, startValuesCacheRef.current, Date.now(), false);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
return (_jsxs("group", { rotation: [-Math.PI / 2, 0, 0], position: [0, -boundingRadius * 0.75, 0], children: [_jsx("mesh", { material: discMaterial, children: _jsx("circleGeometry", { args: [r, 80] }) }), particleRingEnabled && (_jsx("points", { geometry: dustGeo, material: dustMat }))] }));
|
|
190
|
+
};
|
|
191
|
+
export default PortalEffect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ShockwaveConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
3
|
+
interface ShockwaveEffectProps {
|
|
4
|
+
boundingRadius: number;
|
|
5
|
+
config: ShockwaveConfig;
|
|
6
|
+
animations?: AnimationOptions[];
|
|
7
|
+
}
|
|
8
|
+
declare const ShockwaveEffect: React.FC<ShockwaveEffectProps>;
|
|
9
|
+
export default ShockwaveEffect;
|
|
10
|
+
//# sourceMappingURL=ShockwaveEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShockwaveEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/ShockwaveEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAkFD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0EnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useFrame } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { applyGenerativeAnimations } from '../../utils/handleGenerativeEffectsAnimations.js';
|
|
6
|
+
// Ring vertex — organic warp + vertical ripple
|
|
7
|
+
const vertexShader = /* glsl */ `
|
|
8
|
+
uniform float uProgress;
|
|
9
|
+
uniform float uExpansionScale;
|
|
10
|
+
|
|
11
|
+
void main() {
|
|
12
|
+
vec3 pos = position;
|
|
13
|
+
float expansion = 1.0 + uProgress * uExpansionScale;
|
|
14
|
+
pos.x *= expansion;
|
|
15
|
+
pos.y *= expansion;
|
|
16
|
+
|
|
17
|
+
// Organic warp: slight Z ripple based on angle along the torus
|
|
18
|
+
float angle = atan(pos.y, pos.x);
|
|
19
|
+
float warp = sin(angle * 8.0 + uProgress * 18.0) * 0.018 * (1.0 - uProgress);
|
|
20
|
+
pos.z += warp;
|
|
21
|
+
|
|
22
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const fragmentShader = /* glsl */ `
|
|
26
|
+
uniform float uProgress;
|
|
27
|
+
uniform vec3 uColor;
|
|
28
|
+
uniform vec3 uRimColor;
|
|
29
|
+
uniform float uOpacity;
|
|
30
|
+
uniform float u_time;
|
|
31
|
+
|
|
32
|
+
// Cheap 1D noise for surface texture
|
|
33
|
+
float hash(float n){ return fract(sin(n) * 43758.5453); }
|
|
34
|
+
|
|
35
|
+
void main() {
|
|
36
|
+
// Core fade
|
|
37
|
+
float fade = 1.0 - uProgress;
|
|
38
|
+
|
|
39
|
+
// Leading-edge corona: ultra-bright blast front
|
|
40
|
+
float corona = exp(-uProgress * 6.0) * 2.5;
|
|
41
|
+
|
|
42
|
+
// High-frequency energy shimmer on the ring surface
|
|
43
|
+
float shimmer = 0.75 + 0.25 * hash(uProgress * 40.0 + u_time * 7.0);
|
|
44
|
+
|
|
45
|
+
// Rim glow (raised power = tighter, brighter rim)
|
|
46
|
+
float rim = pow(max(0.0, 1.0 - uProgress), 4.0);
|
|
47
|
+
|
|
48
|
+
// Chromatic split — push rim color toward white at the leading edge
|
|
49
|
+
vec3 rimBoosted = mix(uRimColor, vec3(1.4, 1.4, 1.6), corona * 0.5);
|
|
50
|
+
vec3 finalColor = mix(uColor, rimBoosted, rim + corona * 0.4);
|
|
51
|
+
finalColor += rimBoosted * corona * 0.6;
|
|
52
|
+
|
|
53
|
+
float alpha = fade * uOpacity * shimmer;
|
|
54
|
+
if (alpha < 0.005) discard;
|
|
55
|
+
|
|
56
|
+
gl_FragColor = vec4(finalColor, alpha);
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
// Flash disc at ring birth — bright flat burst that fades in ~0.2 progress
|
|
60
|
+
const flashFrag = /* glsl */ `
|
|
61
|
+
uniform float uProgress;
|
|
62
|
+
uniform vec3 uColor;
|
|
63
|
+
uniform float uOpacity;
|
|
64
|
+
|
|
65
|
+
varying vec2 vUv;
|
|
66
|
+
|
|
67
|
+
void main() {
|
|
68
|
+
vec2 c = vUv * 2.0 - 1.0;
|
|
69
|
+
float dist = length(c);
|
|
70
|
+
if (dist > 1.0) discard;
|
|
71
|
+
float fade = exp(-uProgress * 12.0);
|
|
72
|
+
float radial = 1.0 - smoothstep(0.4, 1.0, dist);
|
|
73
|
+
float alpha = fade * radial * uOpacity * 0.9;
|
|
74
|
+
if (alpha < 0.005) discard;
|
|
75
|
+
gl_FragColor = vec4(uColor * 2.0, alpha);
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
const flashVert = /* glsl */ `
|
|
79
|
+
varying vec2 vUv;
|
|
80
|
+
void main() {
|
|
81
|
+
vUv = uv;
|
|
82
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
const ShockwaveEffect = ({ boundingRadius, config, animations }) => {
|
|
86
|
+
const { ringCount, expansionRadius, thickness, intervalSeconds, color, rimColor, opacity, speed, intensity } = config;
|
|
87
|
+
const startValuesCacheRef = useRef({});
|
|
88
|
+
const meshRefs = useRef([]);
|
|
89
|
+
const flashRefs = useRef([]);
|
|
90
|
+
const makeRingStates = (count, interval) => Array.from({ length: count }, (_, i) => ({
|
|
91
|
+
progress: 0,
|
|
92
|
+
cooldown: (i / Math.max(count, 1)) * interval,
|
|
93
|
+
}));
|
|
94
|
+
const ringStates = useRef(makeRingStates(ringCount, intervalSeconds));
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
ringStates.current = makeRingStates(ringCount, intervalSeconds);
|
|
97
|
+
}, [ringCount, intervalSeconds]);
|
|
98
|
+
const colorVec = useMemo(() => { const c = new THREE.Color(color); return new THREE.Vector3(c.r, c.g, c.b); }, [color]);
|
|
99
|
+
const rimColorVec = useMemo(() => { const c = new THREE.Color(rimColor); return new THREE.Vector3(c.r, c.g, c.b); }, [rimColor]);
|
|
100
|
+
const materials = useMemo(() => Array.from({ length: ringCount }, () => new THREE.ShaderMaterial({
|
|
101
|
+
vertexShader,
|
|
102
|
+
fragmentShader,
|
|
103
|
+
uniforms: {
|
|
104
|
+
uProgress: { value: 0 },
|
|
105
|
+
uExpansionScale: { value: (expansionRadius - 1) * intensity },
|
|
106
|
+
uColor: { value: colorVec },
|
|
107
|
+
uRimColor: { value: rimColorVec },
|
|
108
|
+
uOpacity: { value: opacity },
|
|
109
|
+
u_time: { value: 0 },
|
|
110
|
+
},
|
|
111
|
+
transparent: true,
|
|
112
|
+
depthWrite: false,
|
|
113
|
+
blending: THREE.AdditiveBlending,
|
|
114
|
+
side: THREE.DoubleSide,
|
|
115
|
+
})), [ringCount, expansionRadius, intensity, colorVec, rimColorVec, opacity]);
|
|
116
|
+
const flashMaterials = useMemo(() => Array.from({ length: ringCount }, () => new THREE.ShaderMaterial({
|
|
117
|
+
vertexShader: flashVert,
|
|
118
|
+
fragmentShader: flashFrag,
|
|
119
|
+
uniforms: {
|
|
120
|
+
uProgress: { value: 0 },
|
|
121
|
+
uColor: { value: colorVec },
|
|
122
|
+
uOpacity: { value: opacity },
|
|
123
|
+
},
|
|
124
|
+
transparent: true,
|
|
125
|
+
depthWrite: false,
|
|
126
|
+
blending: THREE.AdditiveBlending,
|
|
127
|
+
side: THREE.DoubleSide,
|
|
128
|
+
})), [ringCount, colorVec, opacity]);
|
|
129
|
+
const radius = boundingRadius;
|
|
130
|
+
console.log('ShockwaveEffect render with boundingRadius:', boundingRadius, 'and config:', config);
|
|
131
|
+
useFrame((state, delta) => {
|
|
132
|
+
const t = state.clock.getElapsedTime();
|
|
133
|
+
for (let i = 0; i < ringCount; i++) {
|
|
134
|
+
const state_ = ringStates.current[i];
|
|
135
|
+
const mat = materials[i];
|
|
136
|
+
const fMat = flashMaterials[i];
|
|
137
|
+
mat.uniforms.u_time.value = t;
|
|
138
|
+
if (state_.cooldown > 0) {
|
|
139
|
+
state_.cooldown -= delta;
|
|
140
|
+
mat.uniforms.uProgress.value = 1;
|
|
141
|
+
fMat.uniforms.uProgress.value = 1;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
state_.progress += delta * speed;
|
|
145
|
+
const p = Math.min(state_.progress, 1);
|
|
146
|
+
mat.uniforms.uProgress.value = p;
|
|
147
|
+
fMat.uniforms.uProgress.value = p;
|
|
148
|
+
if (state_.progress >= 1) {
|
|
149
|
+
state_.progress = 0;
|
|
150
|
+
state_.cooldown = intervalSeconds / speed;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (animations?.length) {
|
|
154
|
+
applyGenerativeAnimations([...materials, ...flashMaterials], animations, startValuesCacheRef.current, Date.now(), false);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const flashR = radius * 1.05;
|
|
158
|
+
return (_jsx("group", { children: Array.from({ length: ringCount }, (_, i) => (_jsxs("group", { children: [_jsx("mesh", { ref: el => { meshRefs.current[i] = el; }, material: materials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("torusGeometry", { args: [radius, thickness * intensity, 10, 80] }) }), _jsx("mesh", { ref: el => { flashRefs.current[i] = el; }, material: flashMaterials[i], rotation: [-Math.PI / 2, 0, 0], children: _jsx("circleGeometry", { args: [flashR, 48] }) })] }, i))) }));
|
|
159
|
+
};
|
|
160
|
+
export default ShockwaveEffect;
|