@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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import * as THREE from 'three';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
3
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* An iridescent shell around the host, displaced by real spherical harmonics
|
|
9
11
|
* up to l = 4 whose weights drift slowly. The colour is thin-film
|
|
@@ -158,10 +160,27 @@ const frag = /* glsl */ `
|
|
|
158
160
|
gl_FragColor = vec4(col * uIntensity, a);
|
|
159
161
|
}
|
|
160
162
|
`;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
/** Nothing rebuilds the shell: the vertex shader displaces a unit sphere. */
|
|
164
|
+
const STRUCTURAL = [];
|
|
165
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what applyConfig pushes. */
|
|
166
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.harmonicShell.map((p) => p.value));
|
|
167
|
+
/** The single push point: every config knob reaches its uniform here. */
|
|
168
|
+
function applyConfig(u, c, bound) {
|
|
169
|
+
u.uSpeed.value = c.speed;
|
|
170
|
+
u.uIntensity.value = c.intensity;
|
|
171
|
+
u.uOpacity.value = c.opacity;
|
|
172
|
+
u.uColor.value.set(c.color);
|
|
173
|
+
u.uRimColor.value.set(c.rimColor);
|
|
174
|
+
u.uAmplitude.value = c.amplitude;
|
|
175
|
+
u.uBound.value = bound;
|
|
176
|
+
u.uSizeMultiplier.value = c.sizeMultiplier;
|
|
177
|
+
u.uFilmThickness.value = c.filmThickness;
|
|
178
|
+
u.uNodalLines.value = c.nodalLines;
|
|
179
|
+
u.uDegree.value = c.degree;
|
|
180
|
+
}
|
|
181
|
+
const HarmonicShellEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
182
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.harmonicShell, config), [config]);
|
|
163
183
|
const rootRef = useRef(null);
|
|
164
|
-
const animCache = useRef({});
|
|
165
184
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
166
185
|
const state = useMemo(createHarmonicState, []);
|
|
167
186
|
const uniforms = useMemo(() => ({
|
|
@@ -181,28 +200,17 @@ const HarmonicShellEffect = ({ boundingRadius, config, animations, onObjectReady
|
|
|
181
200
|
}), []);
|
|
182
201
|
const material = useMemo(() => new THREE.ShaderMaterial({ vertexShader: vert, fragmentShader: frag, uniforms, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending }), [uniforms]);
|
|
183
202
|
useEffect(() => () => material.dispose(), [material]);
|
|
184
|
-
const materials = useMemo(() => [material], [material]);
|
|
185
203
|
// the vertex shader displaces a unit sphere, so the mesh never needs rebuilding
|
|
186
204
|
const geometry = useMemo(() => new THREE.SphereGeometry(1, 192, 128), []);
|
|
187
205
|
useEffect(() => () => geometry.dispose(), [geometry]);
|
|
188
|
-
|
|
189
|
-
uniforms
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
uniforms.uRimColor.value.set(rimColor);
|
|
194
|
-
uniforms.uAmplitude.value = amplitude;
|
|
195
|
-
uniforms.uBound.value = boundingRadius;
|
|
196
|
-
uniforms.uSizeMultiplier.value = sizeMultiplier;
|
|
197
|
-
uniforms.uFilmThickness.value = filmThickness;
|
|
198
|
-
uniforms.uNodalLines.value = nodalLines;
|
|
199
|
-
uniforms.uDegree.value = degree;
|
|
200
|
-
}, [uniforms, speed, intensity, opacity, color, rimColor, amplitude, boundingRadius, sizeMultiplier, filmThickness, nodalLines, degree]);
|
|
206
|
+
const push = useCallback((merged) => {
|
|
207
|
+
applyConfig(uniforms, merged, boundingRadius);
|
|
208
|
+
}, [uniforms, boundingRadius]);
|
|
209
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
210
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
201
211
|
useFrame((_, delta) => {
|
|
202
212
|
uniforms.uTime.value += delta * uniforms.uSpeed.value;
|
|
203
213
|
updateHarmonicWeights(state, uniforms.uW.value, uniforms.uTime.value, uniforms.uDegree.value, delta);
|
|
204
|
-
if (animations?.length)
|
|
205
|
-
applyGenerativeAnimations(materials, animations, animCache.current, Date.now(), false);
|
|
206
214
|
});
|
|
207
215
|
return (_jsx("group", { ref: rootRef, children: _jsx("mesh", { geometry: geometry, material: material }) }));
|
|
208
216
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { HologramConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
2
|
+
import type { HologramConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
-
interface HologramEffectProps extends ObjectReadyProps {
|
|
4
|
+
export interface HologramEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: HologramConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
}
|
|
9
14
|
declare const HologramEffect: React.FC<HologramEffectProps>;
|
|
10
15
|
export default HologramEffect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HologramEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/HologramEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AA4GD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmEjD,CAAC;AACF,eAAe,cAAc,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
5
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
// Single rich shader handles scanlines, grid, RGB aberration, interference fringes, flicker
|
|
8
10
|
const vertexShader = /* glsl */ `
|
|
9
11
|
varying vec2 vUv;
|
|
@@ -15,6 +17,7 @@ const vertexShader = /* glsl */ `
|
|
|
15
17
|
const fragmentShader = /* glsl */ `
|
|
16
18
|
uniform float u_time;
|
|
17
19
|
uniform float uScanSpeed;
|
|
20
|
+
uniform float uScanPhase; // integrated on the CPU: scan speed changes never jump
|
|
18
21
|
uniform float uScanlineCount;
|
|
19
22
|
uniform vec3 uColor;
|
|
20
23
|
uniform float uOpacity;
|
|
@@ -32,7 +35,7 @@ const fragmentShader = /* glsl */ `
|
|
|
32
35
|
|
|
33
36
|
// Scanline sample at a specific UV (shared logic, called 3× for RGB split)
|
|
34
37
|
float scanSample(vec2 uv, float t) {
|
|
35
|
-
return step(0.45, fract(uv.y * uScanlineCount +
|
|
38
|
+
return step(0.45, fract(uv.y * uScanlineCount + uScanPhase));
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
void main() {
|
|
@@ -86,17 +89,34 @@ const fragmentShader = /* glsl */ `
|
|
|
86
89
|
gl_FragColor = vec4(hologramColor + uColor * fringe, intensity * uOpacity);
|
|
87
90
|
}
|
|
88
91
|
`;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
/** Knobs that rebuild the object (one plane per scanline layer): commit only, never live. */
|
|
93
|
+
const STRUCTURAL = ['scanlineCount'];
|
|
94
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
95
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.hologram.map((p) => p.value));
|
|
96
|
+
const _color = new THREE.Color();
|
|
97
|
+
/** The single push point: every config knob reaches its uniform here. */
|
|
98
|
+
function applyConfig(materials, c) {
|
|
99
|
+
_color.set(c.scanColor);
|
|
100
|
+
for (const m of materials) {
|
|
101
|
+
const u = m.uniforms;
|
|
102
|
+
u.uScanSpeed.value = c.scanSpeed * c.speed;
|
|
103
|
+
u.uColor.value.set(_color.r, _color.g, _color.b);
|
|
104
|
+
u.uOpacity.value = c.opacity * c.intensity;
|
|
105
|
+
u.uFlickerAmount.value = c.flickerAmount;
|
|
106
|
+
u.uGridEnabled.value = c.gridEnabled ? 1.0 : 0.0;
|
|
107
|
+
u.uIntensity.value = c.intensity;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const HologramEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
111
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.hologram, config), [config]);
|
|
112
|
+
const { scanlineCount } = cfg;
|
|
92
113
|
const rootRef = useRef(null);
|
|
93
114
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
94
115
|
const meshRefs = useRef([]);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// One material per plane — each has its own uPlaneY so the assembly sweeps correctly
|
|
116
|
+
// the knobs read per frame (glitchEnabled), from the last merged config
|
|
117
|
+
const cur = useRef(cfg);
|
|
118
|
+
// One material per plane - each has its own uPlaneY so the assembly sweeps correctly.
|
|
119
|
+
// Built once per plane count; every other knob is pushed into the uniforms.
|
|
100
120
|
const materials = useMemo(() => Array.from({ length: scanlineCount }, (_, i) => {
|
|
101
121
|
const planeY = (i / Math.max(scanlineCount - 1, 1)) * 2 - 1; // -1..+1
|
|
102
122
|
return new THREE.ShaderMaterial({
|
|
@@ -104,39 +124,48 @@ const HologramEffect = ({ boundingRadius, config, animations, onObjectReady, onO
|
|
|
104
124
|
fragmentShader,
|
|
105
125
|
uniforms: {
|
|
106
126
|
u_time: { value: 0 },
|
|
107
|
-
|
|
127
|
+
uScanPhase: { value: 0 },
|
|
128
|
+
uScanSpeed: { value: 1 },
|
|
108
129
|
uScanlineCount: { value: 5.0 + i * 0.3 }, // slight variation per plane
|
|
109
|
-
uColor: { value:
|
|
110
|
-
uOpacity: { value:
|
|
111
|
-
uFlickerAmount: { value:
|
|
112
|
-
uGridEnabled: { value:
|
|
130
|
+
uColor: { value: new THREE.Vector3() },
|
|
131
|
+
uOpacity: { value: 1 },
|
|
132
|
+
uFlickerAmount: { value: 0 },
|
|
133
|
+
uGridEnabled: { value: 1 },
|
|
113
134
|
uGlitchOffset: { value: 0 },
|
|
114
135
|
uAberration: { value: 0.012 },
|
|
115
136
|
uPlaneY: { value: planeY },
|
|
116
|
-
uIntensity: { value:
|
|
137
|
+
uIntensity: { value: 1 },
|
|
117
138
|
},
|
|
118
139
|
transparent: true,
|
|
119
140
|
depthWrite: false,
|
|
120
141
|
blending: THREE.AdditiveBlending,
|
|
121
142
|
side: THREE.DoubleSide,
|
|
122
143
|
});
|
|
123
|
-
}), [scanlineCount
|
|
144
|
+
}), [scanlineCount]);
|
|
145
|
+
useEffect(() => () => materials.forEach((m) => m.dispose()), [materials]);
|
|
146
|
+
const push = useCallback((merged) => {
|
|
147
|
+
cur.current = merged;
|
|
148
|
+
applyConfig(materials, merged);
|
|
149
|
+
}, [materials]);
|
|
150
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
151
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
124
152
|
const planeSize = boundingRadius * 2.3;
|
|
125
153
|
const stepY = (boundingRadius * 2.5) / Math.max(scanlineCount - 1, 1);
|
|
126
|
-
useFrame((state) => {
|
|
154
|
+
useFrame((state, delta) => {
|
|
127
155
|
const t = state.clock.getElapsedTime();
|
|
156
|
+
const dt = Math.min(delta, 0.1);
|
|
157
|
+
const glitch = !!cur.current.glitchEnabled;
|
|
128
158
|
materials.forEach((mat, i) => {
|
|
129
159
|
mat.uniforms.u_time.value = t + i * 0.04;
|
|
130
|
-
|
|
160
|
+
// integrated, so changing the scan speed never makes the bands jump
|
|
161
|
+
mat.uniforms.uScanPhase.value += dt * mat.uniforms.uScanSpeed.value;
|
|
162
|
+
if (glitch && Math.random() > 0.985) {
|
|
131
163
|
mat.uniforms.uGlitchOffset.value = (Math.random() - 0.5) * 0.06;
|
|
132
164
|
}
|
|
133
165
|
else {
|
|
134
166
|
mat.uniforms.uGlitchOffset.value *= 0.80;
|
|
135
167
|
}
|
|
136
168
|
});
|
|
137
|
-
if (animations?.length) {
|
|
138
|
-
applyGenerativeAnimations(materials, animations, startValuesCacheRef.current, Date.now(), false);
|
|
139
|
-
}
|
|
140
169
|
});
|
|
141
170
|
return (_jsx("group", { ref: rootRef, children: Array.from({ length: scanlineCount }, (_, i) => {
|
|
142
171
|
const y = -boundingRadius * 1.25 + i * stepY;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { AnimationOptions,
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IceCrystalsConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface IceCrystalsEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: IceCrystalsConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
}
|
|
9
14
|
declare const IceCrystalsEffect: React.FC<IceCrystalsEffectProps>;
|
|
10
15
|
export default IceCrystalsEffect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IceCrystalsEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceCrystalsEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGlG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAmRD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmEvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import * as THREE from 'three';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
3
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
|
+
import { DEFAULT_GENERATIVE_EFFECTS, EFFECTS_ANIMATABLE } from "@3driseai/3drise-core";
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* Six-fold snow crystals growing as frost on the host.
|
|
9
11
|
*
|
|
@@ -79,6 +81,7 @@ const iceVert = /* glsl */ `
|
|
|
79
81
|
attribute vec3 aSeed; // x: shape seed, y: phase, z: size jitter
|
|
80
82
|
uniform float uTime;
|
|
81
83
|
uniform float uPulseSpeed;
|
|
84
|
+
uniform float uPulsePhase; // integrated on the CPU: pulse speed changes never jump
|
|
82
85
|
varying vec2 vUv;
|
|
83
86
|
varying vec3 vNormalW;
|
|
84
87
|
varying vec3 vViewW;
|
|
@@ -89,7 +92,7 @@ const iceVert = /* glsl */ `
|
|
|
89
92
|
vUv = uv * 2.0 - 1.0;
|
|
90
93
|
vSeed = aSeed;
|
|
91
94
|
// Grow, hold, sublimate. Diffusion-limited growth: radius ~ sqrt(t).
|
|
92
|
-
float cyc = fract(
|
|
95
|
+
float cyc = fract(uPulsePhase * 0.06 + aSeed.y);
|
|
93
96
|
float grow = sqrt(clamp(cyc / 0.55, 0.0, 1.0));
|
|
94
97
|
float fade = 1.0 - smoothstep(0.82, 1.0, cyc);
|
|
95
98
|
vGrowth = grow * fade;
|
|
@@ -249,15 +252,32 @@ const dustFrag = /* glsl */ `
|
|
|
249
252
|
gl_FragColor = vec4(mix(uIceColor, vec3(1.0), 0.6 + 0.4 * vGlint), a);
|
|
250
253
|
}
|
|
251
254
|
`;
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
/** Knobs that re-lay the crystals (count, length) or mount the frost layer: commit only. */
|
|
256
|
+
const STRUCTURAL = ['spikeCount', 'spikeLength', 'frostEnabled'];
|
|
257
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what applyConfig pushes. */
|
|
258
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.iceCrystals.map((p) => p.value));
|
|
259
|
+
/** The single push point: every config knob reaches its uniform here. */
|
|
260
|
+
function applyConfig(u, c, bound) {
|
|
261
|
+
u.uSpeed.value = c.speed;
|
|
262
|
+
u.uBound.value = bound;
|
|
263
|
+
u.uIntensity.value = c.intensity;
|
|
264
|
+
u.uOpacity.value = c.opacity;
|
|
265
|
+
u.uIceColor.value.set(c.iceColor);
|
|
266
|
+
u.uPulseSpeed.value = c.pulseSpeed;
|
|
267
|
+
u.uHabit.value = c.habit;
|
|
268
|
+
u.uBranches.value = c.branches;
|
|
269
|
+
u.uSparkle.value = c.sparkle;
|
|
270
|
+
}
|
|
271
|
+
const IceCrystalsEffect = ({ boundingRadius, config, id, keyframes, mouseMove, onObjectReady, onObjectDispose }) => {
|
|
272
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULT_GENERATIVE_EFFECTS.iceCrystals, config), [config]);
|
|
273
|
+
const { spikeCount, spikeLength, frostEnabled } = cfg;
|
|
254
274
|
const rootRef = useRef(null);
|
|
255
|
-
const animCache = useRef({});
|
|
256
275
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
257
276
|
// a standalone effect gets boundingRadius 1; guard against an empty host
|
|
258
277
|
const b = boundingRadius > 0 ? boundingRadius : 1;
|
|
259
278
|
const uniforms = useMemo(() => ({
|
|
260
279
|
uTime: { value: 0 },
|
|
280
|
+
uPulsePhase: { value: 0 },
|
|
261
281
|
uSpeed: { value: 1 },
|
|
262
282
|
uBound: { value: 1 },
|
|
263
283
|
uIntensity: { value: 1 },
|
|
@@ -291,21 +311,16 @@ const IceCrystalsEffect = ({ boundingRadius, config, animations, onObjectReady,
|
|
|
291
311
|
return g;
|
|
292
312
|
}, []);
|
|
293
313
|
useEffect(() => () => dustGeometry.dispose(), [dustGeometry]);
|
|
294
|
-
|
|
295
|
-
uniforms
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
uniforms.uIceColor.value.set(iceColor);
|
|
300
|
-
uniforms.uPulseSpeed.value = pulseSpeed;
|
|
301
|
-
uniforms.uHabit.value = habit;
|
|
302
|
-
uniforms.uBranches.value = branches;
|
|
303
|
-
uniforms.uSparkle.value = sparkle;
|
|
304
|
-
}, [uniforms, speed, b, intensity, opacity, iceColor, pulseSpeed, habit, branches, sparkle]);
|
|
314
|
+
const push = useCallback((merged) => {
|
|
315
|
+
applyConfig(uniforms, merged, b);
|
|
316
|
+
}, [uniforms, b]);
|
|
317
|
+
useLayoutEffect(() => { push(cfg); }, [push, cfg]);
|
|
318
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
305
319
|
useFrame((_, delta) => {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
320
|
+
const dt = delta * uniforms.uSpeed.value * 2;
|
|
321
|
+
uniforms.uTime.value += dt;
|
|
322
|
+
// the growth pulse is integrated, so changing its speed never makes it jump
|
|
323
|
+
uniforms.uPulsePhase.value += dt * uniforms.uPulseSpeed.value;
|
|
309
324
|
});
|
|
310
325
|
return (_jsxs("group", { ref: rootRef, children: [_jsx("primitive", { object: crystals }), _jsx("points", { geometry: dustGeometry, material: materials[1], visible: frostEnabled, frustumCulled: false })] }));
|
|
311
326
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnimationOptions, IceHaloConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import type { AnimationOptions, IceHaloConfig, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface IceHaloEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: IceHaloConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
/** True when the effect is attached to an object, so it can react to the host. */
|
|
9
14
|
hasHost?: boolean;
|
|
10
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IceHaloEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceHaloEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IceHaloEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/IceHaloEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI9F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAkSD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqC/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import {
|
|
5
|
+
import { EFFECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
6
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* Atmospheric ice optics around the object as a light source: a dispersed 22° halo, sun dogs, a parhelic circle and a light pillar. Use for cold skies, suns, lamps, magic light.
|
|
9
11
|
*
|
|
@@ -266,7 +268,7 @@ function build(u, c, bound, env) {
|
|
|
266
268
|
},
|
|
267
269
|
};
|
|
268
270
|
}
|
|
269
|
-
/**
|
|
271
|
+
/** A value for every knob: the base the renderer draws and keyframes interpolate from. */
|
|
270
272
|
const DEFAULTS = {
|
|
271
273
|
intensity: 1,
|
|
272
274
|
speed: 1,
|
|
@@ -279,27 +281,35 @@ const DEFAULTS = {
|
|
|
279
281
|
pillar: 0.45,
|
|
280
282
|
glare: 0.9,
|
|
281
283
|
};
|
|
282
|
-
|
|
284
|
+
/** Knobs that rebuild the object: they change on commit, never through the live path. */
|
|
285
|
+
const STRUCTURAL = [];
|
|
286
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
287
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.iceHalo.map((p) => p.value));
|
|
288
|
+
const IceHaloEffect = ({ boundingRadius, config, id, keyframes, mouseMove, hasHost = false, onObjectReady, onObjectDispose }) => {
|
|
283
289
|
const rootRef = useRef(null);
|
|
284
|
-
const animCache = useRef({});
|
|
285
290
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
286
291
|
// a standalone effect gets boundingRadius 1
|
|
287
292
|
const b = boundingRadius > 0 ? boundingRadius : 1;
|
|
288
|
-
const cfg = useMemo(() => (
|
|
293
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
|
|
289
294
|
const env = useMemo(() => ({ hasHost: hasHost }), [hasHost]);
|
|
290
295
|
// uniforms outlive the objects, so keyframe animations survive a rebuild
|
|
291
296
|
const uniforms = useMemo(() => createUniforms(), []);
|
|
292
297
|
// rebuilt only when the host size or a structural knob changes
|
|
293
|
-
const instance = useMemo(() => build(uniforms,
|
|
298
|
+
const instance = useMemo(() => build(uniforms, cfg, b, env), [uniforms, b, env]);
|
|
294
299
|
useEffect(() => () => instance.dispose(), [instance]);
|
|
295
300
|
useLayoutEffect(() => {
|
|
296
301
|
applyConfig(uniforms, cfg, b, env);
|
|
297
302
|
instance.apply(cfg);
|
|
298
303
|
}, [instance, uniforms, cfg, b, env]);
|
|
304
|
+
// Committed config + live drag + keyframes + pointer, merged into the one push point
|
|
305
|
+
// (the uniforms, then the instance's own cheap per-config step).
|
|
306
|
+
const push = useCallback((merged) => {
|
|
307
|
+
applyConfig(uniforms, merged, b, env);
|
|
308
|
+
instance.apply(merged);
|
|
309
|
+
}, [instance, uniforms, b, env]);
|
|
310
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
299
311
|
useFrame((state, delta) => {
|
|
300
312
|
instance.update(Math.min(delta, 0.1), state.camera);
|
|
301
|
-
if (animations?.length)
|
|
302
|
-
applyGenerativeAnimations(instance.materials, animations, animCache.current, Date.now(), false);
|
|
303
313
|
});
|
|
304
314
|
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
305
315
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnimationOptions, LichtenbergConfig } from '@3driseai/3drise-core';
|
|
2
|
+
import type { AnimationOptions, LichtenbergConfig, MouseMoveDomain } from '@3driseai/3drise-core';
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
4
|
export interface LichtenbergEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: LichtenbergConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
/** True when the effect is attached to an object, so it can react to the host. */
|
|
9
14
|
hasHost?: boolean;
|
|
10
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LichtenbergEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LichtenbergEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"LichtenbergEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LichtenbergEffect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIlG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAmdD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqCvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import {
|
|
5
|
+
import { EFFECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
6
|
+
import { withConfigDefaults } from '../../utils/configAnimations.js';
|
|
6
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useConfigDriver } from '../../hooks/useConfigDriver.js';
|
|
7
9
|
/**
|
|
8
10
|
* A Lichtenberg figure grown by the dielectric breakdown model: a glowing fern of electricity creeps over the surface, holds, fades and regrows. Use for energy, sci-fi, power and lightning scenes.
|
|
9
11
|
*
|
|
@@ -477,7 +479,7 @@ function build(u, c, bound, env) {
|
|
|
477
479
|
dispose() { geo.dispose(); quad.dispose(); mat.dispose(); rootMat.dispose(); },
|
|
478
480
|
};
|
|
479
481
|
}
|
|
480
|
-
/**
|
|
482
|
+
/** A value for every knob: the base the renderer draws and keyframes interpolate from. */
|
|
481
483
|
const DEFAULTS = {
|
|
482
484
|
intensity: 1,
|
|
483
485
|
speed: 1,
|
|
@@ -490,27 +492,35 @@ const DEFAULTS = {
|
|
|
490
492
|
pulse: 0.6,
|
|
491
493
|
coreColor: '#f2f6ff',
|
|
492
494
|
};
|
|
493
|
-
|
|
495
|
+
/** Knobs that rebuild the object: they change on commit, never through the live path. */
|
|
496
|
+
const STRUCTURAL = ['nodeCount', 'branching'];
|
|
497
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push point applies. */
|
|
498
|
+
const ANIMATABLE = new Set(EFFECTS_ANIMATABLE.lichtenberg.map((p) => p.value));
|
|
499
|
+
const LichtenbergEffect = ({ boundingRadius, config, id, keyframes, mouseMove, hasHost = false, onObjectReady, onObjectDispose }) => {
|
|
494
500
|
const rootRef = useRef(null);
|
|
495
|
-
const animCache = useRef({});
|
|
496
501
|
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
497
502
|
// a standalone effect gets boundingRadius 1
|
|
498
503
|
const b = boundingRadius > 0 ? boundingRadius : 1;
|
|
499
|
-
const cfg = useMemo(() => (
|
|
504
|
+
const cfg = useMemo(() => withConfigDefaults(DEFAULTS, config), [config]);
|
|
500
505
|
const env = useMemo(() => ({ hasHost: hasHost }), [hasHost]);
|
|
501
506
|
// uniforms outlive the objects, so keyframe animations survive a rebuild
|
|
502
507
|
const uniforms = useMemo(() => createUniforms(), []);
|
|
503
508
|
// rebuilt only when the host size or a structural knob changes
|
|
504
|
-
const instance = useMemo(() => build(uniforms,
|
|
509
|
+
const instance = useMemo(() => build(uniforms, cfg, b, env), [uniforms, b, env, cfg.nodeCount, cfg.branching]);
|
|
505
510
|
useEffect(() => () => instance.dispose(), [instance]);
|
|
506
511
|
useLayoutEffect(() => {
|
|
507
512
|
applyConfig(uniforms, cfg, b, env);
|
|
508
513
|
instance.apply(cfg);
|
|
509
514
|
}, [instance, uniforms, cfg, b, env]);
|
|
515
|
+
// Committed config + live drag + keyframes + pointer, merged into the one push point
|
|
516
|
+
// (the uniforms, then the instance's own cheap per-config step).
|
|
517
|
+
const push = useCallback((merged) => {
|
|
518
|
+
applyConfig(uniforms, merged, b, env);
|
|
519
|
+
instance.apply(merged);
|
|
520
|
+
}, [instance, uniforms, b, env]);
|
|
521
|
+
useConfigDriver({ rootRef, id, family: 'effects', base: cfg, structural: STRUCTURAL, allowed: ANIMATABLE, keyframes, mouseMove, push });
|
|
510
522
|
useFrame((state, delta) => {
|
|
511
523
|
instance.update(Math.min(delta, 0.1), state.camera);
|
|
512
|
-
if (animations?.length)
|
|
513
|
-
applyGenerativeAnimations(instance.materials, animations, animCache.current, Date.now(), false);
|
|
514
524
|
});
|
|
515
525
|
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
516
526
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { LightningConfig, AnimationOptions } from "@3driseai/3drise-core";
|
|
2
|
+
import type { LightningConfig, AnimationOptions, MouseMoveDomain } from "@3driseai/3drise-core";
|
|
3
3
|
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
-
interface LightningEffectProps extends ObjectReadyProps {
|
|
4
|
+
export interface LightningEffectProps extends ObjectReadyProps {
|
|
5
5
|
boundingRadius: number;
|
|
6
6
|
config: LightningConfig;
|
|
7
|
-
|
|
7
|
+
/** Scene object id of a standalone effect: the live-edit handle is found by it. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Keyframes on this effect's config knobs (animations.effect.animations). */
|
|
10
|
+
keyframes?: AnimationOptions[];
|
|
11
|
+
/** Pointer bindings on this effect's config knobs (mouseMove.effect). */
|
|
12
|
+
mouseMove?: MouseMoveDomain;
|
|
8
13
|
}
|
|
9
14
|
declare const LightningEffect: React.FC<LightningEffectProps>;
|
|
10
15
|
export default LightningEffect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LightningEffect.d.ts","sourceRoot":"","sources":["../../../src/components/effects/LightningEffect.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,yEAAyE;IACzE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAyED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmMnD,CAAC;AACF,eAAe,eAAe,CAAC"}
|