@3driseai/3drise-viewer 0.1.28 → 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 +1 -1
- package/dist/components/ApollonianGrid.d.ts.map +1 -1
- package/dist/components/ApollonianGrid.js +3 -28
- 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 +1 -1
- package/dist/components/ConformalGrid.d.ts.map +1 -1
- package/dist/components/ConformalGrid.js +3 -34
- 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/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 +1 -1
- package/dist/components/HilbertGrid.d.ts.map +1 -1
- package/dist/components/HilbertGrid.js +3 -30
- 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 +1 -1
- package/dist/components/LensingGrid.d.ts.map +1 -1
- package/dist/components/LensingGrid.js +3 -29
- 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 +1 -1
- package/dist/components/ParastichyGrid.d.ts.map +1 -1
- package/dist/components/ParastichyGrid.js +3 -30
- package/dist/components/PhyllotaxisGrid.d.ts +1 -1
- package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
- package/dist/components/PhyllotaxisGrid.js +3 -32
- 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 +1 -1
- package/dist/components/TruchetGrid.d.ts.map +1 -1
- package/dist/components/TruchetGrid.js +3 -30
- 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 +10 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -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.map +1 -1
- package/dist/constants.js +4 -0
- 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 +18 -23
- package/dist/types/gridConfigs.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,593 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { setReveal, REVEAL_UNIFORMS } from '../ribbon.js';
|
|
3
|
+
import { prepare, applyAnim, extentOf, DRAW_METHODS, ERASE_METHODS } from '../methods.js';
|
|
4
|
+
import { buildField, fieldMaterial, fieldQuad } from '../fieldkit.js';
|
|
5
|
+
// =========================================================================================================================
|
|
6
|
+
// burnAway — letters cut from paper that burn.
|
|
7
|
+
//
|
|
8
|
+
// THE MATHS. Combustion of a thin sheet is a front propagating through a medium at a local speed v(p): its arrival time
|
|
9
|
+
// T(p) solves the eikonal equation |grad T| = 1/v(p). We solve it for real on the CPU at build (multi-source Dijkstra with a
|
|
10
|
+
// 16-neighbour stencil on a mask of the glyphs, so the front runs ALONG each stroke and wraps around loops and counters, it
|
|
11
|
+
// never jumps through the air), starting at a few seeded ignition points. Each letter piece is ignited from the nearest
|
|
12
|
+
// ignition (delay = distance / (1/0.7)), as if embers hop across the gaps. T is normalised to 0..1 (A) and baked into a
|
|
13
|
+
// half-float texture. In the shader the fire "spreads unevenly": A is warped by low-frequency fbm (a local speed
|
|
14
|
+
// modulation, so the ignition points stay the earliest) and the front edge gets finer fbm ragged detail.
|
|
15
|
+
// The erase animation S.e drives the front: pixel p is lit at e = (1-L)*A'(p) and then lives for a lifecycle of length L
|
|
16
|
+
// (spread knob: larger spread = faster front, longer-lingering remains), so at S.e = 1 every pixel is gone by construction.
|
|
17
|
+
// Behind the front the age t = e - arrival gives the stages: ember line (radiance of a blackbody cooling 1750K -> 900K,
|
|
18
|
+
// I ~ T^4) -> char (dark cellular cracking: Voronoi F2-F1, glowing in the cracks) -> ash (pale, brittle: plates that flake
|
|
19
|
+
// away on their own random thresholds) -> gone (alpha eaten by fbm / cell hashes, edges first). Ahead of the front the sheet
|
|
20
|
+
// toasts (brown gradient) and a faint warm halo spills out. Rising sparks are closed form: born at the instant the front
|
|
21
|
+
// passes their seed pixel (they evaluate the same arrival function in the vertex shader), drift up and cool.
|
|
22
|
+
// =========================================================================================================================
|
|
23
|
+
const hex = (h) => new THREE.Color(h);
|
|
24
|
+
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; }; }
|
|
25
|
+
// ---- GLSL shared by the fragment shader and the spark vertex shader ---------------------------------------------------
|
|
26
|
+
const BURN_COMMON = /* glsl */ `
|
|
27
|
+
uniform sampler2D uArr; uniform vec4 uArrExt; uniform float uL; uniform float uV; uniform float uRough; uniform vec2 uSeedV; uniform float uBurn; uniform float uK;
|
|
28
|
+
float bh(vec2 p){ vec3 p3 = fract(vec3(p.xyx)*0.1031); p3 += dot(p3, p3.yzx + 33.33); return fract((p3.x + p3.y)*p3.z); }
|
|
29
|
+
float vnz(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); f = f*f*(3.0 - 2.0*f);
|
|
30
|
+
return mix(mix(bh(i), bh(i + vec2(1.0, 0.0)), f.x), mix(bh(i + vec2(0.0, 1.0)), bh(i + vec2(1.0, 1.0)), f.x), f.y); }
|
|
31
|
+
float fbm4(vec2 p){ float a = 0.5; float s = 0.0; for (int i = 0; i < 4; i++){ s += a*vnz(p); p = p*2.03 + vec2(17.1, 9.7); a *= 0.5; } return s/0.9375; }
|
|
32
|
+
vec3 S(vec3 c){ return pow(c, vec3(2.2)); }
|
|
33
|
+
// ember colour from temperature: the config ember hue is the mid-temperature colour; cooler = deeper (darker, redder), hotter = paler and more
|
|
34
|
+
// yellow-white (gamma lift keeps the hue, so a blue ember glows blue). Radiance follows T^4 (see irad).
|
|
35
|
+
uniform vec3 uColor2;
|
|
36
|
+
vec3 ember(float T){ vec3 b = max(uColor2, vec3(1.0e-3)); b /= max(b.r, max(b.g, b.b)); float h = smoothstep(900.0, 1800.0, T); return pow(b, vec3(mix(1.7, 0.45, h))); }
|
|
37
|
+
float irad(float T){ return pow(T/1500.0, 4.0); }
|
|
38
|
+
// arrival of the front at p, in erase progress units (0 .. 1-L). A is warped by low-frequency fbm = uneven local speed.
|
|
39
|
+
float burnArr(vec2 p){
|
|
40
|
+
float A = texture2D(uArr, (p - uArrExt.xy)/uArrExt.zw).r;
|
|
41
|
+
float amp = 0.34*uRough; float n = fbm4(p*1.5 + uSeedV);
|
|
42
|
+
float w = (1.0 + amp*1.5*(2.0*n - 1.0))/(1.0 + amp*1.5);
|
|
43
|
+
return (1.0 - uL)*clamp(A*w, 0.0, 1.0);
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const BURN_FRAG = /* glsl */ `
|
|
47
|
+
uniform vec3 uColor; uniform float uOpacity; uniform float uChar; uniform float uEmber; uniform float uSinge; uniform float uLace; uniform float uCurl; uniform vec4 uEmb[8];
|
|
48
|
+
vec3 vor(vec2 p){ vec2 n = floor(p); vec2 f = fract(p); float F1 = 8.0; float F2 = 8.0; float id = 0.0;
|
|
49
|
+
for (int j = -1; j <= 1; j++) for (int i = -1; i <= 1; i++){
|
|
50
|
+
vec2 g = vec2(float(i), float(j)); vec2 c = n + g;
|
|
51
|
+
vec2 o = vec2(bh(c), bh(c + vec2(31.7, 17.3)));
|
|
52
|
+
float d = length(g + o - f);
|
|
53
|
+
if (d < F1){ F2 = F1; F1 = d; id = bh(c + vec2(5.1, 9.2)); } else if (d < F2) F2 = d;
|
|
54
|
+
} return vec3(F1, F2 - F1, id); }
|
|
55
|
+
void main(){
|
|
56
|
+
vec4 FA = fieldA(vPos);
|
|
57
|
+
float d = FA.x;
|
|
58
|
+
float fw = max(fwidth(d), 2.0e-4);
|
|
59
|
+
vec2 pxe = fwidth(vPos); float pem = max(pxe.x + pxe.y, 1.0e-5); // em per pixel
|
|
60
|
+
float vin = revealInG(FA.y);
|
|
61
|
+
float ageD = ageG(FA.y);
|
|
62
|
+
float vOut = revealOutG(FA.z);
|
|
63
|
+
// ---- time since the front passed (burn) or since the shared erase method reached this pixel (generic) ----
|
|
64
|
+
float arr = max(0.0, burnArr(vPos) + uRough*(0.009*(2.0*fbm4(vPos*13.0 + uSeedV*3.1) - 1.0) + 0.003*(2.0*fbm4(vPos*41.0 + uSeedV*1.7) - 1.0)));
|
|
65
|
+
float tt = uBurn > 0.5 ? (uE - arr) : (1.0 - vOut)*uL;
|
|
66
|
+
float phi = tt/uL; // lifecycle 0..1
|
|
67
|
+
float D = tt*uV/uK; // em behind the front (negative ahead of it), in units of a stroke of the reference width
|
|
68
|
+
float aheadEm = max(-D, 0.0);
|
|
69
|
+
float gEnd = mix(0.14, 1.0, uChar); // lifecycle fraction at which the remains are gone
|
|
70
|
+
float psi = max(phi, 0.0)/gEnd;
|
|
71
|
+
// ---- textures of the material ----
|
|
72
|
+
float q = max(-d, 0.0);
|
|
73
|
+
float rimN = fbm4(vPos*23.0 + uSeedV);
|
|
74
|
+
float cov = 1.0 - smoothstep(-fw, fw, d + 0.0022*(rimN - 0.5));
|
|
75
|
+
vec2 wp = vec2(vnz(vPos*7.0 + uSeedV), vnz(vPos*7.0 + uSeedV + 19.7)) - 0.5; // domain warp: cracks wander like real ones
|
|
76
|
+
vec3 vc = vor(vPos*15.0 + wp*1.6 + uSeedV*0.37);
|
|
77
|
+
vec3 vf = vor(vPos*38.0 + wp*2.5 + uSeedV*0.91 + 7.3);
|
|
78
|
+
float nh = fbm4(vPos*9.0 + uSeedV*1.3);
|
|
79
|
+
float cn = fbm4(vPos*21.0 + uSeedV*2.0);
|
|
80
|
+
// ---- paper: warm cream, long fibres along a fixed grain, soft mottling; fresh paper is a touch brighter ----
|
|
81
|
+
vec2 rp = vec2(0.9553*vPos.x + 0.2955*vPos.y, -0.2955*vPos.x + 0.9553*vPos.y);
|
|
82
|
+
float fa = 1.0 - smoothstep(0.12, 0.35, 40.0*pem);
|
|
83
|
+
// felted fibres: three elongated noises at 60 degrees to each other (no single direction), plus fine grain that fades with pixel size
|
|
84
|
+
vec2 r2 = vec2(-0.5*rp.x + 0.866*rp.y, -0.866*rp.x - 0.5*rp.y); vec2 r3 = vec2(-0.5*rp.x - 0.866*rp.y, 0.866*rp.x - 0.5*rp.y);
|
|
85
|
+
float fibre = (vnz(rp*vec2(6.0, 42.0)) + vnz(r2*vec2(6.0, 42.0) + 4.1) + vnz(r3*vec2(6.0, 42.0) + 8.3))/3.0;
|
|
86
|
+
fibre = 0.5 + (fibre - 0.5)*2.2 + (vnz(vPos*90.0) - 0.5)*0.5*fa;
|
|
87
|
+
float fleck = step(0.994, bh(floor(vPos*70.0)))*fa;
|
|
88
|
+
float mott = fbm4(vPos*4.5 + uSeedV*0.5);
|
|
89
|
+
float lum = 0.92 + 0.10*(mott - 0.5) + 0.30*(fibre - 0.5) - 0.10*fleck;
|
|
90
|
+
vec3 paper = uColor*lum*(1.0 + 0.10*exp(-ageD/0.7));
|
|
91
|
+
// the cut edge catches a little light just inside the contour
|
|
92
|
+
paper *= 1.0 + 0.035*exp(-pow((q - 0.006)/0.0035, 2.0));
|
|
93
|
+
// ---- singed rim: darker brown that deepens towards the contour ----
|
|
94
|
+
float ws = mix(0.008, 0.04, uSinge)*clamp(uK, 0.6, 1.3);
|
|
95
|
+
float rim = exp(-(q + 0.005*(rimN - 0.5))/ws)*(0.25 + 0.75*uSinge);
|
|
96
|
+
vec3 singeA = S(vec3(0.46, 0.25, 0.09)); vec3 singeB = S(vec3(0.11, 0.055, 0.022));
|
|
97
|
+
paper = mix(paper, mix(singeA, singeB, smoothstep(0.35, 1.0, rim))*(0.8 + 0.4*fibre), clamp(rim*1.05, 0.0, 1.0)*0.92);
|
|
98
|
+
// ---- toast ahead of the front ----
|
|
99
|
+
float toast = uBurn*exp(-aheadEm/0.03);
|
|
100
|
+
paper = mix(paper, S(vec3(0.55, 0.36, 0.17))*lum*0.8, toast*0.7);
|
|
101
|
+
// ---- char, cracks and ash behind it ----
|
|
102
|
+
float wC = 0.035 + fwidth(vc.y);
|
|
103
|
+
float cr = max(1.0 - smoothstep(0.02, 0.02 + wC, vc.y), 0.55*(1.0 - smoothstep(0.015, 0.015 + 0.06 + fwidth(vf.y), vf.y)));
|
|
104
|
+
vec3 charC = S(vec3(0.17, 0.13, 0.105))*(0.5 + 0.95*cn)*(0.85 + 0.3*vc.z)*(1.0 - 0.75*cr)*(0.8 + 0.4*fibre);
|
|
105
|
+
vec3 ashC = S(vec3(0.40, 0.375, 0.345))*(0.5 + 0.8*cn)*(0.92 + 0.16*vc.z)*(0.8 + 0.4*fibre)*(1.0 - 0.3*cr);
|
|
106
|
+
float ashMix = smoothstep(0.30, 0.85, psi + 0.3*(nh - 0.5));
|
|
107
|
+
vec3 burnt = mix(charC, ashC, ashMix);
|
|
108
|
+
float charMix = uBurn > 0.5 ? smoothstep(0.0, 0.006 + 1.5*pem, D) : smoothstep(0.02, 0.30, psi);
|
|
109
|
+
// ---- eaten away: plates and edges go on their own random thresholds ----
|
|
110
|
+
float hh = mix(0.5*nh + 0.5*cn, vc.z, 0.22);
|
|
111
|
+
float thr = mix(0.42, 0.93, hh) - 0.20*exp(-q/0.03);
|
|
112
|
+
float alive = 1.0 - smoothstep(thr - 0.09, thr + 0.02, psi);
|
|
113
|
+
// ---- resting smouldering embers (tiny blackbody points on the edge, breathing) ----
|
|
114
|
+
vec3 eRest = vec3(0.0); float dark = 0.0;
|
|
115
|
+
for (int i = 0; i < 8; i++){
|
|
116
|
+
vec4 e = uEmb[i];
|
|
117
|
+
if (e.w > 0.0){
|
|
118
|
+
float rr = length(vPos - e.xy);
|
|
119
|
+
float br = 0.55 + 0.45*sin(uTime*0.6*uIdleSpeed + e.z);
|
|
120
|
+
float nz = vnz(vPos*60.0 + e.z*13.0);
|
|
121
|
+
float rad = max(0.017*e.w*(0.7 + 0.6*uEmber), 1.5*pem);
|
|
122
|
+
float core = exp(-pow(rr/(rad*(0.85 + 0.25*br)), 2.0))*(0.45 + 0.9*nz);
|
|
123
|
+
float halo = exp(-rr/(0.05*e.w));
|
|
124
|
+
dark = max(dark, exp(-pow(rr/(0.032*e.w), 2.0)));
|
|
125
|
+
float Te = 950.0 + 600.0*clamp(core*br, 0.0, 1.0);
|
|
126
|
+
eRest += ember(Te)*irad(Te)*(core*0.8 + halo*0.09)*(0.4 + 0.6*br);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
eRest *= uEmber;
|
|
130
|
+
paper = mix(paper, charC*1.2, dark*0.85);
|
|
131
|
+
vec3 body = mix(paper, burnt, charMix);
|
|
132
|
+
// ---- paper curl (shading only): the charring edge lifts toward the viewer. Height h = curl * edge weight * profile(D): zero at the front,
|
|
133
|
+
// peaking just behind it, relaxing further back. The normal comes from the screen-space slope of h, lit from the upper left; the free edge
|
|
134
|
+
// shows a thin dark underside, and the lifted lip throws a soft shadow on the paper ahead. No geometry moves.
|
|
135
|
+
float gate = smoothstep(0.0, 0.02, uE);
|
|
136
|
+
float curlP = uCurl*smoothstep(0.0, 0.012, D)*exp(-max(D, 0.0)/0.07)*uBurn;
|
|
137
|
+
float hgt = 0.03*curlP*(0.35 + 0.65*exp(-q/0.04))*(0.8 + 0.4*cn);
|
|
138
|
+
float gx = dFdx(vPos.x); gx = abs(gx) > 1.0e-6 ? gx : 1.0e-6; float gy = dFdy(vPos.y); gy = abs(gy) > 1.0e-6 ? gy : 1.0e-6;
|
|
139
|
+
vec2 slope = vec2(dFdx(hgt)/gx, dFdy(hgt)/gy);
|
|
140
|
+
vec3 nrm = normalize(vec3(-slope*0.9, 1.0)); vec3 Ld = normalize(vec3(-0.5, 0.6, 0.65));
|
|
141
|
+
body *= clamp(dot(nrm, Ld)/Ld.z, 0.45, 1.5);
|
|
142
|
+
body = mix(body, S(vec3(0.045, 0.03, 0.02)), clamp(curlP*exp(-q/0.007), 0.0, 1.0)*0.85*(1.0 - smoothstep(0.0, 0.01, d)));
|
|
143
|
+
body *= 1.0 - 0.38*uCurl*uBurn*gate*exp(-aheadEm/0.04)*(0.4 + 0.6*exp(-q/0.05));
|
|
144
|
+
// ---- ash skeleton: the ink / carbon outlasts the paper, so a fragile lace of the letter (inner contour + medial ridge of the distance
|
|
145
|
+
// field, broken into threads) stays behind the front, cooling from warm grey to blue-grey with a slow sheen, then flakes off cell by cell
|
|
146
|
+
// in a slow wave that is finished by S.e = 1.
|
|
147
|
+
float le = 0.014;
|
|
148
|
+
float qn = 0.25*(max(-fieldA(vPos + vec2(le, 0.0)).x, 0.0) + max(-fieldA(vPos - vec2(le, 0.0)).x, 0.0) + max(-fieldA(vPos + vec2(0.0, le)).x, 0.0) + max(-fieldA(vPos - vec2(0.0, le)).x, 0.0));
|
|
149
|
+
float ridge = smoothstep(0.08*le, 0.4*le, q - qn)*step(0.004, q);
|
|
150
|
+
float lw = max(0.0024*clamp(uK, 0.6, 1.3), 0.75*pem);
|
|
151
|
+
float wob = 0.005*(fbm4(vPos*17.0 + uSeedV*0.3) - 0.5)*2.0;
|
|
152
|
+
float outl = exp(-pow((q - 0.010 - wob)/lw, 2.0))*(1.0 - smoothstep(-0.002, 0.002, d));
|
|
153
|
+
float thread = smoothstep(0.42, 0.66, fbm4(vPos*22.0 + uSeedV*0.7));
|
|
154
|
+
float lace = max(0.8*outl, 0.38*ridge*smoothstep(0.5, 0.75, thread + 0.3*vf.z))*(0.2 + 0.8*thread);
|
|
155
|
+
float wv = clamp((vPos.x - uArrExt.x)/uArrExt.z, 0.0, 1.0);
|
|
156
|
+
float tc = mix(0.72, 0.965, clamp(0.6*wv + 0.4*vc.z, 0.0, 1.0));
|
|
157
|
+
float collapse = 1.0 - smoothstep(tc - 0.035, tc + 0.03, uE);
|
|
158
|
+
float laceA = lace*uLace*mix(0.5, 1.0, uChar)*smoothstep(0.30, 0.75, psi)*collapse*vin*uOpacity;
|
|
159
|
+
float cool = smoothstep(0.4, 1.0, psi);
|
|
160
|
+
float shn = pow(vnz(vec2(vPos.x*4.0 + uTime*0.12*uIdleSpeed, vPos.y*8.0 + 3.1*vc.z)), 3.0);
|
|
161
|
+
vec3 laceC = mix(S(vec3(0.50, 0.47, 0.43)), S(vec3(0.42, 0.50, 0.60)), cool)*(0.55 + 0.9*shn*cool);
|
|
162
|
+
// ---- the front itself: thin ember line, glowing bed in the cracks, heat halo ahead ----
|
|
163
|
+
float Dp = max(D, 0.0);
|
|
164
|
+
float onFront = smoothstep(0.0, 0.0035 + 1.5*pem, D);
|
|
165
|
+
float Dw = 0.010*(0.55 + 0.7*uEmber);
|
|
166
|
+
float T = mix(1750.0, 1150.0, 1.0 - exp(-Dp/0.03));
|
|
167
|
+
float line = exp(-Dp/Dw);
|
|
168
|
+
float beat = 0.55 + 0.45*sin(uTime*0.9*uIdleSpeed + vc.z*40.0);
|
|
169
|
+
float bed = exp(-Dp/0.06)*cr*beat*(1.0 - smoothstep(0.04, 0.4, psi));
|
|
170
|
+
float Tb = mix(1150.0, 880.0, smoothstep(0.0, 0.3, psi));
|
|
171
|
+
vec3 emis = (ember(T)*irad(T)*line*0.62 + ember(Tb)*irad(Tb)*bed*0.8 + ember(1250.0)*0.09*exp(-Dp/0.035))*onFront*uEmber;
|
|
172
|
+
emis += ember(1250.0)*0.09*uBurn*exp(-aheadEm/0.03)*(1.0 - onFront)*uEmber;
|
|
173
|
+
emis += eRest;
|
|
174
|
+
// ---- composite ----
|
|
175
|
+
float aBody0 = cov*vin*alive*mix(1.0, 1.0 - 0.2*cr, ashMix*charMix)*(1.0 - 0.5*smoothstep(0.4, 1.0, psi)*charMix)*uOpacity;
|
|
176
|
+
float aBody = aBody0 + laceA*(1.0 - aBody0);
|
|
177
|
+
body = (body*aBody0 + laceC*laceA*(1.0 - aBody0))/max(aBody, 1.0e-4);
|
|
178
|
+
float sp = exp(-max(d, 0.0)/0.014)*(1.0 - smoothstep(0.025, 0.045, d));
|
|
179
|
+
float mEm = (cov + (1.0 - cov)*sp*0.55)*alive*vin*uOpacity;
|
|
180
|
+
vec3 em = emis*mEm;
|
|
181
|
+
em /= max(1.0, max(em.r, max(em.g, em.b)));
|
|
182
|
+
gl_FragColor = vec4(body*aBody + em, aBody);
|
|
183
|
+
#include <tonemapping_fragment>
|
|
184
|
+
#include <colorspace_fragment>
|
|
185
|
+
}`;
|
|
186
|
+
// ---- rising sparks (closed form) ----------------------------------------------------------------------------------------
|
|
187
|
+
const SPARK_VERT = /* glsl */ `
|
|
188
|
+
${REVEAL_UNIFORMS}${BURN_COMMON}
|
|
189
|
+
attribute vec4 aR; attribute float aMode; attribute float aG;
|
|
190
|
+
uniform float uScale; uniform float uSize; uniform float uEmber;
|
|
191
|
+
varying float vA; varying vec3 vCol;
|
|
192
|
+
void main(){
|
|
193
|
+
vec2 pos = position.xy; float a = 0.0; float T = 1300.0; float sz = 1.0;
|
|
194
|
+
if (aMode < 0.5){
|
|
195
|
+
float arr = burnArr(position.xy);
|
|
196
|
+
float life = uL*(0.3 + 0.55*aR.x);
|
|
197
|
+
float k = (uE - arr)/life;
|
|
198
|
+
if (uBurn > 0.5 && k > 0.0 && k < 1.0){
|
|
199
|
+
float e = 1.0 - pow(1.0 - k, 1.7);
|
|
200
|
+
pos.y += 0.012 + (0.14 + 0.26*aR.y)*e;
|
|
201
|
+
pos.x += (aR.z - 0.5)*0.10*e + 0.025*sin(k*5.0 + aR.w*6.28)*e;
|
|
202
|
+
a = smoothstep(0.0, 0.06, k)*(1.0 - smoothstep(0.45, 1.0, k))*(0.5 + 0.5*aR.w);
|
|
203
|
+
T = mix(1700.0, 950.0, k); sz = 0.7 + 0.6*aR.x;
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
float P = 5.0 + 5.0*aR.x; float ph = uTime*uIdleSpeed/P + aR.y*7.0; float kk = floor(ph);
|
|
207
|
+
float k = fract(ph)/0.4;
|
|
208
|
+
float on = step(0.45, bh(vec2(kk, aR.z*91.0)));
|
|
209
|
+
float vis = uFadeIn > 0.5 ? uD : smoothstep(0.0, max(uSoftIn, 1.0e-4), uHead - aG);
|
|
210
|
+
vis *= 1.0 - smoothstep(0.0, 0.06, uE);
|
|
211
|
+
if (k < 1.0){
|
|
212
|
+
float e = 1.0 - pow(1.0 - k, 1.5);
|
|
213
|
+
pos.y += 0.01 + (0.08 + 0.12*aR.y)*e;
|
|
214
|
+
pos.x += (aR.w - 0.5)*0.05*e + 0.012*sin(k*4.0 + aR.z*6.28)*e;
|
|
215
|
+
a = on*vis*smoothstep(0.0, 0.15, k)*(1.0 - smoothstep(0.4, 1.0, k))*0.75;
|
|
216
|
+
T = mix(1550.0, 950.0, k); sz = 0.55 + 0.4*aR.x;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
a *= (0.75 + 0.25*sin(uTime*(3.0 + 4.0*aR.w) + aR.z*30.0))*uEmber;
|
|
220
|
+
vA = a; vCol = ember(T)*irad(T)*1.1;
|
|
221
|
+
vec4 mv = modelViewMatrix*vec4(pos, 0.001, 1.0); gl_Position = projectionMatrix*mv;
|
|
222
|
+
gl_PointSize = a > 0.001 ? max(2.0, sz*uSize*uScale/-mv.z) : 0.0;
|
|
223
|
+
}`;
|
|
224
|
+
const SPARK_FRAG = /* glsl */ `
|
|
225
|
+
precision highp float; varying float vA; varying vec3 vCol;
|
|
226
|
+
void main(){ vec2 p = gl_PointCoord*2.0 - 1.0; float r = length(p);
|
|
227
|
+
float core = 1.0 - smoothstep(0.0, 0.32, r); float halo = pow(max(1.0 - r, 0.0), 2.6)*0.5;
|
|
228
|
+
float a = (core*0.95 + halo)*vA; if (a < 0.004) discard;
|
|
229
|
+
vec3 c = vCol*a; c /= max(1.0, max(c.r, max(c.g, c.b)))*1.0;
|
|
230
|
+
gl_FragColor = vec4(c, 1.0);
|
|
231
|
+
#include <tonemapping_fragment>
|
|
232
|
+
#include <colorspace_fragment>
|
|
233
|
+
}`;
|
|
234
|
+
// ---- CPU: the eikonal solve -------------------------------------------------------------------------------------------
|
|
235
|
+
function burnMap(strokes, field, G, seed) {
|
|
236
|
+
const ex = field.ext, ew = ex.z, eh = ex.w;
|
|
237
|
+
const W = 512, H = Math.max(8, Math.round(W * eh / ew)), sx = ew / W, sy = eh / H, N = W * H;
|
|
238
|
+
const rng = mulberry32(Math.floor(seed) * 7919 + 13);
|
|
239
|
+
// inside mask (even-odd per glyph), same convention as the field kit
|
|
240
|
+
const cv = document.createElement('canvas');
|
|
241
|
+
cv.width = W;
|
|
242
|
+
cv.height = H;
|
|
243
|
+
const g = cv.getContext('2d', { willReadFrequently: true });
|
|
244
|
+
g.fillStyle = '#fff';
|
|
245
|
+
g.fillRect(0, 0, W, H);
|
|
246
|
+
g.fillStyle = '#000';
|
|
247
|
+
const byGlyph = new Map();
|
|
248
|
+
for (const s of strokes) {
|
|
249
|
+
if (!byGlyph.has(s.glyph))
|
|
250
|
+
byGlyph.set(s.glyph, []);
|
|
251
|
+
byGlyph.get(s.glyph).push(s);
|
|
252
|
+
}
|
|
253
|
+
for (const list of byGlyph.values()) {
|
|
254
|
+
g.beginPath();
|
|
255
|
+
for (const s of list) {
|
|
256
|
+
for (let i = 0; i < s.pts.length; i += 2) {
|
|
257
|
+
const X = (s.pts[i] - ex.x) / sx, Y = H - (s.pts[i + 1] - ex.y) / sy;
|
|
258
|
+
if (i === 0)
|
|
259
|
+
g.moveTo(X, Y);
|
|
260
|
+
else
|
|
261
|
+
g.lineTo(X, Y);
|
|
262
|
+
}
|
|
263
|
+
g.closePath();
|
|
264
|
+
}
|
|
265
|
+
g.fill('evenodd');
|
|
266
|
+
}
|
|
267
|
+
const im = g.getImageData(0, 0, W, H).data;
|
|
268
|
+
const inside = new Uint8Array(N);
|
|
269
|
+
for (let y = 0; y < H; y++)
|
|
270
|
+
for (let x = 0; x < W; x++)
|
|
271
|
+
inside[y * W + x] = im[((H - 1 - y) * W + x) * 4] < 128 ? 1 : 0;
|
|
272
|
+
// ignition centres: contour points, one per slice of the text width (embers hop from the nearest one)
|
|
273
|
+
const e = extentOf(strokes);
|
|
274
|
+
const K = Math.max(1, Math.min(4, Math.round(G / 4)));
|
|
275
|
+
const cand = [];
|
|
276
|
+
strokes.forEach((s, si) => { const n = s.pts.length / 2; for (let k = 0; k < n - 1; k++)
|
|
277
|
+
cand.push([si, k]); });
|
|
278
|
+
const gDat = (si, k) => { const s = strokes[si]; return s.seg[0] + s.t[k] * (s.seg[1] - s.seg[0]); };
|
|
279
|
+
const sites = []; // {x, y, gD}
|
|
280
|
+
const addSite = (c) => { const s = strokes[c[0]]; sites.push({ x: s.pts[2 * c[1]], y: s.pts[2 * c[1] + 1], g: gDat(c[0], c[1]), si: c[0] }); };
|
|
281
|
+
for (let kk = 0; kk < K; kk++) {
|
|
282
|
+
const lo = e.x0 + e.w * kk / K, hi = e.x0 + e.w * (kk + 1) / K;
|
|
283
|
+
let pool = cand.filter((c) => { const x = strokes[c[0]].pts[2 * c[1]]; return x >= lo && x <= hi; });
|
|
284
|
+
if (!pool.length)
|
|
285
|
+
pool = cand;
|
|
286
|
+
addSite(pool[Math.floor(rng() * pool.length) % pool.length]);
|
|
287
|
+
}
|
|
288
|
+
const centres = sites.slice();
|
|
289
|
+
for (let tries = 0, want = Math.min(8, K + 3); sites.length < want && tries < 200; tries++) {
|
|
290
|
+
const c = cand[Math.floor(rng() * cand.length) % cand.length];
|
|
291
|
+
const s = strokes[c[0]];
|
|
292
|
+
const x = s.pts[2 * c[1]], y = s.pts[2 * c[1] + 1];
|
|
293
|
+
if (sites.every((o) => Math.hypot(o.x - x, o.y - y) > 0.45))
|
|
294
|
+
addSite(c);
|
|
295
|
+
}
|
|
296
|
+
// connected components of the mask (a glyph may have islands: the dot of an i)
|
|
297
|
+
const comp = new Int32Array(N).fill(-1);
|
|
298
|
+
const comps = [];
|
|
299
|
+
const stack = [];
|
|
300
|
+
for (let p = 0; p < N; p++) {
|
|
301
|
+
if (!inside[p] || comp[p] >= 0)
|
|
302
|
+
continue;
|
|
303
|
+
const id = comps.length;
|
|
304
|
+
const cells = [];
|
|
305
|
+
comp[p] = id;
|
|
306
|
+
stack.push(p);
|
|
307
|
+
while (stack.length) {
|
|
308
|
+
const c = stack.pop();
|
|
309
|
+
cells.push(c);
|
|
310
|
+
const cx = c % W, cy = (c / W) | 0;
|
|
311
|
+
for (let dy = -1; dy <= 1; dy++)
|
|
312
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
313
|
+
const xx = cx + dx, yy = cy + dy;
|
|
314
|
+
if (xx < 0 || yy < 0 || xx >= W || yy >= H)
|
|
315
|
+
continue;
|
|
316
|
+
const q = yy * W + xx;
|
|
317
|
+
if (inside[q] && comp[q] < 0) {
|
|
318
|
+
comp[q] = id;
|
|
319
|
+
stack.push(q);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
comps.push(cells);
|
|
324
|
+
}
|
|
325
|
+
// multi-source Dijkstra (binary heap, lazy deletion). Every component starts at the cell nearest an ignition centre.
|
|
326
|
+
const dist = new Float64Array(N).fill(1e30);
|
|
327
|
+
let hk = new Float64Array(1024), hv = new Int32Array(1024), hn = 0;
|
|
328
|
+
const push = (k, v) => { if (hn === hk.length) {
|
|
329
|
+
const a = new Float64Array(hn * 2), b = new Int32Array(hn * 2);
|
|
330
|
+
a.set(hk);
|
|
331
|
+
b.set(hv);
|
|
332
|
+
hk = a;
|
|
333
|
+
hv = b;
|
|
334
|
+
} let i = hn++; while (i > 0) {
|
|
335
|
+
const p = (i - 1) >> 1;
|
|
336
|
+
if (hk[p] <= k)
|
|
337
|
+
break;
|
|
338
|
+
hk[i] = hk[p];
|
|
339
|
+
hv[i] = hv[p];
|
|
340
|
+
i = p;
|
|
341
|
+
} hk[i] = k; hv[i] = v; };
|
|
342
|
+
const pop = () => { const rk = hk[0], rv = hv[0]; const k = hk[--hn], v = hv[hn]; let i = 0; for (;;) {
|
|
343
|
+
let c = 2 * i + 1;
|
|
344
|
+
if (c >= hn)
|
|
345
|
+
break;
|
|
346
|
+
if (c + 1 < hn && hk[c + 1] < hk[c])
|
|
347
|
+
c++;
|
|
348
|
+
if (hk[c] >= k)
|
|
349
|
+
break;
|
|
350
|
+
hk[i] = hk[c];
|
|
351
|
+
hv[i] = hv[c];
|
|
352
|
+
i = c;
|
|
353
|
+
} hk[i] = k; hv[i] = v; return [rk, rv]; };
|
|
354
|
+
for (const cells of comps) {
|
|
355
|
+
let best = -1, bd = 1e30;
|
|
356
|
+
for (const c of cells) {
|
|
357
|
+
const X = ex.x + ((c % W) + 0.5) * sx, Y = ex.y + (((c / W) | 0) + 0.5) * sy;
|
|
358
|
+
for (const s of centres) {
|
|
359
|
+
const d2 = (X - s.x) ** 2 + (Y - s.y) ** 2;
|
|
360
|
+
if (d2 < bd) {
|
|
361
|
+
bd = d2;
|
|
362
|
+
best = c;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
const delay = 0.7 * Math.sqrt(bd);
|
|
367
|
+
dist[best] = delay;
|
|
368
|
+
push(delay, best);
|
|
369
|
+
}
|
|
370
|
+
const NB = [[1, 0], [-1, 0], [0, 1], [0, -1], [1, 1], [1, -1], [-1, 1], [-1, -1], [2, 1], [2, -1], [-2, 1], [-2, -1], [1, 2], [1, -2], [-1, 2], [-1, -2]];
|
|
371
|
+
const NL = NB.map(([a, b]) => Math.hypot(a * sx, b * sy));
|
|
372
|
+
while (hn > 0) {
|
|
373
|
+
const [dk, c] = pop();
|
|
374
|
+
if (dk > dist[c])
|
|
375
|
+
continue;
|
|
376
|
+
const cx = c % W, cy = (c / W) | 0;
|
|
377
|
+
for (let j = 0; j < 16; j++) {
|
|
378
|
+
const xx = cx + NB[j][0], yy = cy + NB[j][1];
|
|
379
|
+
if (xx < 0 || yy < 0 || xx >= W || yy >= H)
|
|
380
|
+
continue;
|
|
381
|
+
const q = yy * W + xx;
|
|
382
|
+
if (!inside[q])
|
|
383
|
+
continue;
|
|
384
|
+
const nd = dk + NL[j];
|
|
385
|
+
if (nd < dist[q]) {
|
|
386
|
+
dist[q] = nd;
|
|
387
|
+
push(nd, q);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
let Tmax = 1e-3;
|
|
392
|
+
for (let p = 0; p < N; p++)
|
|
393
|
+
if (inside[p] && dist[p] < 1e29)
|
|
394
|
+
Tmax = Math.max(Tmax, dist[p]);
|
|
395
|
+
// the fire should keep burning new paper at a steady pace: map T through a blend of itself and its cdf over the paper area
|
|
396
|
+
// (monotone, so the front topology is unchanged; sparse regions are crossed faster than dense ones)
|
|
397
|
+
const ord = [];
|
|
398
|
+
for (let p = 0; p < N; p++)
|
|
399
|
+
if (inside[p] && dist[p] < 1e29)
|
|
400
|
+
ord.push(p);
|
|
401
|
+
ord.sort((a, b) => dist[a] - dist[b]);
|
|
402
|
+
const rank = new Float32Array(N);
|
|
403
|
+
ord.forEach((p, i) => { rank[p] = i / Math.max(1, ord.length - 1); });
|
|
404
|
+
const EQ = 0.55;
|
|
405
|
+
for (const p of ord)
|
|
406
|
+
dist[p] = ((1 - EQ) * dist[p] / Tmax + EQ * rank[p]) * Tmax;
|
|
407
|
+
const A = new Float32Array(N).fill(1);
|
|
408
|
+
const set = new Uint8Array(N);
|
|
409
|
+
for (let p = 0; p < N; p++)
|
|
410
|
+
if (inside[p] && dist[p] < 1e29) {
|
|
411
|
+
A[p] = dist[p] / Tmax;
|
|
412
|
+
set[p] = 1;
|
|
413
|
+
}
|
|
414
|
+
// dilate the arrival a few texels outwards so the light spilling over the cut edge has a front too
|
|
415
|
+
for (let r = 0; r < 6; r++) {
|
|
416
|
+
const nA = A.slice(), nS = set.slice();
|
|
417
|
+
for (let y = 0; y < H; y++)
|
|
418
|
+
for (let x = 0; x < W; x++) {
|
|
419
|
+
const p = y * W + x;
|
|
420
|
+
if (set[p])
|
|
421
|
+
continue;
|
|
422
|
+
let m = 2, f = 0;
|
|
423
|
+
for (let dy = -1; dy <= 1; dy++)
|
|
424
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
425
|
+
const xx = x + dx, yy = y + dy;
|
|
426
|
+
if (xx < 0 || yy < 0 || xx >= W || yy >= H)
|
|
427
|
+
continue;
|
|
428
|
+
const q = yy * W + xx;
|
|
429
|
+
if (set[q] && A[q] < m) {
|
|
430
|
+
m = A[q];
|
|
431
|
+
f = 1;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (f) {
|
|
435
|
+
nA[p] = m;
|
|
436
|
+
nS[p] = 1;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
A.set(nA);
|
|
440
|
+
set.set(nS);
|
|
441
|
+
}
|
|
442
|
+
const hf = THREE.DataUtils.toHalfFloat;
|
|
443
|
+
const data = new Uint16Array(N * 4);
|
|
444
|
+
const one = hf(1);
|
|
445
|
+
for (let p = 0; p < N; p++) {
|
|
446
|
+
data[4 * p] = hf(A[p]);
|
|
447
|
+
data[4 * p + 1] = 0;
|
|
448
|
+
data[4 * p + 2] = 0;
|
|
449
|
+
data[4 * p + 3] = one;
|
|
450
|
+
}
|
|
451
|
+
const tex = new THREE.DataTexture(data, W, H, THREE.RGBAFormat, THREE.HalfFloatType);
|
|
452
|
+
tex.minFilter = tex.magFilter = THREE.LinearFilter;
|
|
453
|
+
tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping;
|
|
454
|
+
tex.generateMipmaps = false;
|
|
455
|
+
tex.needsUpdate = true;
|
|
456
|
+
// spark seeds: stratified over the burn order, so a spark is born every so often along the whole fire
|
|
457
|
+
const order = [];
|
|
458
|
+
for (let p = 0; p < N; p++)
|
|
459
|
+
if (inside[p] && dist[p] < 1e29)
|
|
460
|
+
order.push(p);
|
|
461
|
+
order.sort((a, b) => dist[a] - dist[b]);
|
|
462
|
+
const seeds = [];
|
|
463
|
+
const NBURN = 48;
|
|
464
|
+
if (order.length)
|
|
465
|
+
for (let i = 0; i < NBURN; i++) {
|
|
466
|
+
const c = order[Math.min(order.length - 1, Math.floor(((i + rng()) / NBURN) * order.length))];
|
|
467
|
+
seeds.push({ x: ex.x + ((c % W) + rng()) * sx, y: ex.y + (((c / W) | 0) + rng()) * sy, r: [rng(), rng(), rng(), rng()] });
|
|
468
|
+
}
|
|
469
|
+
let nIn = 0;
|
|
470
|
+
for (let p = 0; p < N; p++)
|
|
471
|
+
nIn += inside[p];
|
|
472
|
+
let per = 0;
|
|
473
|
+
for (const s of strokes)
|
|
474
|
+
per += s.len;
|
|
475
|
+
const strokeW = Math.max(0.03, Math.min(0.3, 2 * nIn * sx * sy / Math.max(1e-3, per)));
|
|
476
|
+
return { tex, Tmax, sites, seeds, rng, strokeW };
|
|
477
|
+
}
|
|
478
|
+
function sparkGeometry(map) {
|
|
479
|
+
const idle = [];
|
|
480
|
+
map.sites.forEach((s) => { for (let k = 0; k < 2; k++)
|
|
481
|
+
idle.push(s); });
|
|
482
|
+
const n = map.seeds.length + idle.length;
|
|
483
|
+
const pos = new Float32Array(n * 3), aR = new Float32Array(n * 4), aMode = new Float32Array(n), aG = new Float32Array(n);
|
|
484
|
+
map.seeds.forEach((s, i) => { pos[3 * i] = s.x; pos[3 * i + 1] = s.y; aR.set(s.r, 4 * i); });
|
|
485
|
+
idle.forEach((s, j) => { const i = map.seeds.length + j; pos[3 * i] = s.x; pos[3 * i + 1] = s.y; aMode[i] = 1; aG[i] = s.g; aR.set([map.rng(), map.rng(), map.rng(), map.rng()], 4 * i); });
|
|
486
|
+
const g = new THREE.BufferGeometry();
|
|
487
|
+
g.setAttribute('position', new THREE.BufferAttribute(pos, 3));
|
|
488
|
+
g.setAttribute('aR', new THREE.BufferAttribute(aR, 4));
|
|
489
|
+
g.setAttribute('aMode', new THREE.BufferAttribute(aMode, 1));
|
|
490
|
+
g.setAttribute('aG', new THREE.BufferAttribute(aG, 1));
|
|
491
|
+
g.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 1e3);
|
|
492
|
+
return g;
|
|
493
|
+
}
|
|
494
|
+
export default {
|
|
495
|
+
key: 'burnAway', source: 'outline',
|
|
496
|
+
drawMethods: DRAW_METHODS, eraseMethods: ['burn', ...ERASE_METHODS], drawDefault: 'trace', eraseDefault: 'burn',
|
|
497
|
+
animDefaults: { eraseDuration: 6, holdTime: 2.5, eraseEase: 'linear' },
|
|
498
|
+
methodInfo: { burn: { label: 'Burn', hint: 'A combustion front: a few seeded ignition points, the fire runs along the letters, leaves char and ash, then nothing.' } },
|
|
499
|
+
catalog: {
|
|
500
|
+
name: 'Burn Away',
|
|
501
|
+
description: 'Letters cut from singed cream paper with smouldering embers; the erase is a combustion front travelling along the strokes leaving glowing edge, cracked char and ash. Use for dramatic reveals, titles and storytelling.',
|
|
502
|
+
tags: ['paper', 'burn', 'fire', 'ember', 'char', 'ash', 'parchment', 'dramatic'],
|
|
503
|
+
},
|
|
504
|
+
defaults: { color: '#efe2c4', color2: '#ff7a1c', char: 0.6, ashLace: 0.7, curl: 0.6, spread: 1, ember: 1, roughness: 0.6, singe: 0.55, opacity: 1, seed: 7 },
|
|
505
|
+
ui: {
|
|
506
|
+
main: [
|
|
507
|
+
{ name: 'char', label: 'Char', description: 'How much cracked char and ash is left behind the fire (0 = clean burn).', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
508
|
+
{ name: 'spread', label: 'Spread', description: 'Speed of the fire front; faster fronts leave their remains lingering longer.', type: 'number', min: 0.3, max: 2.2, step: 0.01 },
|
|
509
|
+
{ name: 'ember', label: 'Ember', description: 'Brightness and size of the embers, sparks and the glowing front.', type: 'number', min: 0, max: 2, step: 0.01 },
|
|
510
|
+
{ name: 'color', label: 'Paper', description: 'Colour of the paper.', type: 'color' },
|
|
511
|
+
],
|
|
512
|
+
more: [
|
|
513
|
+
{ name: 'color2', label: 'Ember colour', description: 'Hue of the glowing embers (tints the blackbody ramp).', type: 'color' },
|
|
514
|
+
{ name: 'roughness', label: 'Raggedness', description: 'How unevenly the fire spreads and how ragged the front is.', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
515
|
+
{ name: 'singe', label: 'Singe', description: 'Width and depth of the scorched brown rim at rest.', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
516
|
+
{ name: 'ashLace', label: 'Ash lace', description: 'How much of the writing stays as a fragile ash skeleton before it flakes away.', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
517
|
+
{ name: 'curl', label: 'Curl', description: 'How strongly the charring paper edge curls up toward the viewer.', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
518
|
+
{ name: 'opacity', label: 'Opacity', description: 'Overall opacity.', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
519
|
+
{ name: 'seed', label: 'Seed', description: 'Where the fire starts and how it spreads.', type: 'number', min: 0, max: 99, step: 1 },
|
|
520
|
+
],
|
|
521
|
+
},
|
|
522
|
+
structural: ['seed'],
|
|
523
|
+
presets: [
|
|
524
|
+
{ name: 'Parchment', description: 'Cream paper, a fire that leaves char and ash.', patch: {} },
|
|
525
|
+
{ name: 'Clean burn', description: 'Fast, thin front that leaves almost nothing behind.', patch: { char: 0.08, spread: 1.7, roughness: 0.35, ember: 1.2 } },
|
|
526
|
+
{ name: 'Smouldering', description: 'Slow, ragged creep with bright embers and heavy char.', patch: { char: 1, spread: 0.45, roughness: 0.9, ember: 1.5, singe: 0.8 } },
|
|
527
|
+
{ name: 'Old map', description: 'Tea-stained sheet with a deep singed rim.', patch: { color: '#d9bf8a', singe: 1, char: 0.75, roughness: 0.8 } },
|
|
528
|
+
{ name: 'Moonfire', description: 'Cold pale paper and bluish embers.', patch: { color: '#d7dde8', color2: '#6fa8ff', ember: 1.1, singe: 0.4 } },
|
|
529
|
+
],
|
|
530
|
+
build(layout, cfg, anim) {
|
|
531
|
+
const strokes = layout.strokes;
|
|
532
|
+
prepare(strokes, 'outline');
|
|
533
|
+
const G = layout.glyphs.length;
|
|
534
|
+
strokes.forEach((s) => { s.glyphN = s.glyph / Math.max(1, G - 1); });
|
|
535
|
+
const { infoD, infoE } = applyAnim(strokes, anim, G);
|
|
536
|
+
const field = buildField(strokes, { source: 'outline', texels: 800 });
|
|
537
|
+
const map = burnMap(strokes, field, G, cfg.seed);
|
|
538
|
+
const shared = {
|
|
539
|
+
uArr: { value: map.tex }, uArrExt: { value: field.ext }, uL: { value: 0.3 }, uV: { value: 3 }, uRough: { value: cfg.roughness },
|
|
540
|
+
uK: { value: Math.max(0.45, Math.min(1.5, map.strokeW / 0.12)) }, uSeedV: { value: new THREE.Vector2((cfg.seed * 13.37) % 97, (cfg.seed * 7.11) % 89) }, uBurn: { value: anim.erase.method === 'burn' ? 1 : 0 },
|
|
541
|
+
};
|
|
542
|
+
const embers = [];
|
|
543
|
+
for (let i = 0; i < 8; i++)
|
|
544
|
+
embers.push(new THREE.Vector4(0, 0, 0, 0));
|
|
545
|
+
map.sites.slice(0, 8).forEach((s, i) => embers[i].set(s.x, s.y, (map.rng() * 6.283), 0.8 + 0.5 * map.rng()));
|
|
546
|
+
const mat = fieldMaterial(field, BURN_FRAG, {
|
|
547
|
+
...shared, uColor: { value: hex(cfg.color) }, uColor2: { value: hex(cfg.color2) }, uOpacity: { value: 1 }, uChar: { value: cfg.char },
|
|
548
|
+
uEmber: { value: cfg.ember }, uSinge: { value: cfg.singe }, uLace: { value: cfg.ashLace }, uCurl: { value: cfg.curl }, uEmb: { value: embers },
|
|
549
|
+
}, { extra: BURN_COMMON });
|
|
550
|
+
const quad = fieldQuad(field, mat);
|
|
551
|
+
const geo = sparkGeometry(map);
|
|
552
|
+
const smat = new THREE.ShaderMaterial({
|
|
553
|
+
uniforms: { ...mat.uniforms, uScale: { value: 800 }, uSize: { value: 0.016 } },
|
|
554
|
+
vertexShader: SPARK_VERT, fragmentShader: SPARK_FRAG, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
555
|
+
});
|
|
556
|
+
// uniforms shared by reference with the quad: one push point
|
|
557
|
+
for (const k of Object.keys(mat.uniforms))
|
|
558
|
+
smat.uniforms[k] = mat.uniforms[k];
|
|
559
|
+
smat.uniforms.uScale = { value: 800 };
|
|
560
|
+
smat.uniforms.uSize = { value: 0.016 };
|
|
561
|
+
const pts = new THREE.Points(geo, smat);
|
|
562
|
+
pts.frustumCulled = false;
|
|
563
|
+
const group = new THREE.Group();
|
|
564
|
+
group.add(quad, pts);
|
|
565
|
+
const Tmax = map.Tmax;
|
|
566
|
+
const api = {
|
|
567
|
+
object: group,
|
|
568
|
+
apply(c) {
|
|
569
|
+
const u = mat.uniforms;
|
|
570
|
+
u.uColor.value.set(c.color);
|
|
571
|
+
u.uColor2.value.set(c.color2);
|
|
572
|
+
u.uOpacity.value = c.opacity;
|
|
573
|
+
u.uChar.value = c.char;
|
|
574
|
+
u.uEmber.value = c.ember;
|
|
575
|
+
u.uSinge.value = c.singe;
|
|
576
|
+
u.uLace.value = c.ashLace;
|
|
577
|
+
u.uCurl.value = c.curl;
|
|
578
|
+
u.uRough.value = c.roughness;
|
|
579
|
+
// spread: fire speed vs. how long the remains linger. L = lifecycle length in erase progress (the front uses 1-L), so S.e = 1 always finishes.
|
|
580
|
+
const L = Math.max(0.12, Math.min(0.62, 0.12 + 0.22 * c.spread));
|
|
581
|
+
u.uL.value = L;
|
|
582
|
+
u.uV.value = Tmax / (1 - L);
|
|
583
|
+
},
|
|
584
|
+
update(S, time, px) {
|
|
585
|
+
setReveal(mat.uniforms, S, infoD, infoE, anim.draw.duration, time);
|
|
586
|
+
smat.uniforms.uScale.value = px;
|
|
587
|
+
},
|
|
588
|
+
dispose() { field.dispose(); map.tex.dispose(); mat.dispose(); quad.geometry.dispose(); geo.dispose(); smat.dispose(); },
|
|
589
|
+
};
|
|
590
|
+
api.apply(cfg);
|
|
591
|
+
return api;
|
|
592
|
+
},
|
|
593
|
+
};
|