@3driseai/3drise-viewer 0.1.25 → 0.1.27
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 +16 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -0
- package/dist/animationsV2/ClipPlayer.js +199 -0
- package/dist/animationsV2/ClipsRuntime.d.ts +150 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -0
- package/dist/animationsV2/ClipsRuntime.js +707 -0
- package/dist/animationsV2/appliers.d.ts +21 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -0
- package/dist/animationsV2/appliers.js +222 -0
- package/dist/animationsV2/clipUtils.d.ts +33 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -0
- package/dist/animationsV2/clipUtils.js +164 -0
- package/dist/animationsV2/elementSettings.d.ts +15 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -0
- package/dist/animationsV2/elementSettings.js +16 -0
- package/dist/animationsV2/index.d.ts +16 -0
- package/dist/animationsV2/index.d.ts.map +1 -0
- package/dist/animationsV2/index.js +12 -0
- package/dist/animationsV2/nodeTracks.d.ts +13 -0
- package/dist/animationsV2/nodeTracks.d.ts.map +1 -0
- package/dist/animationsV2/nodeTracks.js +165 -0
- package/dist/animationsV2/normalize.d.ts +4 -0
- package/dist/animationsV2/normalize.d.ts.map +1 -0
- package/dist/animationsV2/normalize.js +60 -0
- package/dist/animationsV2/sequenceUtils.d.ts +98 -0
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -0
- package/dist/animationsV2/sequenceUtils.js +220 -0
- package/dist/animationsV2/types.d.ts +115 -0
- package/dist/animationsV2/types.d.ts.map +1 -0
- package/dist/animationsV2/types.js +8 -0
- package/dist/api/sceneHandle.d.ts +56 -17
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +154 -77
- 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/Bubbles.d.ts +7 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +42 -22
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +0 -44
- 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/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +0 -34
- package/dist/components/CloudsGenerator.d.ts +1 -1
- package/dist/components/CloudsGenerator.js +1 -1
- 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/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +19 -1
- 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/EnvironmentManager.js +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 +7 -1
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +20 -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/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/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 +4 -1
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +57 -3
- package/dist/components/Ocean.d.ts.map +1 -1
- package/dist/components/Ocean.js +0 -63
- package/dist/components/OceanBuilder.d.ts +1 -1
- package/dist/components/OceanBuilder.js +1 -1
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +6 -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.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +19 -4
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +0 -39
- 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/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +3 -47
- 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/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 +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -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/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +0 -5
- 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/VolumetricCloudsPass.js +0 -6
- 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/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -2
- 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/useInteraction.d.ts +6 -7
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +87 -268
- package/dist/hooks/useLandscapeMaps.d.ts +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.js +0 -2
- package/dist/hooks/useOceanMaterial.d.ts +1 -1
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +0 -5
- package/dist/hooks/useRuntimeSettings.d.ts +1 -1
- package/dist/hooks/useRuntimeSettings.js +1 -1
- package/dist/hooks/useThunder.d.ts +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/interactions/index.d.ts +4 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/interactions/index.js +1 -0
- package/dist/interactions/runner.d.ts +24 -0
- package/dist/interactions/runner.d.ts.map +1 -0
- package/dist/interactions/runner.js +46 -0
- 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 +3 -0
- package/dist/operations/catalogue/displayImage.d.ts.map +1 -0
- package/dist/operations/catalogue/displayImage.js +40 -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 +3 -0
- package/dist/operations/catalogue/fade.d.ts.map +1 -0
- package/dist/operations/catalogue/fade.js +45 -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 +3 -0
- package/dist/operations/catalogue/focus.d.ts.map +1 -0
- package/dist/operations/catalogue/focus.js +23 -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 +3 -0
- package/dist/operations/catalogue/glow.d.ts.map +1 -0
- package/dist/operations/catalogue/glow.js +50 -0
- 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/materialFx.d.ts +6 -0
- package/dist/operations/catalogue/materialFx.d.ts.map +1 -0
- package/dist/operations/catalogue/materialFx.js +13 -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 +3 -0
- package/dist/operations/catalogue/moveToFront.d.ts.map +1 -0
- package/dist/operations/catalogue/moveToFront.js +26 -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 +3 -0
- package/dist/operations/catalogue/visibility.d.ts.map +1 -0
- package/dist/operations/catalogue/visibility.js +25 -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 +3 -0
- package/dist/operations/catalogue/zoom.d.ts.map +1 -0
- package/dist/operations/catalogue/zoom.js +33 -0
- package/dist/operations/index.d.ts +7 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +6 -0
- 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 +16 -0
- package/dist/operations/registry.d.ts.map +1 -0
- package/dist/operations/registry.js +63 -0
- package/dist/operations/runtime.d.ts +60 -0
- package/dist/operations/runtime.d.ts.map +1 -0
- package/dist/operations/runtime.js +317 -0
- package/dist/operations/types.d.ts +122 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +9 -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 +3 -0
- package/dist/operations/useOperationsRuntime.d.ts.map +1 -0
- package/dist/operations/useOperationsRuntime.js +69 -0
- 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/index.d.ts +8 -8
- 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,135 @@
|
|
|
1
|
+
// Metalize — the object turns to metal, the way a pour of molten metal would
|
|
2
|
+
// coat it: a bright molten front sweeps over the surface (white-hot at the lip,
|
|
3
|
+
// cooling to orange), a liquid ripple settles just behind it, and what it leaves
|
|
4
|
+
// is polished metal. Presets for gold, silver, chrome, copper, bronze, rose gold,
|
|
5
|
+
// anodised titanium (thin-film iridescence) and gunmetal, or a custom tint;
|
|
6
|
+
// polish blurs the reflection from mirror to brushed.
|
|
7
|
+
//
|
|
8
|
+
// The reflection is the same procedural studio environment as Liquid metal, so
|
|
9
|
+
// the metal reads in any scene, with or without an environment map.
|
|
10
|
+
// A state, not an exit: it stays metal while on; reverting melts it back off.
|
|
11
|
+
import { Color } from 'three';
|
|
12
|
+
import { defineOperation } from '../types.js';
|
|
13
|
+
import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
14
|
+
import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams } from './transitionField.js';
|
|
15
|
+
const P = 'Mtl';
|
|
16
|
+
const KEY = 'metalize';
|
|
17
|
+
const STATE = '__opMetalize';
|
|
18
|
+
/** Metal base colours (linear-ish F0 tints). Titanium is special-cased (iridescent). */
|
|
19
|
+
const METALS = {
|
|
20
|
+
gold: '#ffc766', silver: '#e8ecf0', chrome: '#dfe6ee', copper: '#f0936a', bronze: '#c8955a',
|
|
21
|
+
roseGold: '#f2b0a0', titanium: '#b8bfc8', gunmetal: '#5c6068',
|
|
22
|
+
};
|
|
23
|
+
const DEFAULT_CUSTOM = '#9fd0ff';
|
|
24
|
+
function layerFor(st) {
|
|
25
|
+
return {
|
|
26
|
+
uniforms: { ...fieldUniforms(P, st.field), uMtlTint: st.tint, uMtlRough: st.rough, uMtlIrid: st.irid, uMtlLip: st.lip, uMtlCool: st.cool },
|
|
27
|
+
common: `varying vec3 vMtlQ;\nvarying vec3 vMtlR;\nvarying vec3 vMtlView;\n${fieldGlsl(P)}`,
|
|
28
|
+
vertex: /* glsl */ `
|
|
29
|
+
vMtlR = (uMtlRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
|
|
30
|
+
vMtlQ = MtlNorm(vMtlR);
|
|
31
|
+
vMtlView = (modelViewMatrix * vec4(transformed, 1.0)).xyz;`,
|
|
32
|
+
fragment: /* glsl */ `
|
|
33
|
+
{
|
|
34
|
+
float d = MtlThreshold() - MtlField(vMtlQ); // > 0 behind the front
|
|
35
|
+
float m = smoothstep(0.0, uMtlEdgeWidth, d);
|
|
36
|
+
if (m > 0.0 || d > -0.05) {
|
|
37
|
+
vec3 nv = normalize(cross(dFdx(vMtlView), dFdy(vMtlView)));
|
|
38
|
+
#if defined( STANDARD ) || defined( PHONG ) || defined( LAMBERT ) || defined( TOON )
|
|
39
|
+
vec3 n = normalize(normal);
|
|
40
|
+
#else
|
|
41
|
+
vec3 n = nv;
|
|
42
|
+
#endif
|
|
43
|
+
// liquid settling just behind the front: a fading ripple in the normal
|
|
44
|
+
float wet = 1.0 - smoothstep(0.0, 0.18, d);
|
|
45
|
+
vec3 rp = vMtlR / uMtlExtent * 40.0;
|
|
46
|
+
n = normalize(n + wet * m * 0.25 * vec3(sin(rp.x + d * 60.0), 0.0, cos(rp.z + d * 60.0)));
|
|
47
|
+
vec3 v = normalize(vMtlView);
|
|
48
|
+
vec3 rw = normalize((vec4(reflect(v, n), 0.0) * viewMatrix).xyz);
|
|
49
|
+
float up = rw.y;
|
|
50
|
+
vec3 env = mix(vec3(0.05), vec3(0.85, 0.9, 1.0), smoothstep(-0.15, 0.6, up));
|
|
51
|
+
env += vec3(1.4) * exp(-abs(up - 0.02) * 40.0);
|
|
52
|
+
env += vec3(2.2) * smoothstep(0.92, 0.99, dot(rw, normalize(vec3(0.6, 0.55, 0.6))));
|
|
53
|
+
env += vec3(1.2) * smoothstep(0.9, 0.98, dot(rw, normalize(vec3(-0.7, 0.35, -0.3))));
|
|
54
|
+
// polish: rough metal sees a blurred, flatter studio
|
|
55
|
+
env = mix(env, vec3(0.55, 0.57, 0.6), uMtlRough * 0.85);
|
|
56
|
+
float ndv = abs(dot(n, -v));
|
|
57
|
+
vec3 tint = uMtlTint;
|
|
58
|
+
// anodised titanium: thin-film interference, hue shifts with the viewing angle
|
|
59
|
+
vec3 film = 0.5 + 0.5 * cos(6.2832 * (ndv * 1.4 + vec3(0.0, 0.33, 0.67) + 0.15));
|
|
60
|
+
tint = mix(tint, film * 0.9 + 0.1, uMtlIrid);
|
|
61
|
+
float fres = 0.7 + 0.3 * pow(1.0 - ndv, 4.0);
|
|
62
|
+
vec3 metal = tint * env * fres;
|
|
63
|
+
outgoingLight = mix(outgoingLight, metal, m);
|
|
64
|
+
// the molten lip: white-hot at the edge, cooling to orange just behind
|
|
65
|
+
float lip = exp(-abs(d) / 0.012) * step(0.0001, uMtlProgress) * step(uMtlProgress, 0.9999);
|
|
66
|
+
float cooling = exp(-max(d, 0.0) / 0.05) * m * step(uMtlProgress, 0.9999);
|
|
67
|
+
outgoingLight += uMtlLip * lip * 2.2 + uMtlCool * cooling * 0.9;
|
|
68
|
+
}
|
|
69
|
+
}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export default defineOperation({
|
|
73
|
+
value: 'metalize',
|
|
74
|
+
label: 'Metalize',
|
|
75
|
+
description: 'Pour molten metal over the targets and leave them polished gold, chrome, copper… — reverting melts it off',
|
|
76
|
+
channel: 'visual',
|
|
77
|
+
multi: true,
|
|
78
|
+
toggles: true,
|
|
79
|
+
usableIn: ['interaction', 'action', 'object'],
|
|
80
|
+
stack: 'surface',
|
|
81
|
+
params: {
|
|
82
|
+
metal: {
|
|
83
|
+
type: 'select', label: 'Metal', default: 'gold',
|
|
84
|
+
options: [
|
|
85
|
+
{ value: 'gold', label: 'Gold' }, { value: 'silver', label: 'Silver' }, { value: 'chrome', label: 'Chrome' },
|
|
86
|
+
{ value: 'copper', label: 'Copper' }, { value: 'bronze', label: 'Bronze' }, { value: 'roseGold', label: 'Rose gold' },
|
|
87
|
+
{ value: 'titanium', label: 'Anodised titanium' }, { value: 'gunmetal', label: 'Gunmetal' }, { value: 'custom', label: 'Custom colour' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
color: { type: 'color', label: 'Custom colour', default: DEFAULT_CUSTOM, hint: 'Pick a colour to tint the metal (overrides the preset)' },
|
|
91
|
+
lipColor: { type: 'color', label: 'Molten edge', default: '#ffd9a6', hint: 'Colour of the pouring front' },
|
|
92
|
+
coolColor: { type: 'color', label: 'Cooling glow', default: '#ff6a1a', hint: 'Glow just behind the front as it cools' },
|
|
93
|
+
polish: { type: 'number', label: 'Polish', default: 0.85, min: 0, max: 1, step: 0.01, hint: '1 = mirror, 0 = brushed' },
|
|
94
|
+
direction: { type: 'select', label: 'Pour direction', default: 'down', options: DIRECTION_OPTIONS },
|
|
95
|
+
scale: { type: 'number', label: 'Front pattern', default: 2, min: 0.5, max: 12, step: 0.1 },
|
|
96
|
+
duration: { type: 'number', label: 'Duration', default: 2.2, min: 0.3, max: 12, 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
|
+
st = { field, tint: { value: new Color() }, rough: { value: 0.15 }, irid: { value: 0 }, lip: { value: new Color() }, cool: { value: new Color() }, mats: new Set() };
|
|
104
|
+
const own = st;
|
|
105
|
+
const layer = layerFor(own);
|
|
106
|
+
forEachMeshMaterial(target, (mat, mesh) => {
|
|
107
|
+
if (mesh.userData?.__opFxHelper)
|
|
108
|
+
return;
|
|
109
|
+
if (addLayer(mat, KEY, layer))
|
|
110
|
+
own.mats.add(mat);
|
|
111
|
+
});
|
|
112
|
+
target.userData[STATE] = st;
|
|
113
|
+
}
|
|
114
|
+
const s = st;
|
|
115
|
+
setFieldParams(s.field, p, target, ctx);
|
|
116
|
+
// a colour the user picked always wins (choosing "Custom colour" is not required)
|
|
117
|
+
const metal = String(p.metal);
|
|
118
|
+
const custom = metal === 'custom' || String(p.color).toLowerCase() !== DEFAULT_CUSTOM;
|
|
119
|
+
s.tint.value.set(custom ? String(p.color) : (METALS[metal] ?? METALS.gold));
|
|
120
|
+
s.irid.value = metal === 'titanium' && !custom ? 0.85 : 0;
|
|
121
|
+
s.lip.value.set(String(p.lipColor));
|
|
122
|
+
s.cool.value.set(String(p.coolColor));
|
|
123
|
+
s.rough.value = 1 - Number(p.polish);
|
|
124
|
+
return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
|
|
125
|
+
},
|
|
126
|
+
revert(target, p) {
|
|
127
|
+
const s = target.userData[STATE];
|
|
128
|
+
if (!s)
|
|
129
|
+
return;
|
|
130
|
+
return runProgress(target, s.field, 0, {
|
|
131
|
+
duration: Number(p.duration), ease: 'power1.inOut',
|
|
132
|
+
onComplete: () => { s.mats.forEach(m => removeLayer(m, KEY)); delete target.userData[STATE]; },
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moveToFront.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/moveToFront.ts"],"names":[],"mappings":";AAEA,wBAwBG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DEFAULT_EASE, defineOperation } from '../types.js';
|
|
2
|
+
export default defineOperation({
|
|
3
|
+
value: 'moveToFront',
|
|
4
|
+
label: 'Bring to front',
|
|
5
|
+
description: 'Bring the target in front of the camera',
|
|
6
|
+
channel: 'transform',
|
|
7
|
+
multi: false,
|
|
8
|
+
toggles: true,
|
|
9
|
+
usableIn: ['interaction', 'action'],
|
|
10
|
+
exclusive: { group: 'front', release: 'revert' },
|
|
11
|
+
params: {
|
|
12
|
+
distance: { type: 'number', label: 'Distance', default: 2, min: 0.1, max: 100, step: 0.1 },
|
|
13
|
+
width: { type: 'number', label: 'Scale X', default: 6, min: 0.01, max: 100, step: 0.1 },
|
|
14
|
+
height: { type: 'number', label: 'Scale Y', default: 4, min: 0.01, max: 100, step: 0.1 },
|
|
15
|
+
duration: { type: 'number', label: 'Duration', default: 1, min: 0, max: 10, step: 0.05, unit: 's' },
|
|
16
|
+
},
|
|
17
|
+
apply(target, p, ctx) {
|
|
18
|
+
ctx.tools.moveToFront(target, {
|
|
19
|
+
distance: Number(p.distance), scale: [Number(p.width), Number(p.height)],
|
|
20
|
+
duration: Number(p.duration), ease: DEFAULT_EASE,
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
revert(target, p, ctx) {
|
|
24
|
+
ctx.tools.restoreTransform(target, { duration: Number(p.duration), ease: DEFAULT_EASE });
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orbit.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/orbit.ts"],"names":[],"mappings":";AAMA,wBAuBG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Orbit — the camera circles the target at its current distance and height,
|
|
2
|
+
// turning to face it on the way in. A full circle ends where it started;
|
|
3
|
+
// reverting (actions) flies back to where the camera was.
|
|
4
|
+
import { Box3, Vector3 } from 'three';
|
|
5
|
+
import { defineOperation } from '../types.js';
|
|
6
|
+
export default defineOperation({
|
|
7
|
+
value: 'orbit',
|
|
8
|
+
label: 'Orbit',
|
|
9
|
+
description: 'Circle the camera around the target, keeping its distance and height',
|
|
10
|
+
channel: 'camera',
|
|
11
|
+
multi: false,
|
|
12
|
+
toggles: false,
|
|
13
|
+
usableIn: ['interaction', 'action'],
|
|
14
|
+
exclusive: { group: 'camera', release: 'handover' },
|
|
15
|
+
params: {
|
|
16
|
+
angle: { type: 'number', label: 'Angle', default: 360, min: 15, max: 720, step: 15, unit: '°', hint: '360 ends where it started' },
|
|
17
|
+
reverse: { type: 'boolean', label: 'Clockwise', default: false },
|
|
18
|
+
duration: { type: 'number', label: 'Duration', default: 6, min: 0.5, max: 60, step: 0.5, unit: 's' },
|
|
19
|
+
},
|
|
20
|
+
apply(target, p, ctx) {
|
|
21
|
+
ctx.saveCameraHome();
|
|
22
|
+
const c = new Box3().setFromObject(target).getCenter(new Vector3());
|
|
23
|
+
const deg = Number(p.angle) * (p.reverse ? -1 : 1);
|
|
24
|
+
void ctx.tools.orbitCamera([c.x, c.y, c.z], deg, Number(p.duration), 'power1.inOut');
|
|
25
|
+
},
|
|
26
|
+
revert(_target, p, ctx) {
|
|
27
|
+
ctx.restoreCameraHome(Math.min(1.5, Number(p.duration)), 'power2.inOut');
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particleSwarm.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/particleSwarm.ts"],"names":[],"mappings":";AAiCA,wBAsGG"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Particle swarm — the target comes apart into its own surface, particle by
|
|
2
|
+
// particle (each carries the colour of the spot it left), and the particles
|
|
3
|
+
// sweep up into a slow vortex around the object's centre with differential
|
|
4
|
+
// rotation (inner rings faster, like a disc). While it is on, the swarm keeps
|
|
5
|
+
// turning. Reverting pulls every particle back to its exact spot and the
|
|
6
|
+
// surface closes behind them.
|
|
7
|
+
import { gsap } from 'gsap';
|
|
8
|
+
import { defineOperation } from '../types.js';
|
|
9
|
+
import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
10
|
+
import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams, surfaceLayer, syncRoot, } from './transitionField.js';
|
|
11
|
+
import { sampleSurfaceCached } from './surfaceSample.js';
|
|
12
|
+
import { GLSL_POINT_SIZE, createFxPoints, disposeFxPoints } from './fxPoints.js';
|
|
13
|
+
const P = 'Swm';
|
|
14
|
+
const KEY = 'particleSwarm';
|
|
15
|
+
const STATE = '__opSwarm';
|
|
16
|
+
/** Flight length in progress units: the tween runs 0 → 1 + FLIGHT. */
|
|
17
|
+
const FLIGHT = 0.5;
|
|
18
|
+
export default defineOperation({
|
|
19
|
+
value: 'particleSwarm',
|
|
20
|
+
label: 'Particle swarm',
|
|
21
|
+
description: 'Break the targets into their own coloured particles that swirl around them — reverting reassembles',
|
|
22
|
+
channel: 'visual',
|
|
23
|
+
multi: true,
|
|
24
|
+
toggles: true,
|
|
25
|
+
usableIn: ['interaction', 'action'],
|
|
26
|
+
params: {
|
|
27
|
+
direction: { type: 'select', label: 'Direction', default: 'up', options: DIRECTION_OPTIONS },
|
|
28
|
+
particles: { type: 'number', label: 'Particles', default: 30000, min: 2000, max: 120000, step: 1000 },
|
|
29
|
+
particleSize: { type: 'number', label: 'Particle size', default: 1, min: 0.2, max: 4, step: 0.1, unit: '×' },
|
|
30
|
+
spread: { type: 'number', label: 'Spread', default: 1, min: 0.3, max: 3, step: 0.05, unit: '×', hint: 'Radius of the vortex' },
|
|
31
|
+
speed: { type: 'number', label: 'Swirl speed', default: 1, min: 0, max: 4, step: 0.05, unit: '×' },
|
|
32
|
+
edgeColor: { type: 'color', label: 'Edge colour', default: '#9fe8ff' },
|
|
33
|
+
glow: { type: 'boolean', label: 'Glow', default: true, hint: 'Additive light — off keeps the true surface colours' },
|
|
34
|
+
duration: { type: 'number', label: 'Duration', default: 2.8, min: 0.3, max: 12, step: 0.1, unit: 's' },
|
|
35
|
+
},
|
|
36
|
+
apply(target, p, ctx) {
|
|
37
|
+
let st = target.userData[STATE];
|
|
38
|
+
if (!st) {
|
|
39
|
+
const field = createFieldState(target);
|
|
40
|
+
field.edgeWidth.value = 0.05;
|
|
41
|
+
field.scale.value = 2.5;
|
|
42
|
+
const flight = { value: FLIGHT }, spread = { value: 1 }, speed = { value: 1 }, size = { value: 1 };
|
|
43
|
+
const sample = sampleSurfaceCached(target, Math.round(Number(p.particles)), 11);
|
|
44
|
+
const points = createFxPoints(target, sample, {
|
|
45
|
+
additive: !!p.glow,
|
|
46
|
+
uniforms: { ...fieldUniforms(P, field), uSwmFlight: flight, uSwmSpread: spread, uSwmSpeed: speed, uSwmPtSize: size },
|
|
47
|
+
vertexPars: fieldGlsl(P) + GLSL_POINT_SIZE,
|
|
48
|
+
vertexMain: /* glsl */ `
|
|
49
|
+
float birth = ${P}BirthOf(${P}Field(${P}Norm(aP)));
|
|
50
|
+
float a = clamp((uSwmProgress - birth) / uSwmFlight, 0.0, 1.0);
|
|
51
|
+
if (a <= 0.0) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); gl_PointSize = 0.0; vColor = vec3(0.0); vAlpha = 0.0; return; }
|
|
52
|
+
float E = uSwmExtent;
|
|
53
|
+
vec3 C = u${P}Min + u${P}Size * 0.5;
|
|
54
|
+
// destination: a tilted two-arm spiral galaxy around the object's centre.
|
|
55
|
+
// The arm pattern turns as one (so it never winds up); each particle adds a small
|
|
56
|
+
// differential drift, and the disc is lens-shaped: thick at the core, thin at the rim.
|
|
57
|
+
float R = 0.5 * max(u${P}Size.x, u${P}Size.z) * uSwmSpread + 0.15 * E;
|
|
58
|
+
float rn = 0.18 + 0.9 * pow(aR.x, 0.75);
|
|
59
|
+
float r = R * rn;
|
|
60
|
+
float arm = step(0.5, aR.z) * 3.14159;
|
|
61
|
+
float scatter = (aR.y + aR.w - 1.0) * (0.35 + 0.5 * rn);
|
|
62
|
+
float th = arm + 2.2 * log(rn + 0.15) + scatter
|
|
63
|
+
+ uSwmSpeed * (0.35 * u${P}Time + 0.12 * u${P}Time / (0.3 + rn));
|
|
64
|
+
float h = (aR.y + fract(aR.w * 7.13) - 1.0) * 0.16 * E * (1.0 - 0.7 * rn);
|
|
65
|
+
vec3 disc = vec3(cos(th) * r, h, sin(th) * r);
|
|
66
|
+
// ~20° tilt so the spiral reads from a side view
|
|
67
|
+
float ct = 0.94, stl = 0.34;
|
|
68
|
+
disc = vec3(disc.x, disc.y * ct - disc.z * stl, disc.y * stl + disc.z * ct);
|
|
69
|
+
vec3 D = C + disc;
|
|
70
|
+
// quadratic Bézier: lift off along the normal, then into the slot
|
|
71
|
+
vec3 ctrl = aP + aN * (0.25 * E) + vec3(0.0, 0.12 * E, 0.0);
|
|
72
|
+
float k = a * a * (3.0 - 2.0 * a);
|
|
73
|
+
vec3 local = mix(mix(aP, ctrl, k), mix(ctrl, D, k), k);
|
|
74
|
+
vec4 mv = modelViewMatrix * vec4(local, 1.0);
|
|
75
|
+
gl_Position = projectionMatrix * mv;
|
|
76
|
+
// the colour of the spot it left, brighter in flight, a slow shimmer in the vortex
|
|
77
|
+
float flightGlow = sin(3.14159 * a);
|
|
78
|
+
float shimmer = 0.85 + 0.15 * sin(u${P}Time * (1.0 + 2.0 * aR.w) + aR.z * 6.2832);
|
|
79
|
+
vColor = aC * (1.0 + 0.4 * flightGlow) * shimmer + u${P}EdgeColor * 0.25 * flightGlow * flightGlow;
|
|
80
|
+
vAlpha = smoothstep(0.0, 0.08, a);
|
|
81
|
+
gl_PointSize = clamp(fxPointPx(E * 0.0045 * uSwmPtSize * (0.6 + 0.8 * aR.w), mv), 0.0, 20.0);`,
|
|
82
|
+
});
|
|
83
|
+
const own = {};
|
|
84
|
+
// while the swarm exists it keeps turning, even after the transition finished
|
|
85
|
+
const tick = () => { own.field.time.value += gsap.ticker.deltaRatio() / 60; syncRoot(target, own.field); };
|
|
86
|
+
Object.assign(own, { field, flight, spread, speed, size, points, mats: new Set(), tick });
|
|
87
|
+
st = own;
|
|
88
|
+
const layer = surfaceLayer(P, field, 'tint');
|
|
89
|
+
forEachMeshMaterial(target, (mat, mesh) => {
|
|
90
|
+
if (mesh.userData?.__opFxHelper)
|
|
91
|
+
return;
|
|
92
|
+
if (addLayer(mat, KEY, layer))
|
|
93
|
+
own.mats.add(mat);
|
|
94
|
+
});
|
|
95
|
+
gsap.ticker.add(tick);
|
|
96
|
+
target.userData[STATE] = st;
|
|
97
|
+
}
|
|
98
|
+
const s = st;
|
|
99
|
+
setFieldParams(s.field, p, target, ctx);
|
|
100
|
+
s.spread.value = Number(p.spread);
|
|
101
|
+
s.speed.value = Number(p.speed);
|
|
102
|
+
s.size.value = Number(p.particleSize);
|
|
103
|
+
return runProgress(target, s.field, 1 + FLIGHT, {
|
|
104
|
+
duration: Number(p.duration), ease: 'power1.inOut', clock: false,
|
|
105
|
+
onComplete: () => setMeshesHidden(target, true),
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
revert(target, p) {
|
|
109
|
+
const s = target.userData[STATE];
|
|
110
|
+
if (!s)
|
|
111
|
+
return;
|
|
112
|
+
setMeshesHidden(target, false);
|
|
113
|
+
return runProgress(target, s.field, 0, {
|
|
114
|
+
duration: Number(p.duration), ease: 'power1.inOut', clock: false,
|
|
115
|
+
onComplete: () => {
|
|
116
|
+
gsap.ticker.remove(s.tick);
|
|
117
|
+
s.mats.forEach(m => removeLayer(m, KEY));
|
|
118
|
+
disposeFxPoints(s.points);
|
|
119
|
+
delete target.userData[STATE];
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
function setMeshesHidden(target, hidden) {
|
|
125
|
+
target.traverse((c) => {
|
|
126
|
+
if (!c.isMesh || c.userData?.__opFxHelper)
|
|
127
|
+
return;
|
|
128
|
+
if (hidden) {
|
|
129
|
+
if (c.userData.__opSwmVis === undefined)
|
|
130
|
+
c.userData.__opSwmVis = c.visible;
|
|
131
|
+
c.visible = false;
|
|
132
|
+
}
|
|
133
|
+
else if (c.userData.__opSwmVis !== undefined) {
|
|
134
|
+
c.visible = c.userData.__opSwmVis;
|
|
135
|
+
delete c.userData.__opSwmVis;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"petalPeel.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/petalPeel.ts"],"names":[],"mappings":";AAsBA,wBAqHG"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Petal peel — the surface lifts off in thin flakes, each carrying the colour of
|
|
2
|
+
// the spot it came from: a flake first hinges up off the surface, then flutters
|
|
3
|
+
// down the way a leaf does — slow terminal-velocity fall, side-to-side sway and
|
|
4
|
+
// rocking tumble — and settles flat on the ground around the base. The flakes
|
|
5
|
+
// are real lit, double-sided instances (one instanced mesh, casting shadows).
|
|
6
|
+
// Reverting lifts them back into place and the surface closes.
|
|
7
|
+
import { CircleGeometry } from 'three';
|
|
8
|
+
import { defineOperation } from '../types.js';
|
|
9
|
+
import { GLSL_ROT, addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
10
|
+
import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress, setFieldParams, surfaceLayer, } from './transitionField.js';
|
|
11
|
+
import { sampleSurfaceCached } from './surfaceSample.js';
|
|
12
|
+
import { createFxInstances, disposeFxInstances } from './fxInstances.js';
|
|
13
|
+
const P = 'Pdl';
|
|
14
|
+
const KEY = 'petalPeel';
|
|
15
|
+
const STATE = '__opPetal';
|
|
16
|
+
const LIFE = 0.8;
|
|
17
|
+
export default defineOperation({
|
|
18
|
+
value: 'petalPeel',
|
|
19
|
+
label: 'Petal peel',
|
|
20
|
+
description: 'Peel the targets into flakes that flutter down like leaves — reverting lifts them back',
|
|
21
|
+
channel: 'visual',
|
|
22
|
+
multi: true,
|
|
23
|
+
toggles: true,
|
|
24
|
+
usableIn: ['interaction', 'action'],
|
|
25
|
+
params: {
|
|
26
|
+
direction: { type: 'select', label: 'Direction', default: 'down', options: DIRECTION_OPTIONS },
|
|
27
|
+
petals: { type: 'number', label: 'Petals', default: 2600, min: 300, max: 20000, step: 100 },
|
|
28
|
+
petalSize: { type: 'number', label: 'Petal size', default: 1, min: 0.3, max: 4, step: 0.05, unit: '×' },
|
|
29
|
+
drift: { type: 'number', label: 'Drift', default: 1, min: 0, max: 4, step: 0.05, unit: '×', hint: 'How far they sway and scatter' },
|
|
30
|
+
edgeColor: { type: 'color', label: 'Edge colour', default: '#fff1d6' },
|
|
31
|
+
scale: { type: 'number', label: 'Pattern', default: 2.5, min: 0.5, max: 12, step: 0.1 },
|
|
32
|
+
duration: { type: 'number', label: 'Duration', default: 4, min: 0.3, max: 14, step: 0.1, unit: 's' },
|
|
33
|
+
},
|
|
34
|
+
apply(target, p, ctx) {
|
|
35
|
+
let st = target.userData[STATE];
|
|
36
|
+
if (!st) {
|
|
37
|
+
const field = createFieldState(target);
|
|
38
|
+
field.edgeWidth.value = 0.04;
|
|
39
|
+
const life = { value: LIFE }, drift = { value: 1 };
|
|
40
|
+
const count = Math.round(Number(p.petals));
|
|
41
|
+
const sample = sampleSurfaceCached(target, count, 47);
|
|
42
|
+
// petal size from the surface area each one has to cover
|
|
43
|
+
const E = field.extent.value;
|
|
44
|
+
const size = E * 0.034 * Number(p.petalSize) * Math.sqrt(2600 / Math.max(300, count));
|
|
45
|
+
const geo = new CircleGeometry(0.5, 10);
|
|
46
|
+
geo.scale(size, size * 0.62, size);
|
|
47
|
+
const mesh = createFxInstances(target, {
|
|
48
|
+
geometry: geo,
|
|
49
|
+
count: sample.count, positions: sample.position.slice(0, sample.count * 3), colors: sample.color.slice(0, sample.count * 3),
|
|
50
|
+
attributes: {
|
|
51
|
+
aPdlP: [sample.position.slice(0, sample.count * 3), 3],
|
|
52
|
+
aPdlN: [sample.normal.slice(0, sample.count * 3), 3],
|
|
53
|
+
aPdlR: [sample.random.slice(0, sample.count * 4), 4],
|
|
54
|
+
},
|
|
55
|
+
layerKey: 'petalInstances', roughness: 0.7, metalness: 0, doubleSided: true,
|
|
56
|
+
layer: {
|
|
57
|
+
uniforms: { ...fieldUniforms(P, field), uPdlLife: life, uPdlDrift: drift },
|
|
58
|
+
common: fieldGlsl(P) + GLSL_ROT,
|
|
59
|
+
vertexPars: /* glsl */ `
|
|
60
|
+
attribute vec3 aPdlP; attribute vec3 aPdlN; attribute vec4 aPdlR;
|
|
61
|
+
// frame that lays the flake (XY plane) on the surface, facing out
|
|
62
|
+
mat3 pdlFrame() {
|
|
63
|
+
vec3 n = normalize(aPdlN + vec3(1e-4));
|
|
64
|
+
vec3 t = normalize(cross(abs(n.y) < 0.95 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0), n));
|
|
65
|
+
vec3 b = cross(n, t);
|
|
66
|
+
return mat3(t, b, n);
|
|
67
|
+
}
|
|
68
|
+
float pdlAge() { return (uPdlProgress - PdlBirthOf(PdlField(PdlNorm(aPdlP)))) / uPdlLife; }
|
|
69
|
+
// landing time (in age units) for a flake falling from its height at a steady speed
|
|
70
|
+
float pdlLand() { return 0.14 + 0.8 * clamp((aPdlP.y - uPdlMin.y) / max(uPdlSize.y, 1e-4), 0.0, 1.0); }
|
|
71
|
+
mat3 pdlRot(float a) {
|
|
72
|
+
float land = pdlLand();
|
|
73
|
+
float af = min(a, land);
|
|
74
|
+
float hinge = smoothstep(0.0, 0.14, a) * 1.1; // peel up off the surface
|
|
75
|
+
float tumble = max(af - 0.14, 0.0) * (4.0 + 5.0 * aPdlR.w) + sin(af * 14.0 + aPdlR.x * 6.28) * 0.6;
|
|
76
|
+
mat3 inAir = pdlFrame() * fxRot(vec3(1.0, 0.0, 0.0), hinge) * fxRot(normalize(aPdlR.xyz - 0.5 + vec3(1e-3)), tumble);
|
|
77
|
+
// after landing: lie flat, turned at random
|
|
78
|
+
mat3 lying = fxRot(vec3(0.0, 1.0, 0.0), aPdlR.y * 6.28) * mat3(1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);
|
|
79
|
+
float settle = smoothstep(land, land + 0.06, a);
|
|
80
|
+
return mat3(mix(inAir[0], lying[0], settle), mix(inAir[1], lying[1], settle), mix(inAir[2], lying[2], settle));
|
|
81
|
+
}`,
|
|
82
|
+
normal: `{ objectNormal = pdlRot(pdlAge()) * objectNormal; }`,
|
|
83
|
+
vertex: /* glsl */ `
|
|
84
|
+
{
|
|
85
|
+
float a = pdlAge();
|
|
86
|
+
if (a <= 0.0) { transformed *= 0.0; }
|
|
87
|
+
else {
|
|
88
|
+
a = min(a, 1.0);
|
|
89
|
+
float E = uPdlExtent;
|
|
90
|
+
float land = pdlLand();
|
|
91
|
+
float af = min(a, land);
|
|
92
|
+
float fall = max(af - 0.14, 0.0) / max(land - 0.14, 1e-3); // 0 → 1 while airborne
|
|
93
|
+
vec3 C = uPdlMin + uPdlSize * 0.5;
|
|
94
|
+
vec2 away = normalize(aPdlP.xz - C.xz + (aPdlR.xy - 0.5) * 0.3 + vec2(1e-4));
|
|
95
|
+
float sway = sin(af * 11.0 + aPdlR.z * 6.28) * 0.07 * E * uPdlDrift * fall;
|
|
96
|
+
vec3 off = aPdlN * (0.03 * E) * smoothstep(0.0, 0.14, a);
|
|
97
|
+
off.xz += away * (0.06 + 0.14 * aPdlR.x) * E * uPdlDrift * fall + vec2(sway, sway * 0.6);
|
|
98
|
+
off.y += (uPdlMin.y + 0.002 * E * (1.0 + aPdlR.w) - aPdlP.y) * fall;
|
|
99
|
+
transformed = pdlRot(a) * transformed + off;
|
|
100
|
+
}
|
|
101
|
+
}`,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
st = { field, life, drift, mesh, mats: new Set() };
|
|
105
|
+
const own = st;
|
|
106
|
+
const layer = surfaceLayer(P, field, 'tint');
|
|
107
|
+
forEachMeshMaterial(target, (mat, m) => {
|
|
108
|
+
if (m.userData?.__opFxHelper)
|
|
109
|
+
return;
|
|
110
|
+
if (addLayer(mat, KEY, layer))
|
|
111
|
+
own.mats.add(mat);
|
|
112
|
+
});
|
|
113
|
+
target.userData[STATE] = st;
|
|
114
|
+
}
|
|
115
|
+
const s = st;
|
|
116
|
+
setFieldParams(s.field, p, target, ctx);
|
|
117
|
+
s.drift.value = Number(p.drift);
|
|
118
|
+
return runProgress(target, s.field, 1 + LIFE, {
|
|
119
|
+
duration: Number(p.duration), ease: 'none',
|
|
120
|
+
onComplete: () => hideMeshes(target, KEY, true),
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
revert(target, p) {
|
|
124
|
+
const s = target.userData[STATE];
|
|
125
|
+
if (!s)
|
|
126
|
+
return;
|
|
127
|
+
hideMeshes(target, KEY, false);
|
|
128
|
+
return runProgress(target, s.field, 0, {
|
|
129
|
+
duration: Number(p.duration), ease: 'none',
|
|
130
|
+
onComplete: () => {
|
|
131
|
+
s.mats.forEach(m => removeLayer(m, KEY));
|
|
132
|
+
disposeFxInstances(s.mesh);
|
|
133
|
+
delete target.userData[STATE];
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"petrify.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/petrify.ts"],"names":[],"mappings":";AAqDA,wBA0CG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Petrify — the object turns to weathered stone along the front, like a statue:
|
|
2
|
+
// the base colour becomes granite (grain, speckle, darker crevices from low-
|
|
3
|
+
// frequency noise, a trace of the original colour's value kept so the texture
|
|
4
|
+
// still reads), and roughness goes to stone — all BEFORE lighting, so the scene
|
|
5
|
+
// lights it as stone. A fine grey line marks the spreading front. A state, not
|
|
6
|
+
// an exit: it stays stone while on; reverting brings it back to life.
|
|
7
|
+
import { Color } from 'three';
|
|
8
|
+
import { defineOperation } from '../types.js';
|
|
9
|
+
import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
|
|
10
|
+
import { DIRECTION_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, runProgress, setFieldParams } from './transitionField.js';
|
|
11
|
+
const P = 'Stn';
|
|
12
|
+
const KEY = 'petrify';
|
|
13
|
+
const STATE = '__opPetrify';
|
|
14
|
+
function layerFor(st) {
|
|
15
|
+
const amount = /* glsl */ `
|
|
16
|
+
float stnD = StnThreshold() - StnField(vStnQ);
|
|
17
|
+
float st = smoothstep(0.0, uStnEdgeWidth, stnD);`;
|
|
18
|
+
return {
|
|
19
|
+
uniforms: { ...fieldUniforms(P, st.field), uStnStone: st.stone },
|
|
20
|
+
common: `varying vec3 vStnQ;\nvarying vec3 vStnR;\n${fieldGlsl(P)}`,
|
|
21
|
+
vertex: /* glsl */ `
|
|
22
|
+
vStnR = (uStnRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
|
|
23
|
+
vStnQ = StnNorm(vStnR);`,
|
|
24
|
+
diffuse: /* glsl */ `
|
|
25
|
+
{
|
|
26
|
+
${amount}
|
|
27
|
+
vec3 p = vStnR / uStnExtent;
|
|
28
|
+
float grain = fxFbm(p * 26.0);
|
|
29
|
+
float speck = step(0.83, fxNoise(p * 140.0)) * 0.35 - step(0.9, fxNoise(p * 90.0 + 7.0)) * 0.25;
|
|
30
|
+
float crevice = smoothstep(0.25, 0.75, fxFbm(p * 5.0));
|
|
31
|
+
float luma = dot(diffuseColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
32
|
+
vec3 stone = uStnStone * (0.62 + 0.55 * grain + speck) * mix(0.6, 1.1, crevice) * (0.75 + 0.5 * luma);
|
|
33
|
+
diffuseColor.rgb = mix(diffuseColor.rgb, stone, st);
|
|
34
|
+
}`,
|
|
35
|
+
material: /* glsl */ `
|
|
36
|
+
{
|
|
37
|
+
${amount}
|
|
38
|
+
roughnessFactor = mix(roughnessFactor, 0.93, st);
|
|
39
|
+
metalnessFactor = mix(metalnessFactor, 0.0, st);
|
|
40
|
+
}`,
|
|
41
|
+
fragment: /* glsl */ `
|
|
42
|
+
{
|
|
43
|
+
${amount}
|
|
44
|
+
float line = exp(-abs(stnD) / 0.01) * step(0.0001, uStnProgress) * step(uStnProgress, 0.9999);
|
|
45
|
+
outgoingLight = mix(outgoingLight, outgoingLight * 0.35, line * 0.8);
|
|
46
|
+
}`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export default defineOperation({
|
|
50
|
+
value: 'petrify',
|
|
51
|
+
label: 'Petrify',
|
|
52
|
+
description: 'Turn the targets to weathered stone, like a statue — reverting brings them back',
|
|
53
|
+
channel: 'visual',
|
|
54
|
+
multi: true,
|
|
55
|
+
toggles: true,
|
|
56
|
+
usableIn: ['interaction', 'action', 'object'],
|
|
57
|
+
stack: 'surface',
|
|
58
|
+
params: {
|
|
59
|
+
direction: { type: 'select', label: 'Direction', default: 'up', options: DIRECTION_OPTIONS },
|
|
60
|
+
stone: { type: 'color', label: 'Stone', default: '#9a948c' },
|
|
61
|
+
scale: { type: 'number', label: 'Front pattern', default: 3, min: 0.5, max: 12, step: 0.1 },
|
|
62
|
+
duration: { type: 'number', label: 'Duration', default: 2.4, min: 0.3, max: 12, step: 0.1, unit: 's' },
|
|
63
|
+
},
|
|
64
|
+
apply(target, p, ctx) {
|
|
65
|
+
let st = target.userData[STATE];
|
|
66
|
+
if (!st) {
|
|
67
|
+
const field = createFieldState(target);
|
|
68
|
+
field.edgeWidth.value = 0.035;
|
|
69
|
+
st = { field, stone: { value: new Color() }, mats: new Set() };
|
|
70
|
+
const own = st;
|
|
71
|
+
const layer = layerFor(own);
|
|
72
|
+
forEachMeshMaterial(target, (mat, mesh) => {
|
|
73
|
+
if (mesh.userData?.__opFxHelper)
|
|
74
|
+
return;
|
|
75
|
+
if (addLayer(mat, KEY, layer))
|
|
76
|
+
own.mats.add(mat);
|
|
77
|
+
});
|
|
78
|
+
target.userData[STATE] = st;
|
|
79
|
+
}
|
|
80
|
+
const s = st;
|
|
81
|
+
setFieldParams(s.field, p, target, ctx);
|
|
82
|
+
s.stone.value.set(String(p.stone));
|
|
83
|
+
return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'power1.inOut', hold: true });
|
|
84
|
+
},
|
|
85
|
+
revert(target, p) {
|
|
86
|
+
const s = target.userData[STATE];
|
|
87
|
+
if (!s)
|
|
88
|
+
return;
|
|
89
|
+
return runProgress(target, s.field, 0, {
|
|
90
|
+
duration: Number(p.duration), ease: 'power1.inOut',
|
|
91
|
+
onComplete: () => { s.mats.forEach(m => removeLayer(m, KEY)); delete target.userData[STATE]; },
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/portal.ts"],"names":[],"mappings":";AAoIA,wBAsFG"}
|