@3driseai/3drise-viewer 0.1.26 → 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 +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/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/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 +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.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/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.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/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/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/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 -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/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,207 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// particleShape — the shared `shape` config of shape-driven particle objects
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// config.shape is a mesh-builder geometry config ({ type, ...params }): the same object the
|
|
6
|
+
// core mesh builders take (createMeshByType), so meshes and particles share one builder. Only
|
|
7
|
+
// closed solids are particle shapes (PARTICLE_SHAPE_TYPES). The particle objects read the
|
|
8
|
+
// shape with its axis along y: the torus is laid flat and the tetrahedron stands vertex-up,
|
|
9
|
+
// so every shape has a top and a bottom.
|
|
10
|
+
//
|
|
11
|
+
// The shape keeps its real size: SHAPE_SCALE maps builder units to particle world units, so
|
|
12
|
+
// every parameter (a sphere's radius, a box's size) changes the object.
|
|
13
|
+
//
|
|
14
|
+
// Readers:
|
|
15
|
+
// radialMap / shapeField — R(theta, h): distance from the y axis to the outermost surface.
|
|
16
|
+
// sampleSurface — points spread evenly over the surface (area-weighted, stratified).
|
|
17
|
+
import * as THREE from 'three';
|
|
18
|
+
import { createMeshByType, PARTICLE_SHAPE_DEFAULTS, PARTICLE_SHAPE_TYPES } from '@3driseai/3drise-core';
|
|
19
|
+
/** Mesh-builder units -> particle world units (the builders' defaults come out ~1.6 wide). */
|
|
20
|
+
export const SHAPE_SCALE = 1.6;
|
|
21
|
+
/** The shape with every parameter filled in from the builder defaults (unknown types -> cone). */
|
|
22
|
+
export function shapeConfig(shape) {
|
|
23
|
+
const t = shape && PARTICLE_SHAPE_TYPES.includes(shape.type) ? shape.type : 'cone';
|
|
24
|
+
return { ...PARTICLE_SHAPE_DEFAULTS[t], ...(shape || {}), type: t };
|
|
25
|
+
}
|
|
26
|
+
/** Geometry of a shape, built by the core mesh builders, axis along y. The caller disposes it. */
|
|
27
|
+
export function shapeGeometry(shape) {
|
|
28
|
+
const c = shapeConfig(shape);
|
|
29
|
+
const built = createMeshByType({ ...c, id: 'particleShape', name: 'particleShape' });
|
|
30
|
+
let g;
|
|
31
|
+
if (built?.mesh?.geometry) {
|
|
32
|
+
g = built.mesh.geometry;
|
|
33
|
+
const m = built.mesh.material;
|
|
34
|
+
(Array.isArray(m) ? m : [m]).forEach((x) => x?.dispose());
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
g = new THREE.ConeGeometry(0.5, 1, 32);
|
|
38
|
+
}
|
|
39
|
+
if (c.type === 'torus')
|
|
40
|
+
g.rotateX(Math.PI / 2);
|
|
41
|
+
if (c.type === 'tetrahedron') {
|
|
42
|
+
g.applyQuaternion(new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(1, 1, 1).normalize(), new THREE.Vector3(0, 1, 0)));
|
|
43
|
+
}
|
|
44
|
+
return g;
|
|
45
|
+
}
|
|
46
|
+
/** Radial map of a closed shape: R(theta, h) = distance from the y axis to the outermost surface,
|
|
47
|
+
* on an nTh x nH grid (slice the triangles at each height, cast rays in the slice). The axis goes
|
|
48
|
+
* through the vertex centroid (a tetrahedron's footprint is not centred on its bounding box). */
|
|
49
|
+
export function radialMap(geometry, nTh = 96, nH = 96) {
|
|
50
|
+
const g = geometry.index ? geometry.toNonIndexed() : geometry;
|
|
51
|
+
g.computeBoundingBox();
|
|
52
|
+
const bb = g.boundingBox;
|
|
53
|
+
const P = g.attributes.position.array;
|
|
54
|
+
const nT = P.length / 9;
|
|
55
|
+
const ymin = bb.min.y, ymax = bb.max.y;
|
|
56
|
+
let cx = 0, cz = 0;
|
|
57
|
+
for (let k = 0; k < P.length; k += 3) {
|
|
58
|
+
cx += P[k];
|
|
59
|
+
cz += P[k + 2];
|
|
60
|
+
}
|
|
61
|
+
cx /= P.length / 3;
|
|
62
|
+
cz /= P.length / 3;
|
|
63
|
+
const R = new Float32Array(nTh * nH);
|
|
64
|
+
const seg = [];
|
|
65
|
+
const pts = [];
|
|
66
|
+
for (let j = 0; j < nH; j++) {
|
|
67
|
+
const h = ymin + ((j + 0.5) / nH) * (ymax - ymin);
|
|
68
|
+
seg.length = 0;
|
|
69
|
+
for (let t = 0; t < nT; t++) {
|
|
70
|
+
const o = t * 9;
|
|
71
|
+
const y0 = P[o + 1] - h, y1 = P[o + 4] - h, y2 = P[o + 7] - h;
|
|
72
|
+
if ((y0 > 0 && y1 > 0 && y2 > 0) || (y0 < 0 && y1 < 0 && y2 < 0))
|
|
73
|
+
continue;
|
|
74
|
+
pts.length = 0;
|
|
75
|
+
const edge = (a, b, ya, yb) => {
|
|
76
|
+
if ((ya > 0) === (yb > 0) || ya === yb)
|
|
77
|
+
return;
|
|
78
|
+
const s = ya / (ya - yb);
|
|
79
|
+
pts.push(P[o + a] + (P[o + b] - P[o + a]) * s - cx, P[o + a + 2] + (P[o + b + 2] - P[o + a + 2]) * s - cz);
|
|
80
|
+
};
|
|
81
|
+
edge(0, 3, y0, y1);
|
|
82
|
+
edge(3, 6, y1, y2);
|
|
83
|
+
edge(6, 0, y2, y0);
|
|
84
|
+
if (pts.length >= 4)
|
|
85
|
+
seg.push(pts[0], pts[1], pts[2], pts[3]);
|
|
86
|
+
}
|
|
87
|
+
for (let i = 0; i < nTh; i++) {
|
|
88
|
+
const th = (i / nTh) * Math.PI * 2, dx = Math.cos(th), dz = Math.sin(th);
|
|
89
|
+
let best = 0;
|
|
90
|
+
for (let s = 0; s < seg.length; s += 4) {
|
|
91
|
+
const ax = seg[s], az = seg[s + 1], ex = seg[s + 2] - ax, ez = seg[s + 3] - az;
|
|
92
|
+
const den = dx * ez - dz * ex;
|
|
93
|
+
if (Math.abs(den) < 1e-9)
|
|
94
|
+
continue;
|
|
95
|
+
const t = (ax * ez - az * ex) / den, u = (ax * dz - az * dx) / den;
|
|
96
|
+
if (t > best && u >= -1e-6 && u <= 1 + 1e-6)
|
|
97
|
+
best = t;
|
|
98
|
+
}
|
|
99
|
+
R[j * nTh + i] = best;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (g !== geometry)
|
|
103
|
+
g.dispose();
|
|
104
|
+
return { R, ymin, ymax, nTh, nH };
|
|
105
|
+
}
|
|
106
|
+
/** The shape as a surface field: R(theta, h) in world units (scale x builder units), centred on the
|
|
107
|
+
* origin. rAt(theta, h), rmAt(h) (mean radius), Y0..Y1, RW (widest mean), rMax (widest radius). */
|
|
108
|
+
export function shapeField(shape, scale = SHAPE_SCALE, nTh = 96, nH = 96) {
|
|
109
|
+
const geom = shapeGeometry(shape);
|
|
110
|
+
const map = radialMap(geom, nTh, nH);
|
|
111
|
+
geom.dispose();
|
|
112
|
+
const R = map.R;
|
|
113
|
+
let rMax = 0;
|
|
114
|
+
for (let k = 0; k < R.length; k++)
|
|
115
|
+
rMax = Math.max(rMax, R[k]);
|
|
116
|
+
const span = map.ymax - map.ymin;
|
|
117
|
+
const sc = scale;
|
|
118
|
+
for (let k = 0; k < R.length; k++)
|
|
119
|
+
R[k] *= sc;
|
|
120
|
+
const Y0 = -span * sc / 2, Y1 = span * sc / 2;
|
|
121
|
+
const Rm = new Float32Array(nH);
|
|
122
|
+
let RW = 0;
|
|
123
|
+
for (let j = 0; j < nH; j++) {
|
|
124
|
+
let s = 0;
|
|
125
|
+
for (let i = 0; i < nTh; i++)
|
|
126
|
+
s += R[j * nTh + i];
|
|
127
|
+
Rm[j] = s / nTh;
|
|
128
|
+
RW = Math.max(RW, Rm[j]);
|
|
129
|
+
}
|
|
130
|
+
const fy = (h) => {
|
|
131
|
+
const f = (h - Y0) / (Y1 - Y0) * nH - 0.5;
|
|
132
|
+
return f < 0 ? 0 : f > nH - 1.001 ? nH - 1.001 : f;
|
|
133
|
+
};
|
|
134
|
+
function rmAt(h) { const f = fy(h), j = f | 0, t = f - j; return Rm[j] + (Rm[j + 1] - Rm[j]) * t; }
|
|
135
|
+
function rAt(th, h) {
|
|
136
|
+
const f = fy(h);
|
|
137
|
+
let g = (th / (Math.PI * 2)) * nTh;
|
|
138
|
+
g -= Math.floor(g / nTh) * nTh;
|
|
139
|
+
const j = f | 0, t = f - j, i = g | 0, s = g - i, i1 = (i + 1) % nTh;
|
|
140
|
+
const a = R[j * nTh + i] + (R[j * nTh + i1] - R[j * nTh + i]) * s;
|
|
141
|
+
const b = R[(j + 1) * nTh + i] + (R[(j + 1) * nTh + i1] - R[(j + 1) * nTh + i]) * s;
|
|
142
|
+
return a + (b - a) * t;
|
|
143
|
+
}
|
|
144
|
+
return { rAt, rmAt, Y0, Y1, RW, rMax: rMax * sc, scale: sc };
|
|
145
|
+
}
|
|
146
|
+
/** n points spread evenly over the shape's surface (area-weighted, stratified, shuffled so any prefix
|
|
147
|
+
* covers the whole shape), in the same world frame as shapeField. Returns Float32Array n*3. */
|
|
148
|
+
export function sampleSurface(shape, n, rng, scale = SHAPE_SCALE) {
|
|
149
|
+
const geom = shapeGeometry(shape);
|
|
150
|
+
const g = geom.index ? geom.toNonIndexed() : geom;
|
|
151
|
+
g.computeBoundingBox();
|
|
152
|
+
const bb = g.boundingBox;
|
|
153
|
+
const P = g.attributes.position.array;
|
|
154
|
+
const nT = P.length / 9;
|
|
155
|
+
const cy = (bb.min.y + bb.max.y) / 2;
|
|
156
|
+
let cx = 0, cz = 0;
|
|
157
|
+
for (let k = 0; k < P.length; k += 3) {
|
|
158
|
+
cx += P[k];
|
|
159
|
+
cz += P[k + 2];
|
|
160
|
+
}
|
|
161
|
+
cx /= P.length / 3;
|
|
162
|
+
cz /= P.length / 3;
|
|
163
|
+
const sc = scale;
|
|
164
|
+
const cdf = new Float64Array(nT);
|
|
165
|
+
let acc = 0;
|
|
166
|
+
for (let t = 0; t < nT; t++) {
|
|
167
|
+
const o = t * 9;
|
|
168
|
+
const ax = P[o + 3] - P[o], ay = P[o + 4] - P[o + 1], az = P[o + 5] - P[o + 2];
|
|
169
|
+
const bx = P[o + 6] - P[o], by = P[o + 7] - P[o + 1], bz = P[o + 8] - P[o + 2];
|
|
170
|
+
acc += 0.5 * Math.hypot(ay * bz - az * by, az * bx - ax * bz, ax * by - ay * bx);
|
|
171
|
+
cdf[t] = acc;
|
|
172
|
+
}
|
|
173
|
+
const out = new Float32Array(n * 3);
|
|
174
|
+
for (let i = 0; i < n; i++) {
|
|
175
|
+
const u = ((i + rng()) / n) * acc;
|
|
176
|
+
let lo = 0, hi = nT - 1;
|
|
177
|
+
while (lo < hi) {
|
|
178
|
+
const m = (lo + hi) >> 1;
|
|
179
|
+
if (cdf[m] < u)
|
|
180
|
+
lo = m + 1;
|
|
181
|
+
else
|
|
182
|
+
hi = m;
|
|
183
|
+
}
|
|
184
|
+
let a = rng(), b = rng();
|
|
185
|
+
if (a + b > 1) {
|
|
186
|
+
a = 1 - a;
|
|
187
|
+
b = 1 - b;
|
|
188
|
+
}
|
|
189
|
+
const o = lo * 9;
|
|
190
|
+
for (let k = 0; k < 3; k++) {
|
|
191
|
+
const v = P[o + k] + (P[o + 3 + k] - P[o + k]) * a + (P[o + 6 + k] - P[o + k]) * b;
|
|
192
|
+
out[i * 3 + k] = (v - (k === 0 ? cx : k === 1 ? cy : cz)) * sc;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (g !== geom)
|
|
196
|
+
g.dispose();
|
|
197
|
+
geom.dispose();
|
|
198
|
+
for (let i = n - 1; i > 0; i--) {
|
|
199
|
+
const j = Math.floor(rng() * (i + 1));
|
|
200
|
+
for (let k = 0; k < 3; k++) {
|
|
201
|
+
const t = out[i * 3 + k];
|
|
202
|
+
out[i * 3 + k] = out[j * 3 + k];
|
|
203
|
+
out[j * 3 + k] = t;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return out;
|
|
207
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particleTrails.d.ts","sourceRoot":"","sources":["../../src/utils/particleTrails.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,eAAO,MAAM,WAAW,UAAsC,CAAC;AAK/D,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAKpC;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,MAAM,KAAA;;;YAES,CAAC,MAAM,CAAC,MAAM,CAAC,SAAU;YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAQ;;;;;;;;;;;;;;;;;;;;EAMjH;AAuID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"particleTrails.d.ts","sourceRoot":"","sources":["../../src/utils/particleTrails.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,eAAO,MAAM,WAAW,UAAsC,CAAC;AAK/D,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAKpC;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,MAAM,KAAA;;;YAES,CAAC,MAAM,CAAC,MAAM,CAAC,SAAU;YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAQ;;;;;;;;;;;;;;;;;;;;EAMjH;AAuID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA;;;;;;;EA+JxC"}
|
|
@@ -81,7 +81,7 @@ void main() {
|
|
|
81
81
|
}
|
|
82
82
|
`;
|
|
83
83
|
// shared tail of every trail vertex shader: shade, tint toward trailColor, size, project
|
|
84
|
-
function finish(sizePx) {
|
|
84
|
+
function finish(sizePx, alpha = 1) {
|
|
85
85
|
return /* glsl */ `
|
|
86
86
|
vec3 light = trailShade(p, f);
|
|
87
87
|
vCol = light * mix(vec3(1.0), uTrailColor * 1.25, smoothstep(0.0, 0.8, f)) * uIntensity;
|
|
@@ -89,7 +89,7 @@ function finish(sizePx) {
|
|
|
89
89
|
float mag;
|
|
90
90
|
vec3 mv = trailView(mvp.xyz, mag);
|
|
91
91
|
vCol *= mag;
|
|
92
|
-
vA = clamp(vA, 0.0, 1.0) * uOpacity * uTrailOpacity;
|
|
92
|
+
vA = clamp(vA * ${alpha.toFixed(3)}, 0.0, 1.0) * uOpacity * uTrailOpacity;
|
|
93
93
|
gl_PointSize = clamp(uSize * uViewH * ${sizePx.toFixed(4)} * (1.0 - 0.5 * f) * sqrt(mag) / -mv.z, 1.0, 40.0);
|
|
94
94
|
gl_Position = projectionMatrix * vec4(mv, 1.0);
|
|
95
95
|
`;
|
|
@@ -103,7 +103,7 @@ function setTemplate(g, tpl) {
|
|
|
103
103
|
}
|
|
104
104
|
const K_ON = '#define TRAIL_K aK\nattribute float aK;\n';
|
|
105
105
|
const K_OFF = '#define TRAIL_K 1.0\n';
|
|
106
|
-
function streakShader(glsl, sizePx, spacing, kdef) {
|
|
106
|
+
function streakShader(glsl, sizePx, spacing, kdef, alpha = 1) {
|
|
107
107
|
const S = 24;
|
|
108
108
|
return {
|
|
109
109
|
S,
|
|
@@ -121,12 +121,12 @@ void main() {
|
|
|
121
121
|
vec3 p = aP - dv * f;
|
|
122
122
|
float stepLen = len / ${(S - 1).toFixed(1)};
|
|
123
123
|
vA = 1.2 * pow(1.0 - f, 1.4) * clamp(stepLen / ${spacing.toFixed(4)}, 0.0, 1.0) * step(0.001, f);
|
|
124
|
-
${finish(sizePx)}
|
|
124
|
+
${finish(sizePx, alpha)}
|
|
125
125
|
}
|
|
126
126
|
`,
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
function cometShader(glsl, sizePx, spacing, kdef, SUB) {
|
|
129
|
+
function cometShader(glsl, sizePx, spacing, kdef, SUB, alpha = 1) {
|
|
130
130
|
const slots = Array.from({ length: SLOTS }, (_, i) => `attribute vec3 h${i};`).join('\n');
|
|
131
131
|
const pick = Array.from({ length: SLOTS }, (_, i) => ` ${i === 0 ? 'if' : 'else if'} (i == ${i}) return h${i};`).join('\n');
|
|
132
132
|
return /* glsl */ `
|
|
@@ -161,11 +161,11 @@ void main() {
|
|
|
161
161
|
float f = clamp(age / uTrailLength, 0.0, 1.0);
|
|
162
162
|
float stepLen = length(p2 - p1) / ${SUB.toFixed(1)};
|
|
163
163
|
vA = pow(1.0 - f, 1.3) * clamp(stepLen / ${spacing.toFixed(4)}, 0.0, 1.0) * step(0.0001, s);
|
|
164
|
-
${finish(sizePx)}
|
|
164
|
+
${finish(sizePx, alpha)}
|
|
165
165
|
}
|
|
166
166
|
`;
|
|
167
167
|
}
|
|
168
|
-
function echoShader(glsl, sizePx, kdef) {
|
|
168
|
+
function echoShader(glsl, sizePx, kdef, alpha = 1) {
|
|
169
169
|
return /* glsl */ `
|
|
170
170
|
${HEAD}
|
|
171
171
|
attribute vec4 aE0; // emitted position xyz, birth time
|
|
@@ -181,7 +181,7 @@ void main() {
|
|
|
181
181
|
vec3 p = aE0.xyz + aE1.xyz * uVelScale * carry * 0.6 + dir * 0.03 * sqrt(max(age, 0.0)) * uTrailLength;
|
|
182
182
|
vA = (f < 0.0 || f > 1.0) ? 0.0 : smoothstep(0.0, 0.08, f) * pow(1.0 - f, 2.0) * 0.55;
|
|
183
183
|
f = clamp(f, 0.0, 1.0);
|
|
184
|
-
${finish(sizePx * 1.4).replace('(1.0 - 0.5 * f)', '(1.0 + 1.2 * f)')}
|
|
184
|
+
${finish(sizePx * 1.4, alpha).replace('(1.0 - 0.5 * f)', '(1.0 + 1.2 * f)')}
|
|
185
185
|
}
|
|
186
186
|
`;
|
|
187
187
|
}
|
|
@@ -197,6 +197,8 @@ export function createCpuTrail(mode, opts) {
|
|
|
197
197
|
const kArr = opts.k || null;
|
|
198
198
|
const kdef = kArr ? K_ON : K_OFF;
|
|
199
199
|
const sizePx = opts.sizePx ?? 0.006;
|
|
200
|
+
// per-object alpha gain: colour saturates at 1 on 8-bit targets, so faint trails need alpha, not colour
|
|
201
|
+
const alpha = opts.alpha ?? 1;
|
|
200
202
|
const spacing = opts.spacing ?? 0.004;
|
|
201
203
|
const nSub = Math.max(1, Math.min(CAPS[mode], Math.round(n * Math.min(Math.max(u.uTrailShare.value, 0), 1))));
|
|
202
204
|
const object = new THREE.Group();
|
|
@@ -211,7 +213,7 @@ export function createCpuTrail(mode, opts) {
|
|
|
211
213
|
return m;
|
|
212
214
|
};
|
|
213
215
|
if (mode === 'streak') {
|
|
214
|
-
const sh = streakShader(glsl, sizePx, spacing, kdef);
|
|
216
|
+
const sh = streakShader(glsl, sizePx, spacing, kdef, alpha);
|
|
215
217
|
const g = new THREE.InstancedBufferGeometry();
|
|
216
218
|
const tpl = new Float32Array(sh.S);
|
|
217
219
|
for (let i = 0; i < sh.S; i++)
|
|
@@ -260,7 +262,7 @@ export function createCpuTrail(mode, opts) {
|
|
|
260
262
|
}
|
|
261
263
|
g.instanceCount = nSub;
|
|
262
264
|
geos.push(g);
|
|
263
|
-
const pts = new THREE.Points(g, mk(cometShader(glsl, sizePx, spacing, kdef, SUBn)));
|
|
265
|
+
const pts = new THREE.Points(g, mk(cometShader(glsl, sizePx, spacing, kdef, SUBn, alpha)));
|
|
264
266
|
pts.frustumCulled = false;
|
|
265
267
|
object.add(pts);
|
|
266
268
|
let head = 0, acc = 0, dirtyReset = false;
|
|
@@ -322,7 +324,7 @@ export function createCpuTrail(mode, opts) {
|
|
|
322
324
|
if (a2)
|
|
323
325
|
g.setAttribute('aK', a2);
|
|
324
326
|
geos.push(g);
|
|
325
|
-
const pts = new THREE.Points(g, mk(echoShader(glsl, sizePx, kdef)));
|
|
327
|
+
const pts = new THREE.Points(g, mk(echoShader(glsl, sizePx, kdef, alpha)));
|
|
326
328
|
pts.frustumCulled = false;
|
|
327
329
|
object.add(pts);
|
|
328
330
|
let write = 0, src = 0, emitAcc = 0;
|
|
@@ -355,21 +357,34 @@ export function createCpuTrail(mode, opts) {
|
|
|
355
357
|
}
|
|
356
358
|
// partial uploads (two ranges when the ring wraps)
|
|
357
359
|
const first = Math.min(k, P - start);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
+
// ranges add up until three uploads (and clears) them, so several updates between two renders all
|
|
361
|
+
// reach the GPU; a long backlog (the object was hidden) collapses into one full upload
|
|
362
|
+
let full = false;
|
|
363
|
+
if (a0.updateRanges.length > 32) {
|
|
364
|
+
a0.clearUpdateRanges();
|
|
365
|
+
a1.clearUpdateRanges();
|
|
366
|
+
if (a2)
|
|
367
|
+
a2.clearUpdateRanges();
|
|
368
|
+
full = true;
|
|
369
|
+
}
|
|
360
370
|
a0.addUpdateRange(start * 4, first * 4);
|
|
361
371
|
a1.addUpdateRange(start * 4, first * 4);
|
|
362
372
|
if (k > first) {
|
|
363
373
|
a0.addUpdateRange(0, (k - first) * 4);
|
|
364
374
|
a1.addUpdateRange(0, (k - first) * 4);
|
|
365
375
|
}
|
|
376
|
+
if (full) {
|
|
377
|
+
a0.clearUpdateRanges();
|
|
378
|
+
a1.clearUpdateRanges();
|
|
379
|
+
}
|
|
366
380
|
a0.needsUpdate = true;
|
|
367
381
|
a1.needsUpdate = true;
|
|
368
382
|
if (a2) {
|
|
369
|
-
a2.clearUpdateRanges();
|
|
370
383
|
a2.addUpdateRange(start, first);
|
|
371
384
|
if (k > first)
|
|
372
385
|
a2.addUpdateRange(0, k - first);
|
|
386
|
+
if (full)
|
|
387
|
+
a2.clearUpdateRanges();
|
|
373
388
|
a2.needsUpdate = true;
|
|
374
389
|
}
|
|
375
390
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import type { TerrainConfig, TerrainQualityConfig } from '
|
|
2
|
+
import type { TerrainConfig, TerrainQualityConfig } from '@3driseai/3drise-core';
|
|
3
3
|
import type { CloudSunState } from '../hooks/useCloudSun';
|
|
4
4
|
export declare function applyTerrainUniforms(material: THREE.ShaderMaterial, config: TerrainConfig, quality: TerrainQualityConfig): void;
|
|
5
5
|
export default applyTerrainUniforms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"terrainUniforms.d.ts","sourceRoot":"","sources":["../../src/utils/terrainUniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAoD1D,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC9B,IAAI,CAwDN;AAED,eAAe,oBAAoB,CAAC;AAiCpC,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CA4BlG;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAwC5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3driseai/3drise-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@3driseai/3drise-common": "^1.0.1",
|
|
42
|
-
"@3driseai/3drise-core": "^1.0.
|
|
42
|
+
"@3driseai/3drise-core": "^1.0.20"
|
|
43
43
|
}
|
|
44
44
|
}
|