@3driseai/3drise-viewer 0.1.26 → 0.1.28
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/animationsV2/ClipPlayer.d.ts +3 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +67 -8
- package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +245 -14
- package/dist/animationsV2/appliers.d.ts +5 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +25 -7
- package/dist/animationsV2/index.d.ts +1 -1
- package/dist/animationsV2/index.d.ts.map +1 -1
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +18 -7
- package/dist/animationsV2/sequenceUtils.d.ts +42 -1
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +103 -3
- package/dist/animationsV2/types.d.ts +20 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.d.ts +8 -2
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +31 -14
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +7 -5
- package/dist/components/ApollonianGrid.d.ts +25 -0
- package/dist/components/ApollonianGrid.d.ts.map +1 -0
- package/dist/components/ApollonianGrid.js +80 -0
- package/dist/components/Bubbles.d.ts +7 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +42 -22
- package/dist/components/ChladniGrid.d.ts +8 -4
- package/dist/components/ChladniGrid.d.ts.map +1 -1
- package/dist/components/ChladniGrid.js +31 -13
- package/dist/components/CircuitGrid.d.ts +8 -11
- package/dist/components/CircuitGrid.d.ts.map +1 -1
- package/dist/components/CircuitGrid.js +31 -13
- package/dist/components/CloudsGenerator.d.ts +1 -1
- package/dist/components/CloudsGenerator.js +1 -1
- package/dist/components/ConformalGrid.d.ts +25 -0
- package/dist/components/ConformalGrid.d.ts.map +1 -0
- package/dist/components/ConformalGrid.js +97 -0
- package/dist/components/ContourGrid.d.ts +8 -14
- package/dist/components/ContourGrid.d.ts.map +1 -1
- package/dist/components/ContourGrid.js +31 -13
- package/dist/components/EffectsGenerator.d.ts +7 -1
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +39 -38
- package/dist/components/EnvironmentManager.d.ts +4 -4
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.d.ts +8 -4
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +31 -13
- package/dist/components/FractalGrid.d.ts +8 -12
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +31 -13
- package/dist/components/GirihGrid.d.ts +8 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +31 -13
- package/dist/components/Glyphs.d.ts +7 -1
- package/dist/components/Glyphs.d.ts.map +1 -1
- package/dist/components/Glyphs.js +40 -34
- package/dist/components/GravWaveGrid.d.ts +8 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +31 -13
- package/dist/components/GridsGenerator.d.ts +9 -3
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +41 -18
- package/dist/components/HexGrid.d.ts +8 -10
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +31 -13
- package/dist/components/HilbertGrid.d.ts +25 -0
- package/dist/components/HilbertGrid.d.ts.map +1 -0
- package/dist/components/HilbertGrid.js +93 -0
- package/dist/components/HyperbolicGrid.d.ts +8 -4
- package/dist/components/HyperbolicGrid.d.ts.map +1 -1
- package/dist/components/HyperbolicGrid.js +31 -13
- package/dist/components/LandscapeBuilder.d.ts +1 -1
- package/dist/components/LandscapeBuilder.d.ts.map +1 -1
- package/dist/components/LandscapeBuilder.js +1 -1
- package/dist/components/LandscapeObject.d.ts +1 -1
- package/dist/components/LandscapeObject.d.ts.map +1 -1
- package/dist/components/LandscapeObject.js +1 -1
- package/dist/components/LensingGrid.d.ts +25 -0
- package/dist/components/LensingGrid.d.ts.map +1 -0
- package/dist/components/LensingGrid.js +81 -0
- package/dist/components/MoireGrid.d.ts +8 -12
- package/dist/components/MoireGrid.d.ts.map +1 -1
- package/dist/components/MoireGrid.js +31 -13
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +2 -2
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +37 -3
- package/dist/components/OceanBuilder.d.ts +1 -1
- package/dist/components/OceanBuilder.js +1 -1
- package/dist/components/ParastichyGrid.d.ts +25 -0
- package/dist/components/ParastichyGrid.d.ts.map +1 -0
- package/dist/components/ParastichyGrid.js +82 -0
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +6 -0
- package/dist/components/PhyllotaxisGrid.d.ts +25 -0
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
- package/dist/components/PhyllotaxisGrid.js +95 -0
- package/dist/components/QuasiGrid.d.ts +8 -11
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +31 -13
- package/dist/components/RadarGrid.d.ts +8 -13
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +31 -13
- package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +33 -139
- package/dist/components/SceneBuilder.js +1 -1
- package/dist/components/SkySystem.d.ts +1 -1
- package/dist/components/SparklesBurst.d.ts +7 -1
- package/dist/components/SparklesBurst.d.ts.map +1 -1
- package/dist/components/SparklesBurst.js +31 -28
- package/dist/components/TerrainBuilder.d.ts +1 -1
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +1 -1
- package/dist/components/TruchetGrid.d.ts +25 -0
- package/dist/components/TruchetGrid.d.ts.map +1 -0
- package/dist/components/TruchetGrid.js +82 -0
- package/dist/components/VoronoiGrid.d.ts +8 -10
- package/dist/components/VoronoiGrid.d.ts.map +1 -1
- package/dist/components/VoronoiGrid.js +31 -13
- package/dist/components/WallpaperGrid.d.ts +8 -1
- package/dist/components/WallpaperGrid.d.ts.map +1 -1
- package/dist/components/WallpaperGrid.js +33 -210
- package/dist/components/effects/AuraEffect.d.ts +8 -3
- package/dist/components/effects/AuraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuraEffect.js +49 -24
- package/dist/components/effects/AuroraEffect.d.ts +8 -3
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuroraEffect.js +45 -25
- package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
- package/dist/components/effects/BlackHoleEffect.js +42 -21
- package/dist/components/effects/ConstellationEffect.d.ts +8 -3
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
- package/dist/components/effects/ConstellationEffect.js +49 -23
- package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
- package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
- package/dist/components/effects/DandelionSeedsEffect.js +19 -9
- package/dist/components/effects/DataStreamEffect.d.ts +8 -3
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +54 -26
- package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
- package/dist/components/effects/DnaHelixEffect.js +62 -30
- package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
- package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
- package/dist/components/effects/FallingLeavesEffect.js +19 -9
- package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
- package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
- package/dist/components/effects/FieldLinesEffect.js +30 -20
- package/dist/components/effects/Fire.d.ts +8 -3
- package/dist/components/effects/Fire.d.ts.map +1 -1
- package/dist/components/effects/Fire.js +47 -10
- package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
- package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
- package/dist/components/effects/FireflySwarmEffect.js +19 -9
- package/dist/components/effects/Flares.d.ts +10 -3
- package/dist/components/effects/Flares.d.ts.map +1 -1
- package/dist/components/effects/Flares.js +53 -56
- package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
- package/dist/components/effects/ForcefieldEffect.js +52 -33
- package/dist/components/effects/GalaxyEffect.d.ts +7 -2
- package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
- package/dist/components/effects/GalaxyEffect.js +19 -9
- package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
- package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
- package/dist/components/effects/HarmonicShellEffect.js +30 -22
- package/dist/components/effects/HologramEffect.d.ts +8 -3
- package/dist/components/effects/HologramEffect.d.ts.map +1 -1
- package/dist/components/effects/HologramEffect.js +52 -23
- package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +36 -21
- package/dist/components/effects/IceHaloEffect.d.ts +7 -2
- package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
- package/dist/components/effects/IceHaloEffect.js +19 -9
- package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
- package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
- package/dist/components/effects/LichtenbergEffect.js +19 -9
- package/dist/components/effects/LightningEffect.d.ts +8 -3
- package/dist/components/effects/LightningEffect.d.ts.map +1 -1
- package/dist/components/effects/LightningEffect.js +54 -32
- package/dist/components/effects/MoleculesEffect.d.ts +8 -3
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
- package/dist/components/effects/MoleculesEffect.js +31 -21
- package/dist/components/effects/MurmurationEffect.d.ts +7 -2
- package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
- package/dist/components/effects/MurmurationEffect.js +19 -9
- package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +66 -33
- package/dist/components/effects/OrbEffect.d.ts +8 -3
- package/dist/components/effects/OrbEffect.d.ts.map +1 -1
- package/dist/components/effects/OrbEffect.js +89 -42
- package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
- package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
- package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
- package/dist/components/effects/PortalEffect.d.ts +8 -3
- package/dist/components/effects/PortalEffect.d.ts.map +1 -1
- package/dist/components/effects/PortalEffect.js +41 -25
- package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
- package/dist/components/effects/ShockwaveEffect.js +19 -9
- package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +30 -20
- package/dist/components/effects/SmokeRibbon.d.ts +8 -2
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
- package/dist/components/effects/SmokeRibbon.js +34 -24
- package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokeRingEffect.js +33 -21
- package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
- package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
- package/dist/components/effects/StrangeAttractorEffect.js +30 -20
- package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +38 -20
- package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
- package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
- package/dist/components/effects/WaterCausticsEffect.js +19 -9
- package/dist/components/effects/index.d.ts +0 -1
- package/dist/components/effects/index.d.ts.map +1 -1
- package/dist/components/effects/index.js +0 -1
- package/dist/components/index.d.ts +14 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -1
- package/dist/components/landscape/LandscapeMesh.js +1 -1
- package/dist/components/landscape/types.d.ts +1 -1
- package/dist/components/landscape/types.d.ts.map +1 -1
- package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
- package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
- package/dist/components/particles/MagneticBottleParticles.js +618 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeBurstParticles.js +588 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeFlowParticles.js +755 -0
- package/dist/components/particles/index.d.ts +6 -0
- package/dist/components/particles/index.d.ts.map +1 -1
- package/dist/components/particles/index.js +3 -0
- package/dist/components/terrain/types.d.ts +1 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/types.d.ts +1 -1
- package/dist/components/volumetricClouds/types.d.ts.map +1 -1
- package/dist/components/water/types.d.ts +1 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useConfigDriver.d.ts +22 -0
- package/dist/hooks/useConfigDriver.d.ts.map +1 -0
- package/dist/hooks/useConfigDriver.js +43 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.d.ts +1 -1
- package/dist/hooks/useThunder.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/interactions/index.d.ts +2 -1
- package/dist/interactions/index.d.ts.map +1 -1
- package/dist/interactions/index.js +1 -1
- package/dist/interactions/runner.d.ts +18 -3
- package/dist/interactions/runner.d.ts.map +1 -1
- package/dist/interactions/runner.js +25 -2
- package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
- package/dist/operations/catalogue/curlSmoke.js +178 -0
- package/dist/operations/catalogue/displayImage.d.ts.map +1 -1
- package/dist/operations/catalogue/displayImage.js +1 -0
- package/dist/operations/catalogue/dissolve.d.ts +3 -0
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
- package/dist/operations/catalogue/dissolve.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts +3 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
- package/dist/operations/catalogue/emberAsh.js +171 -0
- package/dist/operations/catalogue/fade.d.ts.map +1 -1
- package/dist/operations/catalogue/fade.js +1 -0
- package/dist/operations/catalogue/flip.d.ts +3 -0
- package/dist/operations/catalogue/flip.d.ts.map +1 -0
- package/dist/operations/catalogue/flip.js +69 -0
- package/dist/operations/catalogue/flock.d.ts +3 -0
- package/dist/operations/catalogue/flock.d.ts.map +1 -0
- package/dist/operations/catalogue/flock.js +163 -0
- package/dist/operations/catalogue/focus.d.ts.map +1 -1
- package/dist/operations/catalogue/focus.js +1 -0
- package/dist/operations/catalogue/frame.d.ts +3 -0
- package/dist/operations/catalogue/frame.d.ts.map +1 -0
- package/dist/operations/catalogue/frame.js +44 -0
- package/dist/operations/catalogue/frost.d.ts +3 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -0
- package/dist/operations/catalogue/frost.js +111 -0
- package/dist/operations/catalogue/fxInstances.d.ts +21 -0
- package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
- package/dist/operations/catalogue/fxInstances.js +47 -0
- package/dist/operations/catalogue/fxPoints.d.ts +22 -0
- package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
- package/dist/operations/catalogue/fxPoints.js +70 -0
- package/dist/operations/catalogue/glow.d.ts.map +1 -1
- package/dist/operations/catalogue/glow.js +2 -1
- package/dist/operations/catalogue/heatCracks.d.ts +3 -0
- package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
- package/dist/operations/catalogue/heatCracks.js +134 -0
- package/dist/operations/catalogue/hologram.d.ts +3 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -0
- package/dist/operations/catalogue/hologram.js +118 -0
- package/dist/operations/catalogue/inkBloom.d.ts +3 -0
- package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
- package/dist/operations/catalogue/inkBloom.js +156 -0
- package/dist/operations/catalogue/ivy.d.ts +13 -0
- package/dist/operations/catalogue/ivy.d.ts.map +1 -0
- package/dist/operations/catalogue/ivy.js +469 -0
- package/dist/operations/catalogue/jelly.d.ts +3 -0
- package/dist/operations/catalogue/jelly.d.ts.map +1 -0
- package/dist/operations/catalogue/jelly.js +50 -0
- package/dist/operations/catalogue/kintsugi.d.ts +3 -0
- package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
- package/dist/operations/catalogue/kintsugi.js +173 -0
- package/dist/operations/catalogue/lidarScan.d.ts +3 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
- package/dist/operations/catalogue/lidarScan.js +240 -0
- package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
- package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
- package/dist/operations/catalogue/liquidMetal.js +122 -0
- package/dist/operations/catalogue/metalize.d.ts +3 -0
- package/dist/operations/catalogue/metalize.d.ts.map +1 -0
- package/dist/operations/catalogue/metalize.js +135 -0
- package/dist/operations/catalogue/moveToFront.d.ts.map +1 -1
- package/dist/operations/catalogue/moveToFront.js +1 -0
- package/dist/operations/catalogue/orbit.d.ts +3 -0
- package/dist/operations/catalogue/orbit.d.ts.map +1 -0
- package/dist/operations/catalogue/orbit.js +29 -0
- package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
- package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
- package/dist/operations/catalogue/particleSwarm.js +138 -0
- package/dist/operations/catalogue/petalPeel.d.ts +3 -0
- package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
- package/dist/operations/catalogue/petalPeel.js +137 -0
- package/dist/operations/catalogue/petrify.d.ts +3 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -0
- package/dist/operations/catalogue/petrify.js +94 -0
- package/dist/operations/catalogue/portal.d.ts +3 -0
- package/dist/operations/catalogue/portal.d.ts.map +1 -0
- package/dist/operations/catalogue/portal.js +224 -0
- package/dist/operations/catalogue/print3d.d.ts +3 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -0
- package/dist/operations/catalogue/print3d.js +275 -0
- package/dist/operations/catalogue/rainBeads.d.ts +3 -0
- package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
- package/dist/operations/catalogue/rainBeads.js +223 -0
- package/dist/operations/catalogue/restPose.d.ts +21 -0
- package/dist/operations/catalogue/restPose.d.ts.map +1 -0
- package/dist/operations/catalogue/restPose.js +55 -0
- package/dist/operations/catalogue/rimLight.d.ts +3 -0
- package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
- package/dist/operations/catalogue/rimLight.js +72 -0
- package/dist/operations/catalogue/sandErosion.d.ts +3 -0
- package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
- package/dist/operations/catalogue/sandErosion.js +167 -0
- package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
- package/dist/operations/catalogue/shaderLayers.js +322 -0
- package/dist/operations/catalogue/shatter.d.ts +3 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -0
- package/dist/operations/catalogue/shatter.js +267 -0
- package/dist/operations/catalogue/silkDrape.d.ts +3 -0
- package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
- package/dist/operations/catalogue/silkDrape.js +340 -0
- package/dist/operations/catalogue/spin.d.ts +3 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -0
- package/dist/operations/catalogue/spin.js +42 -0
- package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
- package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
- package/dist/operations/catalogue/surfaceSample.js +187 -0
- package/dist/operations/catalogue/swirl.d.ts +3 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -0
- package/dist/operations/catalogue/swirl.js +69 -0
- package/dist/operations/catalogue/teleport.d.ts +3 -0
- package/dist/operations/catalogue/teleport.d.ts.map +1 -0
- package/dist/operations/catalogue/teleport.js +213 -0
- package/dist/operations/catalogue/transitionField.d.ts +124 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
- package/dist/operations/catalogue/transitionField.js +278 -0
- package/dist/operations/catalogue/unweave.d.ts +3 -0
- package/dist/operations/catalogue/unweave.d.ts.map +1 -0
- package/dist/operations/catalogue/unweave.js +233 -0
- package/dist/operations/catalogue/visibility.d.ts.map +1 -1
- package/dist/operations/catalogue/visibility.js +1 -0
- package/dist/operations/catalogue/voxelize.d.ts +3 -0
- package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
- package/dist/operations/catalogue/voxelize.js +148 -0
- package/dist/operations/catalogue/warmup.d.ts +22 -0
- package/dist/operations/catalogue/warmup.d.ts.map +1 -0
- package/dist/operations/catalogue/warmup.js +106 -0
- package/dist/operations/catalogue/zoom.d.ts.map +1 -1
- package/dist/operations/catalogue/zoom.js +1 -0
- package/dist/operations/index.d.ts +4 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +4 -2
- package/dist/operations/objectEffects.d.ts +46 -0
- package/dist/operations/objectEffects.d.ts.map +1 -0
- package/dist/operations/objectEffects.js +136 -0
- package/dist/operations/registry.d.ts +7 -2
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +45 -3
- package/dist/operations/runtime.d.ts +40 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +164 -8
- package/dist/operations/types.d.ts +29 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +6 -0
- package/dist/operations/useObjectEffectLayers.d.ts +4 -0
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
- package/dist/operations/useObjectEffectLayers.js +42 -0
- package/dist/operations/useOperationsRuntime.d.ts.map +1 -1
- package/dist/operations/useOperationsRuntime.js +42 -4
- package/dist/presets/landscapePresets.d.ts +1 -1
- package/dist/presets/landscapePresets.d.ts.map +1 -1
- package/dist/presets/landscapePresets.js +1 -1
- package/dist/presets/landscapeTypes.d.ts +1 -1
- package/dist/presets/landscapeTypes.d.ts.map +1 -1
- package/dist/presets/landscapeTypes.js +1 -1
- package/dist/presets/oceanSurfacePresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/volumetricCloudPresets.d.ts +1 -1
- package/dist/types/cloudConfigs.d.ts +2 -309
- package/dist/types/cloudConfigs.d.ts.map +1 -1
- package/dist/types/cloudConfigs.js +2 -339
- package/dist/types/gridConfigs.d.ts +103 -0
- package/dist/types/gridConfigs.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/landscapeConfigs.d.ts +2 -217
- package/dist/types/landscapeConfigs.d.ts.map +1 -1
- package/dist/types/landscapeConfigs.js +2 -256
- package/dist/types/oceanConfigs.d.ts +2 -289
- package/dist/types/oceanConfigs.d.ts.map +1 -1
- package/dist/types/oceanConfigs.js +2 -380
- package/dist/types/terrainConfigs.d.ts +2 -250
- package/dist/types/terrainConfigs.d.ts.map +1 -1
- package/dist/types/terrainConfigs.js +2 -292
- package/dist/utils/cloudUniforms.d.ts +1 -1
- package/dist/utils/configAnimations.d.ts +6 -0
- package/dist/utils/configAnimations.d.ts.map +1 -1
- package/dist/utils/configAnimations.js +14 -0
- package/dist/utils/gridConfig.d.ts +19 -0
- package/dist/utils/gridConfig.d.ts.map +1 -0
- package/dist/utils/gridConfig.js +52 -0
- package/dist/utils/handleCloudsAnimations.d.ts +1 -1
- package/dist/utils/handleCloudsAnimations.js +1 -1
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
- package/dist/utils/hasHoverAnimation.js +0 -2
- package/dist/utils/landscapeUniforms.d.ts +1 -1
- package/dist/utils/landscapeUniforms.d.ts.map +1 -1
- package/dist/utils/oceanUniforms.d.ts +1 -1
- package/dist/utils/particleShape.d.ts +33 -0
- package/dist/utils/particleShape.d.ts.map +1 -0
- package/dist/utils/particleShape.js +207 -0
- package/dist/utils/particleTrails.d.ts.map +1 -1
- package/dist/utils/particleTrails.js +29 -14
- package/dist/utils/terrainUniforms.d.ts +1 -1
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Transition field — the shared backbone of the visual in/out effects.
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Every transition (dissolve, ember ash, swarm, hologram, shatter) is driven by
|
|
6
|
+
// one scalar field over the target, f(q) in 0..1, where q is the position in the
|
|
7
|
+
// target's own space normalised by its bounds (0..1 on each axis). A threshold
|
|
8
|
+
// sweeps through f as progress runs 0 → 1:
|
|
9
|
+
//
|
|
10
|
+
// surface visible where f > threshold (layer on the material)
|
|
11
|
+
// particles born at f, so they leave exactly where the surface goes
|
|
12
|
+
// shards each triangle leaves when the front reaches its centroid
|
|
13
|
+
//
|
|
14
|
+
// Root space: the target root's inverse world matrix is a uniform refreshed
|
|
15
|
+
// every frame while a transition runs, so the pattern is fixed to the object —
|
|
16
|
+
// it fits any size, never swims when the object moves, and a model's many meshes
|
|
17
|
+
// transition as one piece.
|
|
18
|
+
//
|
|
19
|
+
// GLSL names carry a per-effect prefix, so two different transitions layered on
|
|
20
|
+
// one material never redeclare each other's uniforms or functions.
|
|
21
|
+
//
|
|
22
|
+
import { gsap } from 'gsap';
|
|
23
|
+
import { Box3, Color, Matrix4, Vector3 } from 'three';
|
|
24
|
+
import { GLSL_NOISE, commitPendingLayers } from './shaderLayers.js';
|
|
25
|
+
import { warmHelpers, warmMode } from './warmup.js';
|
|
26
|
+
export const DIRECTION_OPTIONS = [
|
|
27
|
+
{ value: 'noise', label: 'Scattered' },
|
|
28
|
+
{ value: 'up', label: 'Bottom → top' },
|
|
29
|
+
{ value: 'down', label: 'Top → bottom' },
|
|
30
|
+
{ value: 'outward', label: 'Centre → out' },
|
|
31
|
+
{ value: 'left', label: 'Left → right' },
|
|
32
|
+
{ value: 'right', label: 'Right → left' },
|
|
33
|
+
];
|
|
34
|
+
/** The sweeping (non-scattered) directions, for effects that need a front with a side. */
|
|
35
|
+
export const SWEEP_OPTIONS = DIRECTION_OPTIONS.filter(o => o.value !== 'noise' && o.value !== 'outward');
|
|
36
|
+
const DIRECTIONS = DIRECTION_OPTIONS.map(o => o.value);
|
|
37
|
+
/** Bounds of `root` in its own (root-local) space. */
|
|
38
|
+
export function localBounds(root) {
|
|
39
|
+
root.updateWorldMatrix(true, true);
|
|
40
|
+
const inv = new Matrix4().copy(root.matrixWorld).invert();
|
|
41
|
+
const box = new Box3();
|
|
42
|
+
const tmp = new Box3();
|
|
43
|
+
const m = new Matrix4();
|
|
44
|
+
root.traverse((c) => {
|
|
45
|
+
if (!c.isMesh || !c.geometry || c.userData?.__opFxHelper)
|
|
46
|
+
return;
|
|
47
|
+
if (!c.geometry.boundingBox)
|
|
48
|
+
c.geometry.computeBoundingBox();
|
|
49
|
+
tmp.copy(c.geometry.boundingBox).applyMatrix4(m.multiplyMatrices(inv, c.matrixWorld));
|
|
50
|
+
box.union(tmp);
|
|
51
|
+
});
|
|
52
|
+
if (box.isEmpty())
|
|
53
|
+
box.set(new Vector3(-0.5, -0.5, -0.5), new Vector3(0.5, 0.5, 0.5));
|
|
54
|
+
return box;
|
|
55
|
+
}
|
|
56
|
+
export function createFieldState(root) {
|
|
57
|
+
const b = localBounds(root);
|
|
58
|
+
const size = b.getSize(new Vector3());
|
|
59
|
+
return {
|
|
60
|
+
progress: { value: 0 }, time: { value: 0 }, rootInv: { value: new Matrix4() },
|
|
61
|
+
boundsMin: { value: b.min.clone() }, boundsSize: { value: size }, extent: { value: Math.max(size.length(), 1e-3) },
|
|
62
|
+
scale: { value: 3 }, direction: { value: 0 }, edgeWidth: { value: 0.08 }, edgeColor: { value: new Color('#ff7a2e') },
|
|
63
|
+
sweep: { value: new Vector3(1, 0, 0) },
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** The camera's screen-right, in `root`'s local space (world X when there is no camera). */
|
|
67
|
+
export function screenRight(root, ctx) {
|
|
68
|
+
const pose = ctx?.tools?.cameraPose?.();
|
|
69
|
+
const right = new Vector3(1, 0, 0);
|
|
70
|
+
if (pose) {
|
|
71
|
+
const fwd = new Vector3(pose.target[0] - pose.position[0], pose.target[1] - pose.position[1], pose.target[2] - pose.position[2]);
|
|
72
|
+
const r = fwd.cross(new Vector3(0, 1, 0));
|
|
73
|
+
if (r.lengthSq() > 1e-8)
|
|
74
|
+
right.copy(r.normalize());
|
|
75
|
+
}
|
|
76
|
+
root.updateWorldMatrix(true, false);
|
|
77
|
+
const inv = new Matrix4().copy(root.matrixWorld).invert();
|
|
78
|
+
return right.transformDirection(inv);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Apply the shared knobs. Pass the target and the operation context so the
|
|
82
|
+
* left → right / right → left directions can be taken from the screen at trigger.
|
|
83
|
+
*/
|
|
84
|
+
export function setFieldParams(st, p, root, ctx) {
|
|
85
|
+
if (p.direction !== undefined) {
|
|
86
|
+
const d = String(p.direction);
|
|
87
|
+
st.direction.value = Math.max(0, DIRECTIONS.indexOf(d));
|
|
88
|
+
if ((d === 'left' || d === 'right') && root) {
|
|
89
|
+
const r = screenRight(root, ctx);
|
|
90
|
+
st.sweep.value.copy(d === 'left' ? r : r.negate());
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (p.scale !== undefined)
|
|
94
|
+
st.scale.value = Number(p.scale);
|
|
95
|
+
if (p.edgeWidth !== undefined)
|
|
96
|
+
st.edgeWidth.value = Number(p.edgeWidth);
|
|
97
|
+
if (p.edgeColor !== undefined)
|
|
98
|
+
st.edgeColor.value.set(String(p.edgeColor));
|
|
99
|
+
}
|
|
100
|
+
export const syncRoot = (root, st) => {
|
|
101
|
+
root.updateWorldMatrix(true, false);
|
|
102
|
+
st.rootInv.value.copy(root.matrixWorld).invert();
|
|
103
|
+
};
|
|
104
|
+
/** The field's uniforms under a prefix: `u<P>Progress`, `u<P>RootInv`, … */
|
|
105
|
+
export function fieldUniforms(P, st) {
|
|
106
|
+
return {
|
|
107
|
+
[`u${P}Progress`]: st.progress, [`u${P}Time`]: st.time, [`u${P}RootInv`]: st.rootInv,
|
|
108
|
+
[`u${P}Min`]: st.boundsMin, [`u${P}Size`]: st.boundsSize, [`u${P}Extent`]: st.extent,
|
|
109
|
+
[`u${P}Scale`]: st.scale, [`u${P}Direction`]: st.direction,
|
|
110
|
+
[`u${P}EdgeWidth`]: st.edgeWidth, [`u${P}EdgeColor`]: st.edgeColor, [`u${P}Sweep`]: st.sweep,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* GLSL (after the uniform declarations):
|
|
115
|
+
* <P>Norm(vec3 rootLocal) → q in 0..1 root-local position → normalised
|
|
116
|
+
* <P>Field(vec3 q) → f in 0..1 the field
|
|
117
|
+
* <P>Threshold() → t the front; surface visible where f > t
|
|
118
|
+
* Calm, low-frequency fBm — stretched so the front moves evenly over the whole run.
|
|
119
|
+
*/
|
|
120
|
+
export const fieldGlsl = (P) => /* glsl */ `
|
|
121
|
+
${GLSL_NOISE}
|
|
122
|
+
vec3 ${P}Norm(vec3 r) { return (r - u${P}Min) / max(u${P}Size, vec3(1e-4)); }
|
|
123
|
+
// 0 → 1 along the chosen direction (up for 'scattered')
|
|
124
|
+
float ${P}Along(vec3 q) {
|
|
125
|
+
if (u${P}Direction < 1.5) return q.y;
|
|
126
|
+
if (u${P}Direction < 2.5) return 1.0 - q.y;
|
|
127
|
+
if (u${P}Direction < 3.5) return clamp(length(q - 0.5) * 1.1547, 0.0, 1.0);
|
|
128
|
+
vec3 rc = (q - 0.5) * u${P}Size;
|
|
129
|
+
float h = max(dot(abs(u${P}Sweep), u${P}Size) * 0.5, 1e-4);
|
|
130
|
+
return clamp(dot(rc, u${P}Sweep) / (2.0 * h) + 0.5, 0.0, 1.0);
|
|
131
|
+
}
|
|
132
|
+
float ${P}Field(vec3 q) {
|
|
133
|
+
float n = clamp((fxFbm(q * u${P}Scale) - 0.25) * 2.0, 0.0, 1.0);
|
|
134
|
+
if (u${P}Direction < 0.5) return n;
|
|
135
|
+
return clamp(mix(${P}Along(q), n, 0.3), 0.0, 1.0);
|
|
136
|
+
}
|
|
137
|
+
float ${P}Threshold() { return clamp(u${P}Progress, 0.0, 1.0) * (1.0 + 2.0 * u${P}EdgeWidth) - u${P}EdgeWidth; }
|
|
138
|
+
// progress at which the front reaches field value f (inverse of Threshold)
|
|
139
|
+
float ${P}BirthOf(float f) { return (f + u${P}EdgeWidth) / (1.0 + 2.0 * u${P}EdgeWidth); }
|
|
140
|
+
`;
|
|
141
|
+
// ---------------------------------------------------------------- hold clock
|
|
142
|
+
/** Field states holding their finished state → their root. One ticker drives them all. */
|
|
143
|
+
const holds = new Map();
|
|
144
|
+
let holdTick = null;
|
|
145
|
+
let holdLast = 0;
|
|
146
|
+
function startHold(root, st) {
|
|
147
|
+
holds.set(st, root);
|
|
148
|
+
if (holdTick)
|
|
149
|
+
return;
|
|
150
|
+
holdLast = performance.now();
|
|
151
|
+
holdTick = () => {
|
|
152
|
+
const now = performance.now();
|
|
153
|
+
const dt = Math.min(0.1, (now - holdLast) / 1000);
|
|
154
|
+
holdLast = now;
|
|
155
|
+
holds.forEach((r, s) => { s.time.value += dt; syncRoot(r, s); });
|
|
156
|
+
};
|
|
157
|
+
gsap.ticker.add(holdTick);
|
|
158
|
+
}
|
|
159
|
+
function stopHold(st) {
|
|
160
|
+
if (!holds.delete(st) || holds.size || !holdTick)
|
|
161
|
+
return;
|
|
162
|
+
gsap.ticker.remove(holdTick);
|
|
163
|
+
holdTick = null;
|
|
164
|
+
}
|
|
165
|
+
/** Whether a field state is holding (tests / debugging). */
|
|
166
|
+
export const isHolding = (st) => holds.has(st);
|
|
167
|
+
/**
|
|
168
|
+
* Run the field's progress to `to`, refreshing the root matrix and the clock
|
|
169
|
+
* every tick. `tail` (in progress units) lets particles finish after the surface
|
|
170
|
+
* is gone: the tween covers 0 → 1 + tail.
|
|
171
|
+
*/
|
|
172
|
+
export function runProgress(root, st, to, opts) {
|
|
173
|
+
syncRoot(root, st);
|
|
174
|
+
gsap.killTweensOf(st.progress);
|
|
175
|
+
const s = st;
|
|
176
|
+
s.__resolve?.(); // a run that is replaced still "finishes" for whoever waits on it
|
|
177
|
+
// Nothing starts until the new shaders are compiled in the background (no freeze —
|
|
178
|
+
// see warmup.ts) and the first frame with them has been drawn. The token makes a
|
|
179
|
+
// quick re-trigger win over a start that is still waiting.
|
|
180
|
+
const token = (s.__run = (s.__run ?? 0) + 1);
|
|
181
|
+
return new Promise((resolve) => {
|
|
182
|
+
s.__resolve = resolve;
|
|
183
|
+
const start = () => {
|
|
184
|
+
if (s.__run !== token) {
|
|
185
|
+
resolve();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
stopHold(st);
|
|
189
|
+
let last = performance.now();
|
|
190
|
+
gsap.to(st.progress, {
|
|
191
|
+
value: to, duration: opts.duration, ease: opts.ease,
|
|
192
|
+
onUpdate: () => {
|
|
193
|
+
const now = performance.now();
|
|
194
|
+
if (opts.clock !== false)
|
|
195
|
+
st.time.value += Math.min(0.1, (now - last) / 1000);
|
|
196
|
+
last = now;
|
|
197
|
+
syncRoot(root, st);
|
|
198
|
+
opts.onUpdate?.();
|
|
199
|
+
},
|
|
200
|
+
onComplete: () => {
|
|
201
|
+
if (opts.hold && to > 0 && opts.clock !== false)
|
|
202
|
+
startHold(root, st);
|
|
203
|
+
opts.onComplete?.();
|
|
204
|
+
if (s.__resolve === resolve)
|
|
205
|
+
s.__resolve = null;
|
|
206
|
+
resolve();
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
const nextFrame = (fn) => (typeof requestAnimationFrame === 'function' ? requestAnimationFrame(() => fn()) : fn());
|
|
211
|
+
const warmOnly = warmMode.on;
|
|
212
|
+
Promise.all([commitPendingLayers(root), warmHelpers(root), opts.ready])
|
|
213
|
+
.catch(() => undefined)
|
|
214
|
+
.then(() => { if (warmOnly) {
|
|
215
|
+
if (s.__resolve === resolve)
|
|
216
|
+
s.__resolve = null;
|
|
217
|
+
resolve();
|
|
218
|
+
}
|
|
219
|
+
else
|
|
220
|
+
nextFrame(start); });
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/** The surface part of a transition: discard behind the front, light the edge. */
|
|
224
|
+
export function surfaceLayer(P, st, edge = 'ember') {
|
|
225
|
+
const edgeGlsl = edge === 'none' ? '' : edge === 'stain'
|
|
226
|
+
? /* glsl */ `
|
|
227
|
+
outgoingLight = mix(outgoingLight, u${P}EdgeColor, ${P}E * ${P}On * 0.85);`
|
|
228
|
+
: edge === 'ember'
|
|
229
|
+
? /* glsl */ `
|
|
230
|
+
vec3 ${P}Hot = mix(u${P}EdgeColor, vec3(1.0, 0.95, 0.85), ${P}E * ${P}E);
|
|
231
|
+
outgoingLight = mix(outgoingLight, ${P}Hot * (1.0 + 3.0 * ${P}E), ${P}E * ${P}On);`
|
|
232
|
+
: /* glsl */ `
|
|
233
|
+
outgoingLight += u${P}EdgeColor * (2.5 * ${P}E * ${P}E * ${P}On);`;
|
|
234
|
+
return {
|
|
235
|
+
uniforms: fieldUniforms(P, st),
|
|
236
|
+
common: `varying vec3 v${P}Q;\n${fieldGlsl(P)}`,
|
|
237
|
+
vertex: /* glsl */ `
|
|
238
|
+
v${P}Q = ${P}Norm((u${P}RootInv * modelMatrix * vec4(transformed, 1.0)).xyz);`,
|
|
239
|
+
fragment: /* glsl */ `
|
|
240
|
+
{
|
|
241
|
+
float ${P}D = ${P}Field(v${P}Q) - ${P}Threshold();
|
|
242
|
+
if (${P}D < 0.0) discard;
|
|
243
|
+
float ${P}E = 1.0 - smoothstep(0.0, u${P}EdgeWidth, ${P}D);
|
|
244
|
+
float ${P}On = step(0.0001, u${P}Progress) * step(u${P}Progress, 0.9999);
|
|
245
|
+
${edgeGlsl}
|
|
246
|
+
}`,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Hide / show the target's own meshes (never the effect's helpers) once a
|
|
251
|
+
* transition has taken the surface away. `tag` keeps each effect's bookkeeping
|
|
252
|
+
* separate, so two effects never restore each other's visibility.
|
|
253
|
+
*/
|
|
254
|
+
export function hideMeshes(target, tag, hidden) {
|
|
255
|
+
const k = `__opVis_${tag}`;
|
|
256
|
+
target.traverse((c) => {
|
|
257
|
+
if (!c.isMesh || c.userData?.__opFxHelper)
|
|
258
|
+
return;
|
|
259
|
+
if (hidden) {
|
|
260
|
+
if (c.userData[k] === undefined)
|
|
261
|
+
c.userData[k] = c.visible;
|
|
262
|
+
c.visible = false;
|
|
263
|
+
}
|
|
264
|
+
else if (c.userData[k] !== undefined) {
|
|
265
|
+
c.visible = c.userData[k];
|
|
266
|
+
delete c.userData[k];
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/** The current direction as a root-local unit vector (up for scattered / centre → out). */
|
|
271
|
+
export function sweepVector(st) {
|
|
272
|
+
const d = st.direction.value;
|
|
273
|
+
if (d === 2)
|
|
274
|
+
return new Vector3(0, -1, 0);
|
|
275
|
+
if (d === 4 || d === 5)
|
|
276
|
+
return st.sweep.value.clone();
|
|
277
|
+
return new Vector3(0, 1, 0);
|
|
278
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unweave.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/unweave.ts"],"names":[],"mappings":";AA2EA,wBA+IG"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// Unweave — the object is re-drawn as glowing contour threads (the real mesh
|
|
2
|
+
// sliced by horizontal planes, so the threads follow its exact shape) and the
|
|
3
|
+
// surface falls away behind them. Then, optionally, the threads disperse:
|
|
4
|
+
// up / down / left → right / right → left unravel ring by ring from the far
|
|
5
|
+
// end, each thread unwinding around the axis as it is drawn into a point
|
|
6
|
+
// of light beyond the object on that side (left/right: screen, at trigger)
|
|
7
|
+
// random every thread segment flies off on its own heading and fades
|
|
8
|
+
// scale the whole thread sculpture expands outward, keeping its shape, and fades
|
|
9
|
+
// With dispersing off, the object simply stays as a woven thread sculpture.
|
|
10
|
+
// Reverting weaves the object back together.
|
|
11
|
+
import { AdditiveBlending, BufferAttribute, BufferGeometry, Color, LineSegments, Matrix4, ShaderMaterial, Vector3 } from 'three';
|
|
12
|
+
import { defineOperation } from '../types.js';
|
|
13
|
+
import { GLSL_ROT, addLayer, forEachMeshMaterial, removeLayer, uniformDecl } from './shaderLayers.js';
|
|
14
|
+
import { createFieldState, fieldGlsl, fieldUniforms, hideMeshes, localBounds, runProgress, screenRight, surfaceLayer } from './transitionField.js';
|
|
15
|
+
import { mulberry32 } from './surfaceSample.js';
|
|
16
|
+
import { hideUntilWarm } from './warmup.js';
|
|
17
|
+
const P = 'Unw';
|
|
18
|
+
const KEY = 'unweave';
|
|
19
|
+
const STATE = '__opUnweave';
|
|
20
|
+
const MAX_TRIS = 300_000;
|
|
21
|
+
const MAX_SEGMENTS = 200_000;
|
|
22
|
+
const MODES = ['up', 'down', 'left', 'right', 'random', 'scale'];
|
|
23
|
+
/** Slice every mesh of the target with `levels` horizontal planes (root space). */
|
|
24
|
+
function contourSegments(target, levels) {
|
|
25
|
+
target.updateWorldMatrix(true, true);
|
|
26
|
+
const rootInv = new Matrix4().copy(target.matrixWorld).invert();
|
|
27
|
+
const box = localBounds(target);
|
|
28
|
+
const y0 = box.min.y, h = Math.max(box.max.y - box.min.y, 1e-4);
|
|
29
|
+
const step = h / levels;
|
|
30
|
+
const cx = (box.min.x + box.max.x) / 2, cz = (box.min.z + box.max.z) / 2;
|
|
31
|
+
const pos = [], lvl = [], ang = [], rnd = [];
|
|
32
|
+
const r = mulberry32(43);
|
|
33
|
+
const a = new Vector3(), b = new Vector3(), c = new Vector3();
|
|
34
|
+
const m = new Matrix4();
|
|
35
|
+
const cut = (p, q, y, out) => {
|
|
36
|
+
const t = (y - p.y) / (q.y - p.y);
|
|
37
|
+
out.push(p.x + (q.x - p.x) * t, y, p.z + (q.z - p.z) * t);
|
|
38
|
+
};
|
|
39
|
+
target.traverse((o) => {
|
|
40
|
+
if (!o.isMesh || o.userData?.__opFxHelper || !o.geometry?.getAttribute('position'))
|
|
41
|
+
return;
|
|
42
|
+
const g = o.geometry, P3 = g.getAttribute('position'), idx = g.index;
|
|
43
|
+
const tris = (idx ? idx.count : P3.count) / 3;
|
|
44
|
+
if (tris > MAX_TRIS)
|
|
45
|
+
return;
|
|
46
|
+
m.multiplyMatrices(rootInv, o.matrixWorld);
|
|
47
|
+
for (let t = 0; t < tris && pos.length / 6 < MAX_SEGMENTS; t++) {
|
|
48
|
+
a.fromBufferAttribute(P3, idx ? idx.getX(t * 3) : t * 3).applyMatrix4(m);
|
|
49
|
+
b.fromBufferAttribute(P3, idx ? idx.getX(t * 3 + 1) : t * 3 + 1).applyMatrix4(m);
|
|
50
|
+
c.fromBufferAttribute(P3, idx ? idx.getX(t * 3 + 2) : t * 3 + 2).applyMatrix4(m);
|
|
51
|
+
const lo = Math.min(a.y, b.y, c.y), hi = Math.max(a.y, b.y, c.y);
|
|
52
|
+
for (let k = Math.ceil((lo - y0) / step - 0.5); k <= Math.floor((hi - y0) / step - 0.5); k++) {
|
|
53
|
+
const y = y0 + (k + 0.5) * step;
|
|
54
|
+
const pts = [];
|
|
55
|
+
if ((a.y - y) * (b.y - y) < 0)
|
|
56
|
+
cut(a, b, y, pts);
|
|
57
|
+
if ((b.y - y) * (c.y - y) < 0)
|
|
58
|
+
cut(b, c, y, pts);
|
|
59
|
+
if ((c.y - y) * (a.y - y) < 0)
|
|
60
|
+
cut(c, a, y, pts);
|
|
61
|
+
if (pts.length !== 6)
|
|
62
|
+
continue;
|
|
63
|
+
pos.push(...pts);
|
|
64
|
+
const l = (k + 0.5) / levels;
|
|
65
|
+
const rr = r();
|
|
66
|
+
for (let e = 0; e < 2; e++) {
|
|
67
|
+
lvl.push(l);
|
|
68
|
+
ang.push((Math.atan2(pts[e * 3 + 2] - cz, pts[e * 3] - cx) / (2 * Math.PI) + 1) % 1);
|
|
69
|
+
rnd.push(rr);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return { pos: new Float32Array(pos), lvl: new Float32Array(lvl), ang: new Float32Array(ang), rnd: new Float32Array(rnd) };
|
|
75
|
+
}
|
|
76
|
+
export default defineOperation({
|
|
77
|
+
value: 'unweave',
|
|
78
|
+
label: 'Unweave',
|
|
79
|
+
description: 'Re-draw the targets as glowing threads that unravel into a point of light — reverting weaves them back',
|
|
80
|
+
channel: 'visual',
|
|
81
|
+
multi: true,
|
|
82
|
+
toggles: true,
|
|
83
|
+
usableIn: ['interaction', 'action'],
|
|
84
|
+
params: {
|
|
85
|
+
color: { type: 'color', label: 'Thread', default: '#ffcf7a' },
|
|
86
|
+
threads: { type: 'number', label: 'Threads', default: 56, min: 8, max: 200, step: 1, hint: 'Contour lines from bottom to top' },
|
|
87
|
+
disperse: { type: 'boolean', label: 'Disperse', default: true, hint: 'Off: the object stays as a thread sculpture' },
|
|
88
|
+
mode: {
|
|
89
|
+
type: 'select', label: 'Dispersal', default: 'up',
|
|
90
|
+
options: [
|
|
91
|
+
{ value: 'up', label: 'Unravel upward' }, { value: 'down', label: 'Unravel downward' },
|
|
92
|
+
{ value: 'left', label: 'Unravel left → right' }, { value: 'right', label: 'Unravel right → left' },
|
|
93
|
+
{ value: 'random', label: 'Scatter randomly' }, { value: 'scale', label: 'Expand (keep shape)' },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
duration: { type: 'number', label: 'Duration', default: 3.6, min: 0.3, max: 14, step: 0.1, unit: 's' },
|
|
97
|
+
},
|
|
98
|
+
apply(target, p, ctx) {
|
|
99
|
+
let st = target.userData[STATE];
|
|
100
|
+
if (!st) {
|
|
101
|
+
const field = createFieldState(target);
|
|
102
|
+
field.edgeWidth.value = 0.05;
|
|
103
|
+
const color = { value: new Color() };
|
|
104
|
+
const seg = contourSegments(target, Math.round(Number(p.threads)));
|
|
105
|
+
const geo = new BufferGeometry();
|
|
106
|
+
geo.setAttribute('position', new BufferAttribute(seg.pos, 3));
|
|
107
|
+
geo.setAttribute('aUnwLevel', new BufferAttribute(seg.lvl, 1));
|
|
108
|
+
geo.setAttribute('aUnwAng', new BufferAttribute(seg.ang, 1));
|
|
109
|
+
geo.setAttribute('aUnwRand', new BufferAttribute(seg.rnd, 1));
|
|
110
|
+
const mode = { value: 0 }, axis = { value: new Vector3(0, 1, 0) }, disperse = { value: 1 };
|
|
111
|
+
const uniforms = { ...fieldUniforms(P, field), uUnwColor: color, uUnwMode: mode, uUnwAxis: axis, uUnwDisperse: disperse };
|
|
112
|
+
const decl = Object.keys(uniforms).map(n => uniformDecl(n, uniforms[n].value)).join('\n');
|
|
113
|
+
const mat = new ShaderMaterial({
|
|
114
|
+
uniforms: uniforms,
|
|
115
|
+
vertexShader: `${decl}
|
|
116
|
+
attribute float aUnwLevel; attribute float aUnwAng; attribute float aUnwRand;
|
|
117
|
+
varying float vUnwA; varying float vUnwU;
|
|
118
|
+
${fieldGlsl(P)}
|
|
119
|
+
${GLSL_ROT}
|
|
120
|
+
void main() {
|
|
121
|
+
float prog = uUnwProgress;
|
|
122
|
+
float E = uUnwExtent;
|
|
123
|
+
// threads light up first
|
|
124
|
+
vUnwA = smoothstep(0.0, 0.18, prog);
|
|
125
|
+
vec3 C = uUnwMin + uUnwSize * 0.5;
|
|
126
|
+
vec3 ax = uUnwAxis;
|
|
127
|
+
float h = max(dot(abs(ax), uUnwSize) * 0.5, 1e-4);
|
|
128
|
+
vec3 rel0 = position - C;
|
|
129
|
+
float s = clamp(dot(rel0, ax) / (2.0 * h) + 0.5, 0.0, 1.0);
|
|
130
|
+
vec3 b1 = normalize(cross(ax, abs(ax.y) > 0.9 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0)));
|
|
131
|
+
vec3 b2 = cross(ax, b1);
|
|
132
|
+
float ang = atan(dot(rel0, b2), dot(rel0, b1)) / 6.2832 + 0.5;
|
|
133
|
+
float delay = uUnwMode < 3.5 ? (1.0 - s) * 0.55 + ang * 0.3 // far end first, unwinding round the axis
|
|
134
|
+
: uUnwMode < 4.5 ? aUnwRand * 0.75 // random
|
|
135
|
+
: aUnwRand * 0.12; // scale: nearly all together
|
|
136
|
+
float u = clamp((prog - 0.55 - delay * 0.9) / 0.4, 0.0, 1.0) * uUnwDisperse;
|
|
137
|
+
u = u * u * (3.0 - 2.0 * u);
|
|
138
|
+
vUnwU = u;
|
|
139
|
+
vec3 p;
|
|
140
|
+
if (uUnwMode < 3.5) {
|
|
141
|
+
vec3 rel = fxRot(ax, u * (2.5 + aUnwRand)) * rel0;
|
|
142
|
+
float along = dot(rel, ax);
|
|
143
|
+
vec3 perp = rel - ax * along;
|
|
144
|
+
vec3 wound = C + perp * (1.0 - u) + ax * mix(along, h + 0.25 * E, u * u);
|
|
145
|
+
p = mix(wound, C + ax * (h + 0.25 * E), u * u * u);
|
|
146
|
+
} else if (uUnwMode < 4.5) {
|
|
147
|
+
vec3 dir = normalize(vec3(fract(aUnwRand * 13.7), fract(aUnwRand * 71.3), fract(aUnwRand * 37.1)) - 0.5 + vec3(1e-3));
|
|
148
|
+
p = position + dir * (E * 1.3 * u * u);
|
|
149
|
+
} else {
|
|
150
|
+
p = C + rel0 * (1.0 + 1.8 * u);
|
|
151
|
+
}
|
|
152
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
|
|
153
|
+
}`,
|
|
154
|
+
fragmentShader: `
|
|
155
|
+
uniform vec3 uUnwColor; varying float vUnwA; varying float vUnwU;
|
|
156
|
+
void main() {
|
|
157
|
+
float a = vUnwA * (1.0 - smoothstep(0.85, 1.0, vUnwU));
|
|
158
|
+
vec3 c = uUnwColor * (1.2 + 2.5 * vUnwU);
|
|
159
|
+
gl_FragColor = vec4(c * a, a);
|
|
160
|
+
#include <tonemapping_fragment>
|
|
161
|
+
#include <colorspace_fragment>
|
|
162
|
+
}`,
|
|
163
|
+
transparent: true, depthWrite: false, blending: AdditiveBlending, premultipliedAlpha: true,
|
|
164
|
+
});
|
|
165
|
+
const lines = new LineSegments(geo, mat);
|
|
166
|
+
lines.frustumCulled = false;
|
|
167
|
+
lines.raycast = () => { };
|
|
168
|
+
lines.userData.__opFxHelper = true;
|
|
169
|
+
lines.renderOrder = 10;
|
|
170
|
+
target.add(lines);
|
|
171
|
+
hideUntilWarm(lines);
|
|
172
|
+
st = { field, color, mode, axis, disperse, lines, mats: new Set() };
|
|
173
|
+
const own = st;
|
|
174
|
+
// the surface itself falls away while the threads are drawn (tinted edge in the thread colour)
|
|
175
|
+
field.edgeColor.value = color.value;
|
|
176
|
+
const layer = surfaceLayer(P, field, 'tint');
|
|
177
|
+
forEachMeshMaterial(target, (mt, mesh) => {
|
|
178
|
+
if (mesh.userData?.__opFxHelper)
|
|
179
|
+
return;
|
|
180
|
+
if (addLayer(mt, KEY, layer))
|
|
181
|
+
own.mats.add(mt);
|
|
182
|
+
});
|
|
183
|
+
target.userData[STATE] = st;
|
|
184
|
+
}
|
|
185
|
+
const s = st;
|
|
186
|
+
s.color.value.set(String(p.color));
|
|
187
|
+
const mode = MODES.includes(String(p.mode)) ? String(p.mode) : 'up';
|
|
188
|
+
s.mode.value = MODES.indexOf(mode);
|
|
189
|
+
s.disperse.value = p.disperse === false ? 0 : 1;
|
|
190
|
+
if (mode === 'up')
|
|
191
|
+
s.axis.value.set(0, 1, 0);
|
|
192
|
+
else if (mode === 'down')
|
|
193
|
+
s.axis.value.set(0, -1, 0);
|
|
194
|
+
else if (mode === 'left' || mode === 'right') {
|
|
195
|
+
const r = screenRight(target, ctx);
|
|
196
|
+
s.axis.value.copy(mode === 'left' ? r : r.negate());
|
|
197
|
+
}
|
|
198
|
+
else
|
|
199
|
+
s.axis.value.set(0, 1, 0);
|
|
200
|
+
// the surface falls away from the far end (scattered for random / scale)
|
|
201
|
+
if (mode === 'random' || mode === 'scale')
|
|
202
|
+
s.field.direction.value = 0;
|
|
203
|
+
else {
|
|
204
|
+
s.field.direction.value = 4;
|
|
205
|
+
s.field.sweep.value.copy(s.axis.value).negate();
|
|
206
|
+
}
|
|
207
|
+
s.lines.visible = true;
|
|
208
|
+
const keep = s.disperse.value === 0;
|
|
209
|
+
// 0 → 1: surface goes (field clamps at 1); the threads run on to 1.6
|
|
210
|
+
return runProgress(target, s.field, 1.6, {
|
|
211
|
+
duration: Number(p.duration), ease: 'none',
|
|
212
|
+
onComplete: () => { hideMeshes(target, KEY, true); if (!keep)
|
|
213
|
+
s.lines.visible = false; },
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
revert(target, p) {
|
|
217
|
+
const s = target.userData[STATE];
|
|
218
|
+
if (!s)
|
|
219
|
+
return;
|
|
220
|
+
hideMeshes(target, KEY, false);
|
|
221
|
+
s.lines.visible = true;
|
|
222
|
+
return runProgress(target, s.field, 0, {
|
|
223
|
+
duration: Number(p.duration), ease: 'none',
|
|
224
|
+
onComplete: () => {
|
|
225
|
+
s.mats.forEach(m => removeLayer(m, KEY));
|
|
226
|
+
s.lines.removeFromParent();
|
|
227
|
+
s.lines.geometry.dispose();
|
|
228
|
+
s.lines.material.dispose();
|
|
229
|
+
delete target.userData[STATE];
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/visibility.ts"],"names":[],"mappings":";AAIA,
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/visibility.ts"],"names":[],"mappings":";AAIA,wBAoBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voxelize.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/voxelize.ts"],"names":[],"mappings":";AAsDA,wBAoFG"}
|