@3driseai/3drise-viewer 0.1.27 → 0.1.29
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.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +13 -9
- package/dist/animationsV2/ClipsRuntime.d.ts +44 -3
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +173 -55
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +21 -5
- 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 +7 -3
- package/dist/animationsV2/sequenceUtils.d.ts +44 -6
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +58 -12
- package/dist/animationsV2/types.d.ts +22 -12
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.d.ts +35 -1
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +88 -17
- package/dist/components/AdvancedGrid.d.ts +1 -5
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +6 -35
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +9 -4
- package/dist/components/ApollonianGrid.d.ts +25 -0
- package/dist/components/ApollonianGrid.d.ts.map +1 -0
- package/dist/components/ApollonianGrid.js +55 -0
- package/dist/components/ChladniGrid.d.ts +1 -1
- package/dist/components/ChladniGrid.d.ts.map +1 -1
- package/dist/components/ChladniGrid.js +6 -35
- package/dist/components/CircuitGrid.d.ts +1 -1
- package/dist/components/CircuitGrid.d.ts.map +1 -1
- package/dist/components/CircuitGrid.js +6 -34
- package/dist/components/ConformalGrid.d.ts +25 -0
- package/dist/components/ConformalGrid.d.ts.map +1 -0
- package/dist/components/ConformalGrid.js +66 -0
- package/dist/components/ContourGrid.d.ts +1 -1
- package/dist/components/ContourGrid.d.ts.map +1 -1
- package/dist/components/ContourGrid.js +6 -34
- package/dist/components/CustomPrimitive.js +1 -1
- package/dist/components/EnvironmentObject.d.ts.map +1 -1
- package/dist/components/EnvironmentObject.js +9 -7
- package/dist/components/FlowNetGrid.d.ts +1 -1
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +6 -34
- package/dist/components/FractalGrid.d.ts +1 -1
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +6 -37
- package/dist/components/Galaxy.d.ts.map +1 -1
- package/dist/components/Galaxy.js +9 -23
- package/dist/components/GirihGrid.d.ts +1 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +6 -35
- package/dist/components/GravWaveGrid.d.ts +1 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +6 -35
- package/dist/components/GridsGenerator.d.ts +2 -2
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +21 -0
- package/dist/components/HexGrid.d.ts +1 -5
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +6 -36
- package/dist/components/HilbertGrid.d.ts +25 -0
- package/dist/components/HilbertGrid.d.ts.map +1 -0
- package/dist/components/HilbertGrid.js +66 -0
- package/dist/components/HyperbolicGrid.d.ts +1 -1
- package/dist/components/HyperbolicGrid.d.ts.map +1 -1
- package/dist/components/HyperbolicGrid.js +6 -34
- package/dist/components/LandObject.d.ts +9 -0
- package/dist/components/LandObject.d.ts.map +1 -0
- package/dist/components/LandObject.js +15 -0
- package/dist/components/LensingGrid.d.ts +25 -0
- package/dist/components/LensingGrid.d.ts.map +1 -0
- package/dist/components/LensingGrid.js +55 -0
- package/dist/components/LightsManager.d.ts.map +1 -1
- package/dist/components/LightsManager.js +8 -0
- package/dist/components/ModelBoundary.d.ts +2 -0
- package/dist/components/ModelBoundary.d.ts.map +1 -1
- package/dist/components/ModelBoundary.js +3 -0
- package/dist/components/ModelPrimitive.d.ts.map +1 -1
- package/dist/components/ModelPrimitive.js +6 -0
- package/dist/components/MoireGrid.d.ts +1 -1
- package/dist/components/MoireGrid.d.ts.map +1 -1
- package/dist/components/MoireGrid.js +6 -35
- package/dist/components/MoonDisc.d.ts +11 -0
- package/dist/components/MoonDisc.d.ts.map +1 -0
- package/dist/components/MoonDisc.js +128 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +15 -4
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +7 -5
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -0
- package/dist/components/ParastichyGrid.d.ts +25 -0
- package/dist/components/ParastichyGrid.d.ts.map +1 -0
- package/dist/components/ParastichyGrid.js +55 -0
- package/dist/components/PhyllotaxisGrid.d.ts +25 -0
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
- package/dist/components/PhyllotaxisGrid.js +66 -0
- package/dist/components/ProjectLoader.d.ts +5 -3
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +6 -3
- package/dist/components/QuasiGrid.d.ts +1 -1
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +6 -33
- package/dist/components/RadarGrid.d.ts +1 -1
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +6 -34
- package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +6 -35
- package/dist/components/SceneBuilder.d.ts +25 -3
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +68 -38
- package/dist/components/SkyController.d.ts +25 -1
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +189 -130
- package/dist/components/SkyMesh.d.ts.map +1 -1
- package/dist/components/SkyMesh.js +26 -1
- package/dist/components/SkyStars.d.ts +11 -0
- package/dist/components/SkyStars.d.ts.map +1 -0
- package/dist/components/SkyStars.js +187 -0
- package/dist/components/SkySystem.d.ts +3 -3
- package/dist/components/SkySystem.d.ts.map +1 -1
- package/dist/components/SkySystem.js +8 -2
- package/dist/components/Sun.d.ts +15 -1
- package/dist/components/Sun.d.ts.map +1 -1
- package/dist/components/Sun.js +64 -3
- package/dist/components/SunLight.d.ts +6 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +96 -44
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +2 -0
- package/dist/components/TextGenerator.d.ts +9 -0
- package/dist/components/TextGenerator.d.ts.map +1 -0
- package/dist/components/TextGenerator.js +29 -0
- package/dist/components/TruchetGrid.d.ts +25 -0
- package/dist/components/TruchetGrid.d.ts.map +1 -0
- package/dist/components/TruchetGrid.js +55 -0
- package/dist/components/VoronoiGrid.d.ts +1 -1
- package/dist/components/VoronoiGrid.d.ts.map +1 -1
- package/dist/components/VoronoiGrid.js +6 -33
- package/dist/components/WallpaperGrid.d.ts +1 -1
- package/dist/components/WallpaperGrid.d.ts.map +1 -1
- package/dist/components/WallpaperGrid.js +6 -35
- package/dist/components/environment/Rain.d.ts +15 -0
- package/dist/components/environment/Rain.d.ts.map +1 -0
- package/dist/components/environment/Rain.js +110 -0
- package/dist/components/environment/Rainbow.d.ts +20 -0
- package/dist/components/environment/Rainbow.d.ts.map +1 -0
- package/dist/components/environment/Rainbow.js +974 -0
- package/dist/components/environment/Sandstorm.d.ts +20 -0
- package/dist/components/environment/Sandstorm.d.ts.map +1 -0
- package/dist/components/environment/Sandstorm.js +776 -0
- package/dist/components/environment/Snow.d.ts +20 -0
- package/dist/components/environment/Snow.d.ts.map +1 -0
- package/dist/components/environment/Snow.js +609 -0
- package/dist/components/environment/Thunderstorm.d.ts +20 -0
- package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
- package/dist/components/environment/Thunderstorm.js +731 -0
- package/dist/components/environment/Tornado.d.ts +20 -0
- package/dist/components/environment/Tornado.d.ts.map +1 -0
- package/dist/components/environment/Tornado.js +762 -0
- package/dist/components/environment/index.d.ts +13 -0
- package/dist/components/environment/index.d.ts.map +1 -0
- package/dist/components/environment/index.js +7 -0
- package/dist/components/index.d.ts +24 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +15 -6
- package/dist/components/land/LandPatch.d.ts +15 -0
- package/dist/components/land/LandPatch.d.ts.map +1 -0
- package/dist/components/land/LandPatch.js +170 -0
- package/dist/components/land/index.d.ts +3 -0
- package/dist/components/land/index.d.ts.map +1 -0
- package/dist/components/land/index.js +1 -0
- package/dist/components/space/Earth.d.ts +16 -0
- package/dist/components/space/Earth.d.ts.map +1 -0
- package/dist/components/space/Earth.js +75 -0
- package/dist/components/space/ShootingStar.d.ts +21 -0
- package/dist/components/space/ShootingStar.d.ts.map +1 -0
- package/dist/components/space/ShootingStar.js +101 -0
- package/dist/components/space/ShootingStars.d.ts +16 -0
- package/dist/components/space/ShootingStars.d.ts.map +1 -0
- package/dist/components/space/ShootingStars.js +71 -0
- package/dist/components/space/SolarSystem.d.ts +16 -0
- package/dist/components/space/SolarSystem.d.ts.map +1 -0
- package/dist/components/space/SolarSystem.js +141 -0
- package/dist/components/space/Stars.d.ts +20 -0
- package/dist/components/space/Stars.d.ts.map +1 -0
- package/dist/components/space/Stars.js +160 -0
- package/dist/components/space/index.d.ts +11 -0
- package/dist/components/space/index.d.ts.map +1 -0
- package/dist/components/space/index.js +8 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +27 -3
- package/dist/components/terrain/types.d.ts +5 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/text/BurnAwayText.d.ts +15 -0
- package/dist/components/text/BurnAwayText.d.ts.map +1 -0
- package/dist/components/text/BurnAwayText.js +4 -0
- package/dist/components/text/ChalkboardText.d.ts +15 -0
- package/dist/components/text/ChalkboardText.d.ts.map +1 -0
- package/dist/components/text/ChalkboardText.js +4 -0
- package/dist/components/text/ConstellationText.d.ts +15 -0
- package/dist/components/text/ConstellationText.d.ts.map +1 -0
- package/dist/components/text/ConstellationText.js +4 -0
- package/dist/components/text/EmbroideryText.d.ts +15 -0
- package/dist/components/text/EmbroideryText.d.ts.map +1 -0
- package/dist/components/text/EmbroideryText.js +4 -0
- package/dist/components/text/FourierSketchText.d.ts +15 -0
- package/dist/components/text/FourierSketchText.d.ts.map +1 -0
- package/dist/components/text/FourierSketchText.js +4 -0
- package/dist/components/text/FrostGrowthText.d.ts +15 -0
- package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
- package/dist/components/text/FrostGrowthText.js +4 -0
- package/dist/components/text/HandwritingText.d.ts +15 -0
- package/dist/components/text/HandwritingText.d.ts.map +1 -0
- package/dist/components/text/HandwritingText.js +4 -0
- package/dist/components/text/InkBleedText.d.ts +15 -0
- package/dist/components/text/InkBleedText.d.ts.map +1 -0
- package/dist/components/text/InkBleedText.js +4 -0
- package/dist/components/text/LightPaintingText.d.ts +15 -0
- package/dist/components/text/LightPaintingText.d.ts.map +1 -0
- package/dist/components/text/LightPaintingText.js +4 -0
- package/dist/components/text/LiquidMetalText.d.ts +15 -0
- package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
- package/dist/components/text/LiquidMetalText.js +4 -0
- package/dist/components/text/NeonTubeText.d.ts +15 -0
- package/dist/components/text/NeonTubeText.d.ts.map +1 -0
- package/dist/components/text/NeonTubeText.js +4 -0
- package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
- package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
- package/dist/components/text/PlasmaDischargeText.js +4 -0
- package/dist/components/text/TextObjectView.d.ts +12 -0
- package/dist/components/text/TextObjectView.d.ts.map +1 -0
- package/dist/components/text/TextObjectView.js +11 -0
- package/dist/components/text/engine/fieldkit.d.ts +24 -0
- package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
- package/dist/components/text/engine/fieldkit.js +201 -0
- package/dist/components/text/engine/glyphs.d.ts +19 -0
- package/dist/components/text/engine/glyphs.d.ts.map +1 -0
- package/dist/components/text/engine/glyphs.js +269 -0
- package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
- package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
- package/dist/components/text/engine/looks/burnAway.js +593 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
- package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
- package/dist/components/text/engine/looks/chalkboard.js +426 -0
- package/dist/components/text/engine/looks/constellation.d.ts +111 -0
- package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
- package/dist/components/text/engine/looks/constellation.js +496 -0
- package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
- package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
- package/dist/components/text/engine/looks/embroidery.js +645 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
- package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
- package/dist/components/text/engine/looks/frostGrowth.js +727 -0
- package/dist/components/text/engine/looks/index.d.ts +2 -0
- package/dist/components/text/engine/looks/index.d.ts.map +1 -0
- package/dist/components/text/engine/looks/index.js +48 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
- package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
- package/dist/components/text/engine/looks/inkBleed.js +590 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
- package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
- package/dist/components/text/engine/looks/lightPainting.js +567 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
- package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
- package/dist/components/text/engine/looks/liquidMetal.js +655 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
- package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
- package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
- package/dist/components/text/engine/methods.d.ts +19 -0
- package/dist/components/text/engine/methods.d.ts.map +1 -0
- package/dist/components/text/engine/methods.js +126 -0
- package/dist/components/text/engine/playback.d.ts +40 -0
- package/dist/components/text/engine/playback.d.ts.map +1 -0
- package/dist/components/text/engine/playback.js +114 -0
- package/dist/components/text/engine/ribbon.d.ts +58 -0
- package/dist/components/text/engine/ribbon.d.ts.map +1 -0
- package/dist/components/text/engine/ribbon.js +250 -0
- package/dist/components/text/engine/variants.d.ts +159 -0
- package/dist/components/text/engine/variants.d.ts.map +1 -0
- package/dist/components/text/engine/variants.js +378 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
- package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
- package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
- package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.outline.js +4 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
- package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/caveat.strokes.js +4 -0
- package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
- package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.outline.js +4 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
- package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/courgette.strokes.js +4 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.outline.js +4 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
- package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
- package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.outline.js +4 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
- package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/handlee.strokes.js +4 -0
- package/dist/components/text/fonts/index.d.ts +5 -0
- package/dist/components/text/fonts/index.d.ts.map +1 -0
- package/dist/components/text/fonts/index.js +44 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.outline.js +4 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
- package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
- package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
- package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.outline.js +4 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kalam.strokes.js +4 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.outline.js +4 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
- package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/mynerve.strokes.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.outline.js +4 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
- package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/pacifico.strokes.js +4 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
- package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
- package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
- package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.outline.js +4 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
- package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/poppins.strokes.js +4 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.outline.js +4 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
- package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/satisfy.strokes.js +4 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.outline.js +4 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
- package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/sriracha.strokes.js +4 -0
- package/dist/components/text/index.d.ts +27 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +13 -0
- package/dist/components/text/useTextObject.d.ts +21 -0
- package/dist/components/text/useTextObject.d.ts.map +1 -0
- package/dist/components/text/useTextObject.js +118 -0
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -1
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +3 -1
- package/dist/components/water/types.d.ts +5 -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 +5 -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/useCloudSun.d.ts +9 -4
- package/dist/hooks/useCloudSun.d.ts.map +1 -1
- package/dist/hooks/useCloudSun.js +17 -7
- package/dist/hooks/useConfigLive.d.ts +3 -2
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +4 -10
- package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
- package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
- package/dist/hooks/useEnvironmentProbe.js +47 -8
- package/dist/hooks/useGridSurface.d.ts +3 -10
- package/dist/hooks/useGridSurface.d.ts.map +1 -1
- package/dist/hooks/useGridSurface.js +5 -31
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +19 -72
- package/dist/hooks/useLightConfig.d.ts +2 -1
- package/dist/hooks/useLightConfig.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.d.ts +6 -2
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +37 -2
- package/dist/hooks/useSkyLive.d.ts +23 -0
- package/dist/hooks/useSkyLive.d.ts.map +1 -0
- package/dist/hooks/useSkyLive.js +30 -0
- package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
- package/dist/hooks/useSkyUniforms.js +2 -10
- package/dist/hooks/useTerrainLive.d.ts +3 -1
- package/dist/hooks/useTerrainLive.d.ts.map +1 -1
- package/dist/hooks/useTerrainTextures.d.ts +38 -0
- package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
- package/dist/hooks/useTerrainTextures.js +149 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/operations/catalogue/blastOff.d.ts +3 -0
- package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
- package/dist/operations/catalogue/blastOff.js +118 -0
- package/dist/operations/catalogue/bounce.d.ts +3 -0
- package/dist/operations/catalogue/bounce.d.ts.map +1 -0
- package/dist/operations/catalogue/bounce.js +34 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
- package/dist/operations/catalogue/curlSmoke.js +3 -1
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
- package/dist/operations/catalogue/dissolve.js +2 -1
- package/dist/operations/catalogue/driftUp.d.ts +3 -0
- package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
- package/dist/operations/catalogue/driftUp.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
- package/dist/operations/catalogue/emberAsh.js +2 -1
- package/dist/operations/catalogue/flip.d.ts.map +1 -1
- package/dist/operations/catalogue/flip.js +19 -9
- package/dist/operations/catalogue/float.d.ts +3 -0
- package/dist/operations/catalogue/float.d.ts.map +1 -0
- package/dist/operations/catalogue/float.js +39 -0
- package/dist/operations/catalogue/flyBy.d.ts +3 -0
- package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
- package/dist/operations/catalogue/flyBy.js +79 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -1
- package/dist/operations/catalogue/frost.js +10 -3
- package/dist/operations/catalogue/grow.d.ts +3 -0
- package/dist/operations/catalogue/grow.d.ts.map +1 -0
- package/dist/operations/catalogue/grow.js +19 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -1
- package/dist/operations/catalogue/hologram.js +11 -5
- package/dist/operations/catalogue/jelly.d.ts.map +1 -1
- package/dist/operations/catalogue/jelly.js +18 -8
- package/dist/operations/catalogue/knockAway.d.ts +3 -0
- package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
- package/dist/operations/catalogue/knockAway.js +74 -0
- package/dist/operations/catalogue/leafFall.d.ts +3 -0
- package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
- package/dist/operations/catalogue/leafFall.js +74 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
- package/dist/operations/catalogue/lidarScan.js +4 -1
- package/dist/operations/catalogue/metalize.d.ts.map +1 -1
- package/dist/operations/catalogue/metalize.js +8 -2
- package/dist/operations/catalogue/motionTrail.d.ts +6 -0
- package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
- package/dist/operations/catalogue/motionTrail.js +221 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -1
- package/dist/operations/catalogue/petrify.js +9 -3
- package/dist/operations/catalogue/physicalExit.d.ts +55 -0
- package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalExit.js +165 -0
- package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
- package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalHeld.js +78 -0
- package/dist/operations/catalogue/physicalMix.d.ts +45 -0
- package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
- package/dist/operations/catalogue/physicalMix.js +144 -0
- package/dist/operations/catalogue/pop.d.ts +3 -0
- package/dist/operations/catalogue/pop.d.ts.map +1 -0
- package/dist/operations/catalogue/pop.js +44 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -1
- package/dist/operations/catalogue/print3d.js +5 -1
- package/dist/operations/catalogue/pulse.d.ts +3 -0
- package/dist/operations/catalogue/pulse.d.ts.map +1 -0
- package/dist/operations/catalogue/pulse.js +29 -0
- package/dist/operations/catalogue/restPose.d.ts +5 -7
- package/dist/operations/catalogue/restPose.d.ts.map +1 -1
- package/dist/operations/catalogue/restPose.js +18 -48
- package/dist/operations/catalogue/rotate.d.ts +3 -0
- package/dist/operations/catalogue/rotate.d.ts.map +1 -0
- package/dist/operations/catalogue/rotate.js +49 -0
- package/dist/operations/catalogue/shake.d.ts +3 -0
- package/dist/operations/catalogue/shake.d.ts.map +1 -0
- package/dist/operations/catalogue/shake.js +31 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -1
- package/dist/operations/catalogue/shatter.js +5 -1
- package/dist/operations/catalogue/slam.d.ts +3 -0
- package/dist/operations/catalogue/slam.d.ts.map +1 -0
- package/dist/operations/catalogue/slam.js +89 -0
- package/dist/operations/catalogue/slingshot.d.ts +3 -0
- package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
- package/dist/operations/catalogue/slingshot.js +88 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -1
- package/dist/operations/catalogue/spin.js +24 -13
- package/dist/operations/catalogue/sway.d.ts +3 -0
- package/dist/operations/catalogue/sway.d.ts.map +1 -0
- package/dist/operations/catalogue/sway.js +23 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -1
- package/dist/operations/catalogue/swirl.js +6 -5
- package/dist/operations/catalogue/trailCore.d.ts +89 -0
- package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
- package/dist/operations/catalogue/trailCore.js +190 -0
- package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
- package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
- package/dist/operations/catalogue/trailGhosts.js +179 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
- package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStampStyles.js +479 -0
- package/dist/operations/catalogue/trailStamps.d.ts +57 -0
- package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStamps.js +349 -0
- package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
- package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
- package/dist/operations/catalogue/trailStreaks.js +147 -0
- package/dist/operations/catalogue/transitionField.d.ts +30 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
- package/dist/operations/catalogue/transitionField.js +21 -0
- package/dist/operations/catalogue/turnAway.d.ts +3 -0
- package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
- package/dist/operations/catalogue/turnAway.js +54 -0
- package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
- package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
- package/dist/operations/catalogue/vortexDrain.js +68 -0
- package/dist/operations/catalogue/warp.d.ts +3 -0
- package/dist/operations/catalogue/warp.d.ts.map +1 -0
- package/dist/operations/catalogue/warp.js +73 -0
- package/dist/operations/catalogue/whoosh.d.ts +3 -0
- package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
- package/dist/operations/catalogue/whoosh.js +84 -0
- package/dist/operations/catalogue/wobble.d.ts +3 -0
- package/dist/operations/catalogue/wobble.d.ts.map +1 -0
- package/dist/operations/catalogue/wobble.js +23 -0
- package/dist/operations/clipPreview.d.ts +3 -0
- package/dist/operations/clipPreview.d.ts.map +1 -0
- package/dist/operations/clipPreview.js +20 -0
- package/dist/operations/groupFanout.d.ts +96 -0
- package/dist/operations/groupFanout.d.ts.map +1 -0
- package/dist/operations/groupFanout.js +365 -0
- package/dist/operations/groups.d.ts +20 -0
- package/dist/operations/groups.d.ts.map +1 -0
- package/dist/operations/groups.js +66 -0
- package/dist/operations/index.d.ts +5 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +5 -2
- package/dist/operations/objectEffects.d.ts +161 -6
- package/dist/operations/objectEffects.d.ts.map +1 -1
- package/dist/operations/objectEffects.js +1091 -17
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +24 -2
- package/dist/operations/runtime.d.ts +57 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +161 -18
- package/dist/operations/types.d.ts +60 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +5 -1
- package/dist/operations/useObjectEffectLayers.d.ts +2 -2
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
- package/dist/operations/useObjectEffectLayers.js +31 -10
- package/dist/operations/usePresentedVisibility.d.ts +10 -0
- package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
- package/dist/operations/usePresentedVisibility.js +53 -0
- package/dist/presets/terrainBiomes.d.ts +67 -0
- package/dist/presets/terrainBiomes.d.ts.map +1 -0
- package/dist/presets/terrainBiomes.js +294 -0
- package/dist/presets/terrainPresets.d.ts +6 -0
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/terrainPresets.js +26 -38
- package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
- package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
- package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
- package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
- package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
- package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +107 -8
- package/dist/triggers/engine.d.ts +44 -0
- package/dist/triggers/engine.d.ts.map +1 -0
- package/dist/triggers/engine.js +165 -0
- package/dist/triggers/hosts/actions.d.ts +8 -0
- package/dist/triggers/hosts/actions.d.ts.map +1 -0
- package/dist/triggers/hosts/actions.js +22 -0
- package/dist/triggers/hosts/interactions.d.ts +6 -0
- package/dist/triggers/hosts/interactions.d.ts.map +1 -0
- package/dist/triggers/hosts/interactions.js +4 -0
- package/dist/triggers/hosts/timelineCues.d.ts +2 -0
- package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
- package/dist/triggers/hosts/timelineCues.js +22 -0
- package/dist/triggers/index.d.ts +13 -0
- package/dist/triggers/index.d.ts.map +1 -0
- package/dist/triggers/index.js +9 -0
- package/dist/triggers/kinds/action.d.ts +2 -0
- package/dist/triggers/kinds/action.d.ts.map +1 -0
- package/dist/triggers/kinds/action.js +31 -0
- package/dist/triggers/kinds/animations.d.ts +2 -0
- package/dist/triggers/kinds/animations.d.ts.map +1 -0
- package/dist/triggers/kinds/animations.js +75 -0
- package/dist/triggers/kinds/effects.d.ts +2 -0
- package/dist/triggers/kinds/effects.d.ts.map +1 -0
- package/dist/triggers/kinds/effects.js +27 -0
- package/dist/triggers/kinds/index.d.ts +4 -0
- package/dist/triggers/kinds/index.d.ts.map +1 -0
- package/dist/triggers/kinds/index.js +4 -0
- package/dist/triggers/log.d.ts +21 -0
- package/dist/triggers/log.d.ts.map +1 -0
- package/dist/triggers/log.js +43 -0
- package/dist/triggers/readiness.d.ts +40 -0
- package/dist/triggers/readiness.d.ts.map +1 -0
- package/dist/triggers/readiness.js +158 -0
- package/dist/triggers/registry.d.ts +41 -0
- package/dist/triggers/registry.d.ts.map +1 -0
- package/dist/triggers/registry.js +7 -0
- package/dist/types/gridConfigs.d.ts +117 -19
- package/dist/types/gridConfigs.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/UiAnchorUpdater.d.ts +10 -0
- package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
- package/dist/ui/UiAnchorUpdater.js +111 -0
- package/dist/ui/UiLayers.d.ts +20 -0
- package/dist/ui/UiLayers.d.ts.map +1 -0
- package/dist/ui/UiLayers.js +57 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/uiAnchors.d.ts +21 -0
- package/dist/ui/uiAnchors.d.ts.map +1 -0
- package/dist/ui/uiAnchors.js +22 -0
- package/dist/ui/uiBaseStyles.d.ts +2 -0
- package/dist/ui/uiBaseStyles.d.ts.map +1 -0
- package/dist/ui/uiBaseStyles.js +100 -0
- package/dist/ui/uiBinder.d.ts +30 -0
- package/dist/ui/uiBinder.d.ts.map +1 -0
- package/dist/ui/uiBinder.js +344 -0
- package/dist/utils/configAnimations.d.ts.map +1 -1
- package/dist/utils/configAnimations.js +5 -1
- package/dist/utils/gridConfig.d.ts +1 -1
- package/dist/utils/gridConfig.d.ts.map +1 -1
- package/dist/utils/gridConfig.js +1 -1
- package/dist/utils/landPatch.d.ts +33 -0
- package/dist/utils/landPatch.d.ts.map +1 -0
- package/dist/utils/landPatch.js +114 -0
- package/dist/utils/renderedSky.d.ts +32 -0
- package/dist/utils/renderedSky.d.ts.map +1 -0
- package/dist/utils/renderedSky.js +57 -0
- package/dist/utils/skyMoon.d.ts +35 -0
- package/dist/utils/skyMoon.d.ts.map +1 -0
- package/dist/utils/skyMoon.js +41 -0
- package/dist/utils/terrainHeight.d.ts +4 -0
- package/dist/utils/terrainHeight.d.ts.map +1 -0
- package/dist/utils/terrainHeight.js +150 -0
- package/dist/utils/terrainTextureResolver.d.ts +18 -0
- package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
- package/dist/utils/terrainTextureResolver.js +17 -0
- package/dist/utils/terrainUniforms.d.ts +17 -0
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/dist/utils/terrainUniforms.js +84 -0
- package/dist/utils/textureArrays.d.ts +29 -0
- package/dist/utils/textureArrays.d.ts.map +1 -0
- package/dist/utils/textureArrays.js +140 -0
- package/package.json +2 -2
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { prepare, applyAnim, DRAW_METHODS, ERASE_METHODS } from '../methods.js';
|
|
3
|
+
import { uniformsBase, setReveal, frag, REVEAL_UNIFORMS } from '../ribbon.js';
|
|
4
|
+
const hex = (h) => new THREE.Color(h);
|
|
5
|
+
function mulberry32(a) { return function () { a |= 0; a = (a + 0x6D2B79F5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }
|
|
6
|
+
// =========================================================================================
|
|
7
|
+
// constellation — the pen strokes become a star chart figure, the way an IAU constellation plate draws Orion or Cassiopeia.
|
|
8
|
+
//
|
|
9
|
+
// Placement (CPU, seeded): along each stroke the star density rho(s) = (1/spacing)(1 + 1.3*kappa_n(s)) follows the curvature
|
|
10
|
+
// kappa of the pen path, so tight bends carry more stars; stars sit at the quantiles of the cumulative density (stratified
|
|
11
|
+
// inverse-CDF sampling = jittered, blue-noise-like spacing) and the strongest curvature extrema and both stroke ends are fixed
|
|
12
|
+
// anchors where a real figure would have its stars. Stars are joined in order by thin chart lines that stop a small gap short
|
|
13
|
+
// of each star and taper towards it.
|
|
14
|
+
//
|
|
15
|
+
// Population: apparent magnitudes follow the power-law luminosity function N(m) ~ 10^(beta m) (many faint, few bright),
|
|
16
|
+
// inverse-CDF sampled; flux ~ 10^(-0.4 m) sets sprite size and peak. Blackbody temperature per star is drawn from a
|
|
17
|
+
// skewed law (most stars cool, a few hot) and mapped through the Planckian locus (Kang et al. xy fit -> XYZ -> linear sRGB).
|
|
18
|
+
// Scintillation is smooth value noise per star, slower and weaker for the brighter ones. A sparse layer of
|
|
19
|
+
// fainter-than-limit dust stars hugs the figure; it is revealed by the limiting magnitude (brightness knob), like a real sky.
|
|
20
|
+
//
|
|
21
|
+
// Binaries: ~8% of the brighter stars are visual binaries. The companion sits on a Kepler ellipse (Kepler's equation solved with
|
|
22
|
+
// Newton steps from the mean anomaly M = 2 pi (t/P + M0)), projected by an inclination, and both members orbit the barycentre
|
|
23
|
+
// with shares 1/(1+k); the pair's combined flux equals the original star (m1 = m + 2.5 log10(1+k), flux2 = k flux1). Colours
|
|
24
|
+
// are an orange / blue pair like Albireo. The motion is internal to each pair (separation ~0.05 em), never a global move.
|
|
25
|
+
//
|
|
26
|
+
// Motion: lines extend with the pen, each star ignites as the pen reaches it (white flash cooling to its class colour);
|
|
27
|
+
// idle life is twinkle plus a slow brightening wave travelling along arc length of every stroke.
|
|
28
|
+
// =========================================================================================
|
|
29
|
+
// ---- shared GLSL ------------------------------------------------------------------------
|
|
30
|
+
const COMMON = /* glsl */ `
|
|
31
|
+
uniform float uMlim; uniform float uPx;
|
|
32
|
+
float figX(float m){ return max(uMlim - m, 0.5); }
|
|
33
|
+
float figR(float m){ return 0.0055 + 0.0026*figX(m); }
|
|
34
|
+
float pxPerLocal(float w){ return uPx*length(modelViewMatrix[0].xyz)/max(w, 1e-3); }
|
|
35
|
+
// travelling brightening: a narrow wave in absolute arc length (em), phase offset per stroke
|
|
36
|
+
float pulseAt(float arc, float off){ float ph = arc/2.2 - uTime*0.32*uIdleSpeed/2.2 + off; return pow(0.5 + 0.5*cos(6.2831853*ph), 8.0); }
|
|
37
|
+
`;
|
|
38
|
+
// ---- stars ------------------------------------------------------------------------------
|
|
39
|
+
const STAR_VERT = /* glsl */ `
|
|
40
|
+
attribute vec2 aq; attribute vec2 iP; attribute vec2 iTT; attribute vec2 iSeg; attribute vec2 iSegO; attribute vec4 iS; attribute vec2 iA; attribute vec4 iO; attribute vec4 iB;
|
|
41
|
+
${REVEAL_UNIFORMS}
|
|
42
|
+
uniform float uTwinkle; uniform float uTemp; uniform float uOpacity; uniform float uDurE; uniform vec3 uTint;
|
|
43
|
+
${COMMON}
|
|
44
|
+
varying vec2 vQ; varying float vInt; varying vec3 vCol; varying float vSp; varying float vRpx;
|
|
45
|
+
float h11(float x){ return fract(sin(x*127.1)*43758.5453); }
|
|
46
|
+
float vn(float x, float seed){ float i = floor(x); float f = fract(x); f = f*f*(3.0 - 2.0*f); float s = seed*31.7; return mix(h11(i + s), h11(i + 1.0 + s), f); }
|
|
47
|
+
// blackbody -> linear sRGB (Kang et al. Planckian-locus fit in CIE xy, Y = 1)
|
|
48
|
+
vec3 blackbody(float T){
|
|
49
|
+
T = clamp(T, 1700.0, 25000.0); float it = 1.0/T;
|
|
50
|
+
float x1 = -0.2661239e9*it*it*it - 0.2343589e6*it*it + 0.8776956e3*it + 0.179910;
|
|
51
|
+
float x2 = -3.0258469e9*it*it*it + 2.1070379e6*it*it + 0.2226347e3*it + 0.240390;
|
|
52
|
+
float x = T < 4000.0 ? x1 : x2;
|
|
53
|
+
float y1 = -1.1063814*x*x*x - 1.34811020*x*x + 2.18555832*x - 0.20219683;
|
|
54
|
+
float y2 = -0.9549476*x*x*x - 1.37418593*x*x + 2.09137015*x - 0.16748867;
|
|
55
|
+
float y3 = 3.0817580*x*x*x - 5.87338670*x*x + 3.75112997*x - 0.37001483;
|
|
56
|
+
float y = T < 2222.0 ? y1 : (T < 4000.0 ? y2 : y3);
|
|
57
|
+
float X = x/y; float Z = (1.0 - x - y)/y;
|
|
58
|
+
vec3 c = max(vec3(3.2406*X - 1.5372 - 0.4986*Z, -0.9689*X + 1.8758 + 0.0415*Z, 0.0557*X - 0.2040 + 1.0570*Z), 0.0);
|
|
59
|
+
return c/max(max(c.r, c.g), max(c.b, 1e-4));
|
|
60
|
+
}
|
|
61
|
+
void main(){
|
|
62
|
+
// binary orbit: Kepler's equation E - e sin E = M by Newton, relative vector projected by inclination, barycentric share
|
|
63
|
+
vec2 P0 = iP;
|
|
64
|
+
if (iO.z > 0.0) {
|
|
65
|
+
float Mn = 6.2831853*(uTime*uIdleSpeed*uIdle/iO.y + iO.w);
|
|
66
|
+
float ec = iO.x; float E = Mn + ec*sin(Mn);
|
|
67
|
+
for (int k = 0; k < 5; k++) { E -= (E - ec*sin(E) - Mn)/(1.0 - ec*cos(E)); }
|
|
68
|
+
vec2 rr = vec2(cos(E) - ec, sqrt(1.0 - ec*ec)*sin(E))*iO.z;
|
|
69
|
+
float co = cos(iB.x), si = sin(iB.x);
|
|
70
|
+
rr = vec2(co*rr.x - si*rr.y, (si*rr.x + co*rr.y)*iB.y);
|
|
71
|
+
P0 += rr*iB.z;
|
|
72
|
+
}
|
|
73
|
+
float m = iS.x; float T = iS.y; float rnd = iS.z; float dust = step(0.5, iS.w);
|
|
74
|
+
float x = uMlim - m; float xe = max(x, 0.5);
|
|
75
|
+
float R = mix(0.0055 + 0.0026*xe, 0.0036 + 0.0006*clamp(x, -2.0, 1.0), dust);
|
|
76
|
+
float I = mix(clamp(0.2 + 0.13*xe, 0.0, 0.92), 0.22*smoothstep(-2.6, 0.5, x), dust);
|
|
77
|
+
float spike = (1.0 - dust)*smoothstep(3.5, 4.4, xe);
|
|
78
|
+
// ---- schedule (global progress units; shaders never know which draw / erase method ran)
|
|
79
|
+
float sp = max(iSeg.y - iSeg.x, 1e-4); float so = max(iSegO.y - iSegO.x, 1e-4);
|
|
80
|
+
float lI = (uHead - iSeg.x)/sp;
|
|
81
|
+
float lit = uFadeIn > 0.5 ? smoothstep(rnd*0.6, rnd*0.6 + 0.4, uD) : smoothstep(0.0, max(uSoftIn, 1e-4), lI - iTT.x);
|
|
82
|
+
float age = uFadeIn > 0.5 ? max(0.0, uD - rnd*0.6)*uDur + uSince : max(0.0, uHead - (iSeg.x + iTT.x*sp))*uDur + uSince;
|
|
83
|
+
float wG = clamp(0.5/max(uDurE, 0.05), 0.05, 0.5);
|
|
84
|
+
float tG = iSegO.x + iTT.y*so; float ts = tG*(1.0 - wG);
|
|
85
|
+
float gone = uFadeOut > 0.5 ? 1.0 - smoothstep(rnd*0.6, rnd*0.6 + 0.4, uE) : 1.0 - smoothstep(ts, ts + wG, uE);
|
|
86
|
+
lit *= mix(1.0, smoothstep(0.0, 1.1, age), dust);
|
|
87
|
+
// ---- scintillation: smooth value noise, brighter = slower and weaker
|
|
88
|
+
float f = clamp(m/5.0, 0.0, 1.0);
|
|
89
|
+
float tt = uTime*mix(0.45, 1.25, f)*uIdleSpeed;
|
|
90
|
+
float n = 0.65*vn(tt + rnd*40.0, rnd) + 0.35*vn(tt*2.7 + rnd*70.0, rnd + 3.0);
|
|
91
|
+
float amp = uTwinkle*mix(0.10, 0.25, f)*uIdle;
|
|
92
|
+
float tw = max(0.2, 1.0 + 1.25*amp*(2.0*n - 1.0));
|
|
93
|
+
// ---- birth flash: white overshoot cooling to the class colour
|
|
94
|
+
float settled = smoothstep(0.3, 1.8, age);
|
|
95
|
+
float pulse = pulseAt(iA.x, iA.y)*settled*uIdle;
|
|
96
|
+
float flash = exp(-age/0.22)*(1.0 - 0.7*dust);
|
|
97
|
+
float white = exp(-age/0.26)*(1.0 - 0.6*dust);
|
|
98
|
+
float life = lit*gone*uOpacity;
|
|
99
|
+
float Iv = I*tw*(1.0 + 0.4*pulse)*(1.0 + 0.9*flash)*life;
|
|
100
|
+
vec3 bbc = mix(blackbody(T*exp(0.55*uTemp)), vec3(1.0), 0.1)*mix(vec3(1.0), uTint, 0.35);
|
|
101
|
+
vCol = mix(bbc, vec3(1.0), 0.9*white);
|
|
102
|
+
// ---- sprite size, with a one-pixel floor and flux conservation (no sub-pixel shimmer)
|
|
103
|
+
vec4 mv = modelViewMatrix*vec4(P0, 0.0, 1.0); vec4 cp = projectionMatrix*mv;
|
|
104
|
+
float pxl = pxPerLocal(cp.w);
|
|
105
|
+
float Rw = R*(1.0 + 0.6*amp*(2.0*n - 1.0))*(1.0 + 0.6*flash)*(0.55 + 0.45*gone);
|
|
106
|
+
float Re = max(Rw, 1.0/pxl);
|
|
107
|
+
float energy = min(1.0, (Rw*Rw)/(Re*Re));
|
|
108
|
+
vInt = Iv*energy; vSp = spike; vRpx = Re*pxl;
|
|
109
|
+
float Hm = mix(5.5, 12.0, spike);
|
|
110
|
+
vQ = aq*Hm;
|
|
111
|
+
if (Iv < 0.002) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
112
|
+
vec2 w = P0 + aq*(Re*Hm);
|
|
113
|
+
gl_Position = projectionMatrix*modelViewMatrix*vec4(w, 0.0, 1.0);
|
|
114
|
+
}`;
|
|
115
|
+
const STAR_FRAG = /* glsl */ `
|
|
116
|
+
precision highp float;
|
|
117
|
+
varying vec2 vQ; varying float vInt; varying vec3 vCol; varying float vSp; varying float vRpx;
|
|
118
|
+
void main(){
|
|
119
|
+
float r2 = dot(vQ, vQ); float r = sqrt(r2);
|
|
120
|
+
float core = exp(-r2*1.7);
|
|
121
|
+
float halo = 0.22/pow(1.0 + r2/0.8, 1.5)*(1.0 - smoothstep(3.0, 5.5, r));
|
|
122
|
+
// four-point diffraction spikes: thin Gaussian across, power-law decay along, always at least ~1px wide
|
|
123
|
+
float wq = max(0.06, 0.8/max(vRpx, 0.5));
|
|
124
|
+
vec2 a = abs(vQ);
|
|
125
|
+
float s1 = exp(-pow(a.y/wq, 2.0))/pow(1.0 + a.x*0.9, 2.0)*(1.0 - smoothstep(7.0, 12.0, a.x));
|
|
126
|
+
float s2 = exp(-pow(a.x/wq, 2.0))/pow(1.0 + a.y*0.9, 2.0)*(1.0 - smoothstep(7.0, 12.0, a.y));
|
|
127
|
+
float spk = vSp*0.85*(s1 + s2);
|
|
128
|
+
vec3 col = (vCol*(halo + spk) + mix(vCol, vec3(1.0), 0.6)*core)*vInt;
|
|
129
|
+
if (max(col.r, max(col.g, col.b)) < 0.0015) discard;
|
|
130
|
+
gl_FragColor = vec4(col, 1.0);
|
|
131
|
+
#include <tonemapping_fragment>
|
|
132
|
+
#include <colorspace_fragment>
|
|
133
|
+
}`;
|
|
134
|
+
// ---- chart lines ------------------------------------------------------------------------
|
|
135
|
+
const LINE_VERT = /* glsl */ `
|
|
136
|
+
attribute vec2 aq; attribute vec2 iA; attribute vec2 iB; attribute vec4 iT; attribute vec2 iSeg; attribute vec2 iSegO; attribute vec2 iM; attribute vec3 iL;
|
|
137
|
+
${REVEAL_UNIFORMS}
|
|
138
|
+
${COMMON}
|
|
139
|
+
uniform float uLineW;
|
|
140
|
+
varying float vSide; varying vec2 vUU; varying vec4 vTT; varying vec2 vLL; varying vec2 vSI; varying float vSeed;
|
|
141
|
+
varying vec2 vXY; varying vec3 vLN; varying vec2 vG;
|
|
142
|
+
void main(){
|
|
143
|
+
vec2 d = iB - iA; float l = max(length(d), 1e-6); vec2 dir = d/l; vec2 perp = vec2(-dir.y, dir.x);
|
|
144
|
+
vec4 cp = projectionMatrix*modelViewMatrix*vec4(0.5*(iA + iB), 0.0, 1.0);
|
|
145
|
+
float pxl = pxPerLocal(cp.w);
|
|
146
|
+
float hw = max(uLineW, 0.7/pxl); float mg = 1.5/pxl; float hl = 0.5*l;
|
|
147
|
+
vec2 loc = vec2(aq.x*(hl + mg), aq.y*(hw + mg));
|
|
148
|
+
vec2 w = 0.5*(iA + iB) + dir*loc.x + perp*loc.y;
|
|
149
|
+
gl_Position = projectionMatrix*modelViewMatrix*vec4(w, 0.0, 1.0);
|
|
150
|
+
float sp = max(iSeg.y - iSeg.x, 1e-4), so = max(iSegO.y - iSegO.x, 1e-4);
|
|
151
|
+
vXY = loc; vLN = vec3(hl, hw, min(1.0, uLineW/hw)); vG = vec2(1.25*figR(iM.x) + 0.005, 1.25*figR(iM.y) + 0.005);
|
|
152
|
+
vSide = 0.0; vTT = iT; vUU = iL.xy; vSeed = iL.z; vSI = vec2(iSeg.x, sp);
|
|
153
|
+
vLL = vec2((uHead - iSeg.x)/sp, (uErase - iSegO.x)/so);
|
|
154
|
+
}`;
|
|
155
|
+
const LINE_FRAG = /* glsl */ `
|
|
156
|
+
uniform vec3 uColor; uniform vec3 uColor2; uniform float uLines; uniform float uOpacity;
|
|
157
|
+
void main(){
|
|
158
|
+
float hl = vLN.x; float hw = vLN.y; float amp = vLN.z;
|
|
159
|
+
float fw = max(fwidth(vXY.y), 1e-5); // derivatives first: no discard before them
|
|
160
|
+
float l = 2.0*hl; float u = vXY.x + hl;
|
|
161
|
+
float gA = vG.x; float gB = vG.y; float room = l - gA - gB;
|
|
162
|
+
float taper = clamp(0.5*room, 1e-4, 0.05);
|
|
163
|
+
float tap = smoothstep(gA, gA + taper, u)*(1.0 - smoothstep(l - gB - taper, l - gB, u))*smoothstep(0.02, 0.06, room);
|
|
164
|
+
float hwe = hw*mix(0.45, 1.0, tap);
|
|
165
|
+
float lineA = 1.0 - smoothstep(hwe - fw, hwe + fw, abs(vXY.y));
|
|
166
|
+
float f = clamp(u/l, 0.0, 1.0);
|
|
167
|
+
float lit = revealIn(f); float gone = revealOut(f); float age = ageAt(f);
|
|
168
|
+
lit *= smoothstep(0.0, 0.035, age);
|
|
169
|
+
float settled = smoothstep(0.3, 1.8, age);
|
|
170
|
+
float P = pulseAt(mix(vUU.x, vUU.y, f), vSeed)*settled*uIdle;
|
|
171
|
+
float born = exp(-age/0.12);
|
|
172
|
+
float a = lineA*tap*lit*gone*amp*uLines*0.62*(0.6 + 0.9*P)*(1.0 + 0.6*born)*uOpacity;
|
|
173
|
+
vec3 col = mix(uColor, uColor2, clamp(0.6*P + 0.5*born, 0.0, 1.0));
|
|
174
|
+
gl_FragColor = vec4(col*a, 1.0);
|
|
175
|
+
#include <tonemapping_fragment>
|
|
176
|
+
#include <colorspace_fragment>
|
|
177
|
+
}`;
|
|
178
|
+
// ---- CPU: stroke sampling -----------------------------------------------------------------
|
|
179
|
+
function sampler(s) {
|
|
180
|
+
const n = s.pts.length / 2, P = s.pts, C = s.cum, L = s.len;
|
|
181
|
+
const at = (a) => { a = Math.max(0, Math.min(L, a)); let lo = 0, hi = n - 1; while (hi - lo > 1) {
|
|
182
|
+
const m = (lo + hi) >> 1;
|
|
183
|
+
if (C[m] <= a)
|
|
184
|
+
lo = m;
|
|
185
|
+
else
|
|
186
|
+
hi = m;
|
|
187
|
+
} const d = C[hi] - C[lo]; return [lo, hi, d > 1e-9 ? (a - C[lo]) / d : 0]; };
|
|
188
|
+
return {
|
|
189
|
+
pos(a) { const [i, j, f] = at(a); return [P[2 * i] + (P[2 * j] - P[2 * i]) * f, P[2 * i + 1] + (P[2 * j + 1] - P[2 * i + 1]) * f]; },
|
|
190
|
+
val(arr, a) { const [i, j, f] = at(a); return arr[i] + (arr[j] - arr[i]) * f; },
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const BETA = 0.5;
|
|
194
|
+
function lumFn(u, m0, m1) { const a = Math.pow(10, BETA * m0), b = Math.pow(10, BETA * m1); return Math.log10(a + u * (b - a)) / BETA; }
|
|
195
|
+
function placeStroke(s, spacing, rng) {
|
|
196
|
+
const L = s.len;
|
|
197
|
+
const smp = sampler(s);
|
|
198
|
+
if (L < 0.55 * spacing)
|
|
199
|
+
return [{ s: L / 2, off: 0, anchor: 1 }];
|
|
200
|
+
const h = 0.008, N = Math.max(4, Math.ceil(L / h)), step = L / N;
|
|
201
|
+
const X = new Float32Array(N + 1), Y = new Float32Array(N + 1);
|
|
202
|
+
for (let k = 0; k <= N; k++) {
|
|
203
|
+
const p = smp.pos(k * step);
|
|
204
|
+
X[k] = p[0];
|
|
205
|
+
Y[k] = p[1];
|
|
206
|
+
}
|
|
207
|
+
const k0 = Math.max(2, Math.round(0.035 / step));
|
|
208
|
+
const kap = new Float32Array(N + 1);
|
|
209
|
+
for (let k = 0; k <= N; k++) {
|
|
210
|
+
const a = Math.max(0, k - k0), b = Math.min(N, k + k0);
|
|
211
|
+
if (k === 0 || k === N || b - a < 2)
|
|
212
|
+
continue;
|
|
213
|
+
const ax = X[k] - X[a], ay = Y[k] - Y[a], bx = X[b] - X[k], by = Y[b] - Y[k];
|
|
214
|
+
const la = Math.hypot(ax, ay), lb = Math.hypot(bx, by);
|
|
215
|
+
if (la < 1e-9 || lb < 1e-9)
|
|
216
|
+
continue;
|
|
217
|
+
kap[k] = Math.abs(Math.atan2(ax * by - ay * bx, ax * bx + ay * by)) / (0.5 * (la + lb));
|
|
218
|
+
}
|
|
219
|
+
const ks = new Float32Array(N + 1);
|
|
220
|
+
for (let k = 0; k <= N; k++) {
|
|
221
|
+
let t = 0, c = 0;
|
|
222
|
+
for (let j = Math.max(0, k - k0); j <= Math.min(N, k + k0); j++) {
|
|
223
|
+
t += kap[j];
|
|
224
|
+
c++;
|
|
225
|
+
}
|
|
226
|
+
ks[k] = Math.min(1.5, t / c / 9);
|
|
227
|
+
}
|
|
228
|
+
const rho = (k) => (1 / spacing) * (1 + 1.3 * ks[k]);
|
|
229
|
+
const M = new Float32Array(N + 1);
|
|
230
|
+
for (let k = 1; k <= N; k++)
|
|
231
|
+
M[k] = M[k - 1] + 0.5 * (rho(k) + rho(k - 1)) * step;
|
|
232
|
+
// anchors: both ends + the strongest curvature maxima (>= 0.8 spacing apart, away from the ends)
|
|
233
|
+
const w = Math.max(1, Math.round(0.5 * spacing / step));
|
|
234
|
+
const cand = [];
|
|
235
|
+
for (let k = w; k <= N - w; k++) {
|
|
236
|
+
if (ks[k] < 0.5 || k * step < 0.6 * spacing || (N - k) * step < 0.6 * spacing)
|
|
237
|
+
continue;
|
|
238
|
+
let ok = true;
|
|
239
|
+
for (let j = k - w; j <= k + w; j++)
|
|
240
|
+
if (ks[j] > ks[k] || (ks[j] === ks[k] && j < k)) {
|
|
241
|
+
ok = false;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
if (ok)
|
|
245
|
+
cand.push(k);
|
|
246
|
+
}
|
|
247
|
+
cand.sort((a, b) => ks[b] - ks[a]);
|
|
248
|
+
const picked = [];
|
|
249
|
+
for (const k of cand)
|
|
250
|
+
if (picked.every((q) => Math.abs(q - k) * step >= 0.8 * spacing))
|
|
251
|
+
picked.push(k);
|
|
252
|
+
picked.sort((a, b) => a - b);
|
|
253
|
+
const anchors = [0, ...picked, N];
|
|
254
|
+
const out = [];
|
|
255
|
+
const kOfMass = (mass) => { let lo = 0, hi = N; while (hi - lo > 1) {
|
|
256
|
+
const m = (lo + hi) >> 1;
|
|
257
|
+
if (M[m] <= mass)
|
|
258
|
+
lo = m;
|
|
259
|
+
else
|
|
260
|
+
hi = m;
|
|
261
|
+
} const d = M[hi] - M[lo]; return lo + (d > 1e-9 ? (mass - M[lo]) / d : 0); };
|
|
262
|
+
for (let ai = 0; ai < anchors.length; ai++) {
|
|
263
|
+
const ka = anchors[ai];
|
|
264
|
+
out.push({ s: ka * step, off: 0, anchor: 1, end: ai === 0 || ai === anchors.length - 1 });
|
|
265
|
+
if (ai === anchors.length - 1)
|
|
266
|
+
break;
|
|
267
|
+
const kb = anchors[ai + 1];
|
|
268
|
+
const mass = M[kb] - M[ka];
|
|
269
|
+
const nInt = Math.max(1, Math.round(mass));
|
|
270
|
+
for (let j = 1; j < nInt; j++) {
|
|
271
|
+
const q = (j + (rng() - 0.5) * 0.55) / nInt;
|
|
272
|
+
const kf = kOfMass(M[ka] + q * mass);
|
|
273
|
+
out.push({ s: kf * step, off: (rng() - 0.5) * 2 * 0.18 / rho(Math.round(kf)), anchor: 0 });
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
for (const o of out)
|
|
277
|
+
if (o.anchor && !o.end)
|
|
278
|
+
o.off = (rng() - 0.5) * 2 * 0.1 * spacing;
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
281
|
+
export default {
|
|
282
|
+
key: 'constellation', source: 'hand', drawMethods: DRAW_METHODS, eraseMethods: ERASE_METHODS, drawDefault: 'pen', eraseDefault: 'undraw',
|
|
283
|
+
catalog: {
|
|
284
|
+
name: 'Constellation',
|
|
285
|
+
description: 'Pen strokes become a planetarium star plate: blackbody-coloured stars with Kepler binaries, tapered chart lines and faint dust stars. Use for space, astronomy, night-sky and elegant title cards.',
|
|
286
|
+
tags: ['constellation', 'stars', 'star-chart', 'binary-star', 'astronomy', 'night-sky', 'planetarium', 'space'],
|
|
287
|
+
},
|
|
288
|
+
defaults: { stars: 5.5, brightness: 0, twinkle: 1, lines: 1, temperature: 0, seed: 7, color: '#7f9bd0', color2: '#dce8ff', opacity: 1 },
|
|
289
|
+
ui: {
|
|
290
|
+
main: [
|
|
291
|
+
{ name: 'stars', label: 'Stars', description: 'Stars per em of pen stroke (density along the figure)', type: 'number', min: 3, max: 16, step: 0.5, unit: '/em' },
|
|
292
|
+
{ name: 'brightness', label: 'Brightness', description: 'Limiting magnitude shift: brighter, larger stars and more of the faint dust show', type: 'number', min: -1.5, max: 1.5, step: 0.05, unit: 'mag' },
|
|
293
|
+
{ name: 'temperature', label: 'Temperature', description: 'Shifts the whole star population cooler (amber) or hotter (blue-white)', type: 'number', min: -1, max: 1, step: 0.02 },
|
|
294
|
+
{ name: 'lines', label: 'Chart lines', description: 'Visibility of the lines joining the stars', type: 'number', min: 0, max: 1.5, step: 0.02 },
|
|
295
|
+
],
|
|
296
|
+
more: [
|
|
297
|
+
{ name: 'twinkle', label: 'Twinkle', description: 'Scintillation strength (0 = steady stars)', type: 'number', min: 0, max: 2, step: 0.02 },
|
|
298
|
+
{ name: 'color', label: 'Line colour', description: 'Colour of the chart lines', type: 'color' },
|
|
299
|
+
{ name: 'color2', label: 'Highlight / tint', description: 'Pulse highlight on the lines and a soft tint on the stars', type: 'color' },
|
|
300
|
+
{ name: 'opacity', label: 'Opacity', description: 'Overall opacity', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
301
|
+
{ name: 'seed', label: 'Seed', description: 'Which sky: star positions, magnitudes and colours', type: 'number', min: 0, max: 999, step: 1 },
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
structural: ['stars', 'seed'],
|
|
305
|
+
presets: [
|
|
306
|
+
{ name: 'Default', description: 'Cool planetarium chart', patch: {} },
|
|
307
|
+
{ name: 'Winter sky', description: 'Hotter, bluer stars with icy lines', patch: { temperature: 0.55, color: '#8fb4ee', color2: '#eaf2ff', brightness: 0.2 } },
|
|
308
|
+
{ name: 'Ember', description: 'Cool amber population with warm lines', patch: { temperature: -0.75, color: '#c79a6c', color2: '#ffe0b0', twinkle: 1.2 } },
|
|
309
|
+
{ name: 'Sparse chart', description: 'Fewer visible stars, bolder figure lines', patch: { brightness: -0.8, lines: 1.35, twinkle: 0.7 } },
|
|
310
|
+
{ name: 'Deep field', description: 'Faint dust fully visible, lines in the background', patch: { brightness: 1.1, lines: 0.55, twinkle: 1.3 } },
|
|
311
|
+
],
|
|
312
|
+
build(layout, cfg, anim) {
|
|
313
|
+
const strokes = layout.strokes;
|
|
314
|
+
prepare(strokes, 'hand');
|
|
315
|
+
const G = layout.glyphs.length;
|
|
316
|
+
const { infoD, infoE } = applyAnim(strokes, anim, G);
|
|
317
|
+
const rng = mulberry32(((Math.round(cfg.seed) | 0) * 7919 + 12345) | 0);
|
|
318
|
+
const spacing = 1 / Math.max(1, cfg.stars);
|
|
319
|
+
// ---- stars
|
|
320
|
+
const stars = [];
|
|
321
|
+
const lineSegs = [];
|
|
322
|
+
strokes.forEach((s, si) => {
|
|
323
|
+
if (!(s.len > 0))
|
|
324
|
+
return;
|
|
325
|
+
const smp = sampler(s);
|
|
326
|
+
const off = ((si * 0.6180339) % 1);
|
|
327
|
+
const pl = placeStroke(s, spacing, rng);
|
|
328
|
+
const row = [];
|
|
329
|
+
for (const o of pl) {
|
|
330
|
+
const p = smp.pos(o.s), q = smp.pos(o.s + 0.01), p0 = smp.pos(o.s - 0.01);
|
|
331
|
+
let tx = q[0] - p0[0], ty = q[1] - p0[1];
|
|
332
|
+
const tl = Math.hypot(tx, ty) || 1;
|
|
333
|
+
tx /= tl;
|
|
334
|
+
ty /= tl;
|
|
335
|
+
const u = rng();
|
|
336
|
+
const uu = o.anchor ? Math.pow(u, 1.6) : u;
|
|
337
|
+
const st = { si, s: o.s, x: p[0] - ty * o.off, y: p[1] + tx * o.off, m: lumFn(uu, 0.2, 4.6), T: 3200 + 21000 * Math.pow(rng(), 3), rnd: rng(), anchor: o.anchor, arc: o.s, off, dust: 0 };
|
|
338
|
+
st.tI = smp.val(s.t, o.s);
|
|
339
|
+
st.tO = smp.val(s.tO, o.s);
|
|
340
|
+
st.stroke = s;
|
|
341
|
+
row.push(st);
|
|
342
|
+
stars.push(st);
|
|
343
|
+
}
|
|
344
|
+
for (let i = 0; i + 1 < row.length; i++)
|
|
345
|
+
lineSegs.push([row[i], row[i + 1]]);
|
|
346
|
+
});
|
|
347
|
+
// a real figure always has a few brilliant stars: promote some anchors if the luminosity function gave none
|
|
348
|
+
const want = Math.max(1, Math.round(stars.length * 0.018));
|
|
349
|
+
let have = stars.filter((t) => t.m < 1.3).length;
|
|
350
|
+
const pool = stars.filter((t) => t.anchor && t.m >= 1.3);
|
|
351
|
+
while (have < want && pool.length) {
|
|
352
|
+
const t = pool.splice(Math.floor(rng() * pool.length), 1)[0];
|
|
353
|
+
t.m = 0.2 + 0.9 * rng();
|
|
354
|
+
have++;
|
|
355
|
+
}
|
|
356
|
+
// ---- dust: fainter-than-limit stars hugging the figure
|
|
357
|
+
const total = strokes.reduce((a, s) => a + s.len, 0);
|
|
358
|
+
const nDust = Math.round(stars.length * 0.7);
|
|
359
|
+
const dust = [];
|
|
360
|
+
for (let k = 0, guard = 0; k < nDust && guard < nDust * 20 && total > 0; guard++) {
|
|
361
|
+
let r = rng() * total, si = 0;
|
|
362
|
+
for (; si < strokes.length - 1; si++) {
|
|
363
|
+
if (r < strokes[si].len)
|
|
364
|
+
break;
|
|
365
|
+
r -= strokes[si].len;
|
|
366
|
+
}
|
|
367
|
+
const s = strokes[si];
|
|
368
|
+
if (!(s.len > 0))
|
|
369
|
+
continue;
|
|
370
|
+
const smp = sampler(s);
|
|
371
|
+
const a = r;
|
|
372
|
+
const p = smp.pos(a), q = smp.pos(a + 0.01), p0 = smp.pos(a - 0.01);
|
|
373
|
+
let tx = q[0] - p0[0], ty = q[1] - p0[1];
|
|
374
|
+
const tl = Math.hypot(tx, ty) || 1;
|
|
375
|
+
tx /= tl;
|
|
376
|
+
ty /= tl;
|
|
377
|
+
const g = (rng() + rng() + rng() - 1.5) * 2;
|
|
378
|
+
const dd = (0.06 + Math.abs(g) * 0.12) * (rng() < 0.5 ? -1 : 1);
|
|
379
|
+
const x = p[0] - ty * dd, y = p[1] + tx * dd;
|
|
380
|
+
if (stars.some((t) => Math.hypot(t.x - x, t.y - y) < 0.05) || dust.some((t) => Math.hypot(t.x - x, t.y - y) < 0.07))
|
|
381
|
+
continue;
|
|
382
|
+
const d = { si, x, y, m: lumFn(rng(), 4.6, 7.2), T: 3600 + 16000 * Math.pow(rng(), 2.2), rnd: rng(), arc: a, off: ((si * 0.6180339) % 1), dust: 1, stroke: s };
|
|
383
|
+
d.tI = Math.min(1, smp.val(s.t, a) + 0.03 * rng());
|
|
384
|
+
d.tO = smp.val(s.tO, a);
|
|
385
|
+
dust.push(d);
|
|
386
|
+
k++;
|
|
387
|
+
}
|
|
388
|
+
stars.forEach((t) => { t.mr = t.m; t.bin = null; });
|
|
389
|
+
// ---- binaries (own seeded stream, so the rest of the sky is unchanged)
|
|
390
|
+
const brng = mulberry32(((Math.round(cfg.seed) | 0) * 104729 + 31337) | 0);
|
|
391
|
+
const companions = [];
|
|
392
|
+
const cand = stars.filter((t) => t.m < 2.9);
|
|
393
|
+
const nb = stars.length >= 8 ? Math.max(1, Math.round(stars.length * 0.08)) : 0;
|
|
394
|
+
for (let b = 0; b < nb && cand.length; b++) {
|
|
395
|
+
const t = cand.splice(Math.floor(brng() * cand.length), 1)[0];
|
|
396
|
+
const k = 0.35 + 0.45 * brng();
|
|
397
|
+
const e = 0.15 + 0.55 * brng();
|
|
398
|
+
const per = 35 + 55 * brng();
|
|
399
|
+
const a = 0.07 + 0.04 * brng();
|
|
400
|
+
const om = 6.2831853 * brng(), ci = 0.45 + 0.5 * brng(), M0 = brng();
|
|
401
|
+
const swap = brng() < 0.4;
|
|
402
|
+
const Tc = 3700 + 900 * brng(), Th = 11000 + 4500 * brng();
|
|
403
|
+
const m1 = t.m + 2.5 * Math.log10(1 + k), m2 = m1 - 2.5 * Math.log10(k);
|
|
404
|
+
t.mr = m1;
|
|
405
|
+
t.T = swap ? Th : Tc;
|
|
406
|
+
t.bin = { o: [e, per, a, M0], b: [om, ci, -k / (1 + k), 0] };
|
|
407
|
+
const c = Object.assign({}, t, { mr: m2, T: swap ? Tc : Th, rnd: brng(), anchor: 0, bin: { o: [e, per, a, M0], b: [om, ci, 1 / (1 + k), 0] } });
|
|
408
|
+
companions.push(c);
|
|
409
|
+
}
|
|
410
|
+
const all = stars.concat(companions, dust);
|
|
411
|
+
// ---- geometry
|
|
412
|
+
const quad = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]);
|
|
413
|
+
const sg = new THREE.InstancedBufferGeometry();
|
|
414
|
+
sg.setAttribute('aq', new THREE.BufferAttribute(quad, 2));
|
|
415
|
+
sg.setIndex([0, 1, 2, 0, 2, 3]);
|
|
416
|
+
const n = all.length;
|
|
417
|
+
const aP = new Float32Array(n * 2), aTT = new Float32Array(n * 2), aSeg = new Float32Array(n * 2), aSegO = new Float32Array(n * 2), aS = new Float32Array(n * 4), aA = new Float32Array(n * 2), aO = new Float32Array(n * 4), aBn = new Float32Array(n * 4);
|
|
418
|
+
all.forEach((t, i) => { aP.set([t.x, t.y], 2 * i); aTT.set([t.tI, t.tO], 2 * i); aSeg.set(t.stroke.seg, 2 * i); aSegO.set(t.stroke.segO, 2 * i); aS.set([t.mr !== undefined ? t.mr : t.m, t.T, t.rnd, t.dust], 4 * i); if (t.bin) {
|
|
419
|
+
aO.set(t.bin.o, 4 * i);
|
|
420
|
+
aBn.set(t.bin.b, 4 * i);
|
|
421
|
+
} aA.set([t.arc, t.off], 2 * i); });
|
|
422
|
+
const ia = (g, k, a, c) => g.setAttribute(k, new THREE.InstancedBufferAttribute(a, c));
|
|
423
|
+
ia(sg, 'iP', aP, 2);
|
|
424
|
+
ia(sg, 'iTT', aTT, 2);
|
|
425
|
+
ia(sg, 'iSeg', aSeg, 2);
|
|
426
|
+
ia(sg, 'iSegO', aSegO, 2);
|
|
427
|
+
ia(sg, 'iS', aS, 4);
|
|
428
|
+
ia(sg, 'iA', aA, 2);
|
|
429
|
+
ia(sg, 'iO', aO, 4);
|
|
430
|
+
ia(sg, 'iB', aBn, 4);
|
|
431
|
+
sg.instanceCount = n;
|
|
432
|
+
sg.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 1e3);
|
|
433
|
+
const lg = new THREE.InstancedBufferGeometry();
|
|
434
|
+
lg.setAttribute('aq', new THREE.BufferAttribute(quad, 2));
|
|
435
|
+
lg.setIndex([0, 1, 2, 0, 2, 3]);
|
|
436
|
+
const nl = lineSegs.length;
|
|
437
|
+
const lA = new Float32Array(nl * 2), lB = new Float32Array(nl * 2), lT = new Float32Array(nl * 4), lS = new Float32Array(nl * 2), lSO = new Float32Array(nl * 2), lM = new Float32Array(nl * 2), lL = new Float32Array(nl * 3);
|
|
438
|
+
lineSegs.forEach(([a, b], i) => { lA.set([a.x, a.y], 2 * i); lB.set([b.x, b.y], 2 * i); lT.set([a.tI, b.tI, a.tO, b.tO], 4 * i); lS.set(a.stroke.seg, 2 * i); lSO.set(a.stroke.segO, 2 * i); lM.set([a.m, b.m], 2 * i); lL.set([a.arc, b.arc, a.off], 3 * i); });
|
|
439
|
+
ia(lg, 'iA', lA, 2);
|
|
440
|
+
ia(lg, 'iB', lB, 2);
|
|
441
|
+
ia(lg, 'iT', lT, 4);
|
|
442
|
+
ia(lg, 'iSeg', lS, 2);
|
|
443
|
+
ia(lg, 'iSegO', lSO, 2);
|
|
444
|
+
ia(lg, 'iM', lM, 2);
|
|
445
|
+
ia(lg, 'iL', lL, 3);
|
|
446
|
+
lg.instanceCount = nl;
|
|
447
|
+
lg.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 1e3);
|
|
448
|
+
const common = () => ({ uMlim: { value: 5.2 }, uPx: { value: 800 }, uOpacity: { value: 1 } });
|
|
449
|
+
const smat = new THREE.ShaderMaterial({
|
|
450
|
+
uniforms: { ...uniformsBase(), ...common(), uTwinkle: { value: 1 }, uTemp: { value: 0 }, uDurE: { value: anim.erase.duration || 2 }, uTint: { value: new THREE.Vector3(1, 1, 1) } },
|
|
451
|
+
vertexShader: STAR_VERT, fragmentShader: STAR_FRAG, transparent: true, depthWrite: false, side: THREE.DoubleSide, blending: THREE.AdditiveBlending,
|
|
452
|
+
});
|
|
453
|
+
const lmat = new THREE.ShaderMaterial({
|
|
454
|
+
uniforms: { ...uniformsBase(), ...common(), uLineW: { value: 0.0042 }, uLines: { value: 1 }, uColor: { value: hex(cfg.color) }, uColor2: { value: hex(cfg.color2) } },
|
|
455
|
+
vertexShader: LINE_VERT, fragmentShader: frag(LINE_FRAG, 'varying vec2 vXY; varying vec3 vLN; varying vec2 vG;\nuniform float uMlim; uniform float uPx;\nfloat pulseAt(float arc, float off){ float ph = arc/2.2 - uTime*0.32*uIdleSpeed/2.2 + off; return pow(0.5 + 0.5*cos(6.2831853*ph), 8.0); }\n'),
|
|
456
|
+
transparent: true, depthWrite: false, side: THREE.DoubleSide, blending: THREE.AdditiveBlending,
|
|
457
|
+
});
|
|
458
|
+
const lines = new THREE.Mesh(lg, lmat);
|
|
459
|
+
lines.frustumCulled = false;
|
|
460
|
+
lines.renderOrder = 1;
|
|
461
|
+
const starsMesh = new THREE.Mesh(sg, smat);
|
|
462
|
+
starsMesh.frustumCulled = false;
|
|
463
|
+
starsMesh.renderOrder = 2;
|
|
464
|
+
const group = new THREE.Group();
|
|
465
|
+
group.add(lines, starsMesh);
|
|
466
|
+
const tint = new THREE.Color();
|
|
467
|
+
const api = {
|
|
468
|
+
object: group,
|
|
469
|
+
apply(c) {
|
|
470
|
+
for (const m of [smat, lmat]) {
|
|
471
|
+
m.uniforms.uMlim.value = 5.2 + c.brightness;
|
|
472
|
+
m.uniforms.uOpacity.value = c.opacity;
|
|
473
|
+
}
|
|
474
|
+
smat.uniforms.uTwinkle.value = c.twinkle;
|
|
475
|
+
smat.uniforms.uTemp.value = c.temperature;
|
|
476
|
+
tint.set(c.color2);
|
|
477
|
+
const mx = Math.max(tint.r, tint.g, tint.b, 1e-3);
|
|
478
|
+
smat.uniforms.uTint.value.set(tint.r / mx, tint.g / mx, tint.b / mx);
|
|
479
|
+
lmat.uniforms.uColor.value.set(c.color);
|
|
480
|
+
lmat.uniforms.uColor2.value.set(c.color2);
|
|
481
|
+
lmat.uniforms.uLines.value = c.lines;
|
|
482
|
+
api.c = c;
|
|
483
|
+
},
|
|
484
|
+
update(S, time, px) {
|
|
485
|
+
for (const m of [smat, lmat]) {
|
|
486
|
+
setReveal(m.uniforms, S, infoD, infoE, anim.draw.duration, time);
|
|
487
|
+
m.uniforms.uPx.value = px;
|
|
488
|
+
}
|
|
489
|
+
smat.uniforms.uDurE.value = Math.max(0.05, anim.erase.duration || 0.05);
|
|
490
|
+
},
|
|
491
|
+
dispose() { sg.dispose(); lg.dispose(); smat.dispose(); lmat.dispose(); },
|
|
492
|
+
};
|
|
493
|
+
api.apply(cfg);
|
|
494
|
+
return api;
|
|
495
|
+
},
|
|
496
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
key: string;
|
|
3
|
+
source: string;
|
|
4
|
+
drawMethods: string[];
|
|
5
|
+
eraseMethods: string[];
|
|
6
|
+
drawDefault: string;
|
|
7
|
+
eraseDefault: string;
|
|
8
|
+
methodInfo: {
|
|
9
|
+
stitch: {
|
|
10
|
+
label: string;
|
|
11
|
+
hint: string;
|
|
12
|
+
};
|
|
13
|
+
unpick: {
|
|
14
|
+
label: string;
|
|
15
|
+
hint: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
catalog: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
tags: string[];
|
|
22
|
+
};
|
|
23
|
+
defaults: {
|
|
24
|
+
color: string;
|
|
25
|
+
color2: string;
|
|
26
|
+
density: number;
|
|
27
|
+
slant: number;
|
|
28
|
+
thickness: number;
|
|
29
|
+
sheen: number;
|
|
30
|
+
relief: number;
|
|
31
|
+
outline: number;
|
|
32
|
+
fabric: number;
|
|
33
|
+
pucker: number;
|
|
34
|
+
style: string;
|
|
35
|
+
opacity: number;
|
|
36
|
+
};
|
|
37
|
+
ui: {
|
|
38
|
+
main: ({
|
|
39
|
+
name: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description: string;
|
|
42
|
+
type: string;
|
|
43
|
+
min?: undefined;
|
|
44
|
+
max?: undefined;
|
|
45
|
+
step?: undefined;
|
|
46
|
+
unit?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
name: string;
|
|
49
|
+
label: string;
|
|
50
|
+
description: string;
|
|
51
|
+
type: string;
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
step: number;
|
|
55
|
+
unit?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
name: string;
|
|
58
|
+
label: string;
|
|
59
|
+
description: string;
|
|
60
|
+
type: string;
|
|
61
|
+
min: number;
|
|
62
|
+
max: number;
|
|
63
|
+
step: number;
|
|
64
|
+
unit: string;
|
|
65
|
+
})[];
|
|
66
|
+
more: ({
|
|
67
|
+
name: string;
|
|
68
|
+
label: string;
|
|
69
|
+
description: string;
|
|
70
|
+
type: string;
|
|
71
|
+
min?: undefined;
|
|
72
|
+
max?: undefined;
|
|
73
|
+
step?: undefined;
|
|
74
|
+
options?: undefined;
|
|
75
|
+
optionLabels?: undefined;
|
|
76
|
+
unit?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
label: string;
|
|
80
|
+
description: string;
|
|
81
|
+
type: string;
|
|
82
|
+
min: number;
|
|
83
|
+
max: number;
|
|
84
|
+
step: number;
|
|
85
|
+
options?: undefined;
|
|
86
|
+
optionLabels?: undefined;
|
|
87
|
+
unit?: undefined;
|
|
88
|
+
} | {
|
|
89
|
+
name: string;
|
|
90
|
+
label: string;
|
|
91
|
+
description: string;
|
|
92
|
+
type: string;
|
|
93
|
+
options: string[];
|
|
94
|
+
optionLabels: string[];
|
|
95
|
+
min?: undefined;
|
|
96
|
+
max?: undefined;
|
|
97
|
+
step?: undefined;
|
|
98
|
+
unit?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
name: string;
|
|
101
|
+
label: string;
|
|
102
|
+
description: string;
|
|
103
|
+
type: string;
|
|
104
|
+
min: number;
|
|
105
|
+
max: number;
|
|
106
|
+
step: number;
|
|
107
|
+
unit: string;
|
|
108
|
+
options?: undefined;
|
|
109
|
+
optionLabels?: undefined;
|
|
110
|
+
})[];
|
|
111
|
+
};
|
|
112
|
+
structural: string[];
|
|
113
|
+
presets: ({
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
patch: {
|
|
117
|
+
color?: undefined;
|
|
118
|
+
color2?: undefined;
|
|
119
|
+
sheen?: undefined;
|
|
120
|
+
fabric?: undefined;
|
|
121
|
+
outline?: undefined;
|
|
122
|
+
pucker?: undefined;
|
|
123
|
+
relief?: undefined;
|
|
124
|
+
};
|
|
125
|
+
} | {
|
|
126
|
+
name: string;
|
|
127
|
+
description: string;
|
|
128
|
+
patch: {
|
|
129
|
+
color: string;
|
|
130
|
+
color2: string;
|
|
131
|
+
sheen: number;
|
|
132
|
+
fabric: number;
|
|
133
|
+
outline?: undefined;
|
|
134
|
+
pucker?: undefined;
|
|
135
|
+
relief?: undefined;
|
|
136
|
+
};
|
|
137
|
+
} | {
|
|
138
|
+
name: string;
|
|
139
|
+
description: string;
|
|
140
|
+
patch: {
|
|
141
|
+
color: string;
|
|
142
|
+
color2: string;
|
|
143
|
+
sheen: number;
|
|
144
|
+
fabric: number;
|
|
145
|
+
outline: number;
|
|
146
|
+
pucker: number;
|
|
147
|
+
relief?: undefined;
|
|
148
|
+
};
|
|
149
|
+
} | {
|
|
150
|
+
name: string;
|
|
151
|
+
description: string;
|
|
152
|
+
patch: {
|
|
153
|
+
color: string;
|
|
154
|
+
color2: string;
|
|
155
|
+
sheen: number;
|
|
156
|
+
relief: number;
|
|
157
|
+
fabric: number;
|
|
158
|
+
outline: number;
|
|
159
|
+
pucker: number;
|
|
160
|
+
};
|
|
161
|
+
})[];
|
|
162
|
+
build(layout: any, cfg: any, anim: any): any;
|
|
163
|
+
};
|
|
164
|
+
export default _default;
|
|
165
|
+
//# sourceMappingURL=embroidery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embroidery.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/engine/looks/embroidery.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsZA,wBA8FE"}
|