@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,349 @@
|
|
|
1
|
+
// Stamp trails — the object leaves copies of ITSELF where it was, and each copy turns
|
|
2
|
+
// into something and goes away in place (smoke, ash, sand, a hologram, voxels, shards,
|
|
3
|
+
// ink, frost, its wireframe). The shared machine for all of them:
|
|
4
|
+
//
|
|
5
|
+
// stamps while the object moves, a stamp is laid each time it has travelled
|
|
6
|
+
// `spacing`: its world matrix and the time. A stamp ages 0 → 1 over the
|
|
7
|
+
// style's life and is dropped at 1. Standing still lays nothing.
|
|
8
|
+
//
|
|
9
|
+
// meshStamp draws the object's OWN meshes at each stamp — instanced per mesh,
|
|
10
|
+
// sharing the mesh's attributes (no copy of the geometry). The style
|
|
11
|
+
// writes a vertex body (move wp / n by age) and a fragment body (stpOut).
|
|
12
|
+
//
|
|
13
|
+
// slotStamp draws geometry DERIVED from the object (surface grains, voxels, Voronoi
|
|
14
|
+
// shards, mesh edges) built once in the object's root space, repeated per
|
|
15
|
+
// stamp in one draw: each instance is (element × stamp slot), and the stamp
|
|
16
|
+
// matrices / ages / seeds are uniform arrays indexed by slot.
|
|
17
|
+
//
|
|
18
|
+
// Shader inputs common to both (prefix Stp):
|
|
19
|
+
// vertex aStpAge, aStpSeed (per stamp), L (object-local position, in object sizes),
|
|
20
|
+
// wp (world position), n (world normal), uStpSpan, uStpTime, uStpSize,
|
|
21
|
+
// uStpAmount, uStpFloor (world y of the floor under the object)
|
|
22
|
+
// fragment age, n, v (to camera), vStpW (world), vStpL (object-local, sizes),
|
|
23
|
+
// vStpSeed, uStpC1 / C2 / C3 (the style's colours, linear), uStpOpacity;
|
|
24
|
+
// write stpOut = vec4(colour, alpha) — straight alpha for both blend modes.
|
|
25
|
+
import { AdditiveBlending, BufferGeometry, Color, DoubleSide, InstancedBufferAttribute, InstancedBufferGeometry, InstancedMesh, LineSegments, Matrix4, Mesh, NormalBlending, Points, ShaderMaterial, Vector2, } from 'three';
|
|
26
|
+
import { SceneStore } from '@3driseai/3drise-core';
|
|
27
|
+
export const MAX_STAMPS = 24;
|
|
28
|
+
const MAX_MESHES = 24;
|
|
29
|
+
export const defaultTiming = (lifeScale) => ({
|
|
30
|
+
life: ctx => Math.max(0.5, ctx.p.length * lifeScale),
|
|
31
|
+
spacing: ctx => 0.34 - 0.26 * ctx.p.amount,
|
|
32
|
+
});
|
|
33
|
+
class Stamps {
|
|
34
|
+
list = [];
|
|
35
|
+
lastP = null;
|
|
36
|
+
update(ctx, timing) {
|
|
37
|
+
const e = ctx.world.elements;
|
|
38
|
+
const p = [e[12], e[13], e[14]];
|
|
39
|
+
const moved = this.lastP ? Math.hypot(p[0] - this.lastP[0], p[1] - this.lastP[1], p[2] - this.lastP[2]) : Infinity;
|
|
40
|
+
if (ctx.env.v > 0.01 && ctx.speed > 0.15 && moved > timing.spacing(ctx) * ctx.span) {
|
|
41
|
+
this.list.push({ m: ctx.world.clone(), t: ctx.now, seed: Math.random() });
|
|
42
|
+
if (this.list.length > MAX_STAMPS)
|
|
43
|
+
this.list.shift();
|
|
44
|
+
this.lastP = p;
|
|
45
|
+
}
|
|
46
|
+
else if (ctx.speed <= 0.15)
|
|
47
|
+
this.lastP = p; // standing still: the next move starts fresh
|
|
48
|
+
const life = timing.life(ctx);
|
|
49
|
+
while (this.list.length && ctx.now - this.list[0].t > life)
|
|
50
|
+
this.list.shift();
|
|
51
|
+
}
|
|
52
|
+
age(ctx, s, timing) { return Math.min(0.999, Math.max(0.0005, (ctx.now - s.t) / timing.life(ctx))); }
|
|
53
|
+
reset() { this.list.length = 0; this.lastP = null; }
|
|
54
|
+
alive(ctx, timing) { return this.list.length > 0 && ctx.now - this.list[this.list.length - 1].t < timing.life(ctx); }
|
|
55
|
+
}
|
|
56
|
+
// ---------------------------------------------------------------- GLSL
|
|
57
|
+
export const STP_NOISE = /* glsl */ `
|
|
58
|
+
float stpH(vec3 p) { p = fract(p * 0.3183099 + 0.1); p *= 17.0; return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); }
|
|
59
|
+
float stpN(vec3 x) {
|
|
60
|
+
vec3 i = floor(x), f = fract(x); f = f * f * (3.0 - 2.0 * f);
|
|
61
|
+
return mix(mix(mix(stpH(i), stpH(i + vec3(1, 0, 0)), f.x), mix(stpH(i + vec3(0, 1, 0)), stpH(i + vec3(1, 1, 0)), f.x), f.y),
|
|
62
|
+
mix(mix(stpH(i + vec3(0, 0, 1)), stpH(i + vec3(1, 0, 1)), f.x), mix(stpH(i + vec3(0, 1, 1)), stpH(i + vec3(1, 1, 1)), f.x), f.y), f.z);
|
|
63
|
+
}
|
|
64
|
+
float stpFbm(vec3 p) { return 0.55 * stpN(p) + 0.3 * stpN(p * 2.07 + 3.1) + 0.15 * stpN(p * 4.13 + 7.7); }
|
|
65
|
+
vec3 stpHash3(vec3 p) {
|
|
66
|
+
p = vec3(dot(p, vec3(127.1, 311.7, 74.7)), dot(p, vec3(269.5, 183.3, 246.1)), dot(p, vec3(113.5, 271.9, 124.6)));
|
|
67
|
+
return fract(sin(p) * 43758.5453123);
|
|
68
|
+
}
|
|
69
|
+
// cellular: (F1, F2, cell id)
|
|
70
|
+
vec3 stpWorley(vec3 p) {
|
|
71
|
+
vec3 i = floor(p), f = fract(p);
|
|
72
|
+
float f1 = 8.0, f2 = 8.0, id = 0.0;
|
|
73
|
+
for (int z = -1; z <= 1; z++) for (int y = -1; y <= 1; y++) for (int x = -1; x <= 1; x++) {
|
|
74
|
+
vec3 g = vec3(float(x), float(y), float(z));
|
|
75
|
+
vec3 h = stpHash3(i + g);
|
|
76
|
+
vec3 r = g + h - f;
|
|
77
|
+
float d = dot(r, r);
|
|
78
|
+
if (d < f1) { f2 = f1; f1 = d; id = h.x; } else if (d < f2) f2 = d;
|
|
79
|
+
}
|
|
80
|
+
return vec3(sqrt(f1), sqrt(f2), id);
|
|
81
|
+
}
|
|
82
|
+
mat3 stpRot(vec3 ax, float an) {
|
|
83
|
+
float s = sin(an), c = cos(an), oc = 1.0 - c;
|
|
84
|
+
return mat3(oc*ax.x*ax.x + c, oc*ax.x*ax.y + ax.z*s, oc*ax.z*ax.x - ax.y*s,
|
|
85
|
+
oc*ax.x*ax.y - ax.z*s, oc*ax.y*ax.y + c, oc*ax.y*ax.z + ax.x*s,
|
|
86
|
+
oc*ax.z*ax.x + ax.y*s, oc*ax.y*ax.z - ax.x*s, oc*ax.z*ax.z + c);
|
|
87
|
+
}`;
|
|
88
|
+
const COMMON_UNIFORMS = `
|
|
89
|
+
uniform float uStpSpan;
|
|
90
|
+
uniform float uStpTime;
|
|
91
|
+
uniform float uStpSize;
|
|
92
|
+
uniform float uStpAmount;
|
|
93
|
+
uniform float uStpFloor;
|
|
94
|
+
uniform float uStpOpacity;
|
|
95
|
+
uniform vec3 uStpC1;
|
|
96
|
+
uniform vec3 uStpC2;
|
|
97
|
+
uniform vec3 uStpC3;
|
|
98
|
+
uniform vec2 uStpRes;
|
|
99
|
+
varying float vStpAge;
|
|
100
|
+
varying float vStpSeed;
|
|
101
|
+
varying vec3 vStpW;
|
|
102
|
+
varying vec3 vStpN;
|
|
103
|
+
varying vec3 vStpV;
|
|
104
|
+
varying vec3 vStpL;`;
|
|
105
|
+
function fragment(pars, body, points = false) {
|
|
106
|
+
return /* glsl */ `
|
|
107
|
+
${COMMON_UNIFORMS}
|
|
108
|
+
${STP_NOISE}
|
|
109
|
+
${pars}
|
|
110
|
+
void main() {
|
|
111
|
+
float age = vStpAge;
|
|
112
|
+
if (age <= 0.0 || age >= 1.0) discard;
|
|
113
|
+
vec3 n = normalize(vStpN);
|
|
114
|
+
vec3 v = normalize(vStpV);
|
|
115
|
+
${points ? 'vec2 pc = gl_PointCoord * 2.0 - 1.0;' : ''}
|
|
116
|
+
vec4 stpOut = vec4(0.0);
|
|
117
|
+
${body}
|
|
118
|
+
if (stpOut.a < 0.004) discard;
|
|
119
|
+
gl_FragColor = stpOut;
|
|
120
|
+
#include <tonemapping_fragment>
|
|
121
|
+
#include <colorspace_fragment>
|
|
122
|
+
}`;
|
|
123
|
+
}
|
|
124
|
+
function makeUniforms(ctx, extra = {}) {
|
|
125
|
+
return {
|
|
126
|
+
uStpSpan: { value: ctx.span }, uStpTime: { value: 0 }, uStpSize: { value: 0 }, uStpAmount: { value: 0 },
|
|
127
|
+
uStpFloor: { value: ctx.floor }, uStpOpacity: { value: 0 },
|
|
128
|
+
uStpC1: { value: new Color() }, uStpC2: { value: new Color() }, uStpC3: { value: new Color() },
|
|
129
|
+
uStpRes: { value: new Vector2(1280, 720) },
|
|
130
|
+
...extra,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function syncUniforms(u, ctx, opacityScale) {
|
|
134
|
+
u.uStpTime.value = ctx.now;
|
|
135
|
+
u.uStpSize.value = ctx.p.size;
|
|
136
|
+
u.uStpAmount.value = ctx.p.amount;
|
|
137
|
+
u.uStpOpacity.value = Math.min(1.5, ctx.p.opacity * opacityScale) * ctx.env.v;
|
|
138
|
+
u.uStpC1.value.copy(ctx.p.color);
|
|
139
|
+
u.uStpC2.value.copy(ctx.p.color2);
|
|
140
|
+
u.uStpC3.value.copy(ctx.p.color3);
|
|
141
|
+
const gl = SceneStore.gl;
|
|
142
|
+
if (gl?.getDrawingBufferSize)
|
|
143
|
+
gl.getDrawingBufferSize(u.uStpRes.value);
|
|
144
|
+
}
|
|
145
|
+
export function meshStamp(cfg) {
|
|
146
|
+
const VERT = /* glsl */ `
|
|
147
|
+
attribute float aStpAge;
|
|
148
|
+
attribute float aStpSeed;
|
|
149
|
+
uniform mat4 uStpRel;
|
|
150
|
+
${COMMON_UNIFORMS}
|
|
151
|
+
${STP_NOISE}
|
|
152
|
+
${cfg.vertexPars ?? ''}
|
|
153
|
+
void main() {
|
|
154
|
+
vStpAge = aStpAge; vStpSeed = aStpSeed;
|
|
155
|
+
mat4 m = modelMatrix * instanceMatrix;
|
|
156
|
+
vec3 L = (uStpRel * vec4(position, 1.0)).xyz / uStpSpan; // object-local, in object sizes
|
|
157
|
+
vec4 wp = m * vec4(position, 1.0);
|
|
158
|
+
vec3 n = normalize(mat3(m) * normal);
|
|
159
|
+
${cfg.vertex}
|
|
160
|
+
vStpW = wp.xyz; vStpN = n; vStpL = L; vStpV = normalize(cameraPosition - wp.xyz);
|
|
161
|
+
gl_Position = projectionMatrix * viewMatrix * wp;
|
|
162
|
+
}`;
|
|
163
|
+
const FRAG = fragment(cfg.fragmentPars ?? '', cfg.fragment);
|
|
164
|
+
const state = new WeakMap();
|
|
165
|
+
const _rel = new Matrix4(), _rootInv = new Matrix4(), _w = new Matrix4();
|
|
166
|
+
return {
|
|
167
|
+
build(ctx) {
|
|
168
|
+
const meshes = [];
|
|
169
|
+
ctx.target.traverse((c) => {
|
|
170
|
+
if (c.isMesh && !c.isInstancedMesh && !c.userData?.__opFxHelper && c.geometry?.attributes?.position && c.geometry.attributes.normal && meshes.length < MAX_MESHES)
|
|
171
|
+
meshes.push(c);
|
|
172
|
+
});
|
|
173
|
+
const parts = [];
|
|
174
|
+
for (const m of meshes) {
|
|
175
|
+
const geo = new BufferGeometry();
|
|
176
|
+
for (const [name, attr] of Object.entries(m.geometry.attributes))
|
|
177
|
+
geo.setAttribute(name, attr);
|
|
178
|
+
geo.setIndex(m.geometry.index);
|
|
179
|
+
const age = new InstancedBufferAttribute(new Float32Array(MAX_STAMPS), 1);
|
|
180
|
+
const seed = new InstancedBufferAttribute(new Float32Array(MAX_STAMPS), 1);
|
|
181
|
+
geo.setAttribute('aStpAge', age);
|
|
182
|
+
geo.setAttribute('aStpSeed', seed);
|
|
183
|
+
const mat = new ShaderMaterial({
|
|
184
|
+
vertexShader: VERT, fragmentShader: FRAG,
|
|
185
|
+
uniforms: makeUniforms(ctx, { uStpRel: { value: new Matrix4() } }),
|
|
186
|
+
transparent: true, depthWrite: false, side: DoubleSide,
|
|
187
|
+
blending: cfg.additive ? AdditiveBlending : NormalBlending,
|
|
188
|
+
});
|
|
189
|
+
const inst = new InstancedMesh(geo, mat, MAX_STAMPS);
|
|
190
|
+
inst.count = 0;
|
|
191
|
+
inst.frustumCulled = false;
|
|
192
|
+
inst.raycast = () => undefined;
|
|
193
|
+
inst.renderOrder = 1;
|
|
194
|
+
inst.matrixAutoUpdate = false;
|
|
195
|
+
ctx.group.add(inst);
|
|
196
|
+
parts.push({ mesh: m, inst, age, seed, mat });
|
|
197
|
+
}
|
|
198
|
+
const stamps = new Stamps();
|
|
199
|
+
state.set(ctx, { parts, stamps });
|
|
200
|
+
ctx.onReset = () => stamps.reset();
|
|
201
|
+
},
|
|
202
|
+
update(ctx) {
|
|
203
|
+
const st = state.get(ctx);
|
|
204
|
+
if (!st)
|
|
205
|
+
return;
|
|
206
|
+
st.stamps.update(ctx, cfg);
|
|
207
|
+
const list = st.stamps.list, n = list.length;
|
|
208
|
+
_rootInv.copy(ctx.world).invert();
|
|
209
|
+
for (const c of st.parts) {
|
|
210
|
+
const u = c.mat.uniforms;
|
|
211
|
+
syncUniforms(u, ctx, cfg.opacity ?? 1);
|
|
212
|
+
c.mesh.updateWorldMatrix(true, false);
|
|
213
|
+
_rel.multiplyMatrices(_rootInv, c.mesh.matrixWorld); // the mesh inside the object, as it is now
|
|
214
|
+
u.uStpRel.value.copy(_rel);
|
|
215
|
+
for (let i = 0; i < n; i++) {
|
|
216
|
+
c.inst.setMatrixAt(i, _w.multiplyMatrices(list[i].m, _rel));
|
|
217
|
+
c.age.array[i] = st.stamps.age(ctx, list[i], cfg);
|
|
218
|
+
c.seed.array[i] = list[i].seed;
|
|
219
|
+
}
|
|
220
|
+
c.inst.count = n;
|
|
221
|
+
c.inst.instanceMatrix.needsUpdate = true;
|
|
222
|
+
c.age.needsUpdate = true;
|
|
223
|
+
c.seed.needsUpdate = true;
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
alive(ctx) { const st = state.get(ctx); return !!st && st.stamps.alive(ctx, cfg); },
|
|
227
|
+
dispose(ctx) {
|
|
228
|
+
const st = state.get(ctx);
|
|
229
|
+
if (!st)
|
|
230
|
+
return;
|
|
231
|
+
for (const c of st.parts) {
|
|
232
|
+
// the stamps share the object's own attributes: drop those first, so disposing frees only ours
|
|
233
|
+
const geo = c.inst.geometry;
|
|
234
|
+
for (const name of Object.keys(geo.attributes))
|
|
235
|
+
if (name !== 'aStpAge' && name !== 'aStpSeed')
|
|
236
|
+
geo.deleteAttribute(name);
|
|
237
|
+
geo.setIndex(null);
|
|
238
|
+
geo.dispose();
|
|
239
|
+
c.mat.dispose();
|
|
240
|
+
c.inst.dispose();
|
|
241
|
+
}
|
|
242
|
+
state.delete(ctx);
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
export function slotStamp(cfg) {
|
|
247
|
+
const points = cfg.kind === 'points';
|
|
248
|
+
const VERT = /* glsl */ `
|
|
249
|
+
attribute float aStpSlot;
|
|
250
|
+
uniform mat4 uStpMat[${MAX_STAMPS}];
|
|
251
|
+
uniform float uStpAgeA[${MAX_STAMPS}];
|
|
252
|
+
uniform float uStpSeedA[${MAX_STAMPS}];
|
|
253
|
+
uniform float uStpPx;
|
|
254
|
+
${COMMON_UNIFORMS}
|
|
255
|
+
${STP_NOISE}
|
|
256
|
+
${cfg.vertexPars ?? ''}
|
|
257
|
+
void main() {
|
|
258
|
+
int s = int(aStpSlot + 0.5);
|
|
259
|
+
float age = uStpAgeA[s];
|
|
260
|
+
float seed = uStpSeedA[s];
|
|
261
|
+
vStpAge = age; vStpSeed = seed;
|
|
262
|
+
vec3 lp = position;
|
|
263
|
+
${cfg.kind === 'lines' ? 'vec3 ln = vec3(0.0, 1.0, 0.0);' : 'vec3 ln = normal;'}
|
|
264
|
+
vec3 L = position / uStpSpan;
|
|
265
|
+
float stpSize = uStpPx;
|
|
266
|
+
${cfg.vertexLocal ?? ''}
|
|
267
|
+
mat4 m = uStpMat[s];
|
|
268
|
+
vec4 wp = m * vec4(lp, 1.0);
|
|
269
|
+
vec3 n = normalize(mat3(m) * ln);
|
|
270
|
+
${cfg.vertexWorld ?? ''}
|
|
271
|
+
vStpW = wp.xyz; vStpN = n; vStpL = L; vStpV = normalize(cameraPosition - wp.xyz);
|
|
272
|
+
gl_Position = projectionMatrix * viewMatrix * wp;
|
|
273
|
+
if (age <= 0.0 || age >= 1.0) gl_Position = vec4(2.0, 2.0, 2.0, 1.0); // an unused slot: off screen
|
|
274
|
+
${points ? 'gl_PointSize = stpSize;' : ''}
|
|
275
|
+
}`;
|
|
276
|
+
const FRAG = fragment(cfg.fragmentPars ?? '', cfg.fragment, points);
|
|
277
|
+
const state = new WeakMap();
|
|
278
|
+
return {
|
|
279
|
+
build(ctx) {
|
|
280
|
+
const d = cfg.derive(ctx);
|
|
281
|
+
const geo = new InstancedBufferGeometry();
|
|
282
|
+
for (const [name, attr] of Object.entries(d.geometry.attributes))
|
|
283
|
+
geo.setAttribute(name, attr);
|
|
284
|
+
if (d.geometry.index)
|
|
285
|
+
geo.setIndex(d.geometry.index);
|
|
286
|
+
const per = d.elements?.count ?? 1;
|
|
287
|
+
const total = per * MAX_STAMPS;
|
|
288
|
+
const slot = new Float32Array(total);
|
|
289
|
+
for (let s = 0; s < MAX_STAMPS; s++)
|
|
290
|
+
slot.fill(s, s * per, (s + 1) * per);
|
|
291
|
+
geo.setAttribute('aStpSlot', new InstancedBufferAttribute(slot, 1));
|
|
292
|
+
for (const [name, a] of Object.entries(d.elements?.attrs ?? {})) {
|
|
293
|
+
const arr = new Float32Array(total * a.itemSize);
|
|
294
|
+
for (let s = 0; s < MAX_STAMPS; s++)
|
|
295
|
+
arr.set(a.array, s * per * a.itemSize);
|
|
296
|
+
geo.setAttribute(name, new InstancedBufferAttribute(arr, a.itemSize));
|
|
297
|
+
}
|
|
298
|
+
geo.instanceCount = total;
|
|
299
|
+
const mat = new ShaderMaterial({
|
|
300
|
+
vertexShader: VERT, fragmentShader: FRAG,
|
|
301
|
+
uniforms: makeUniforms(ctx, {
|
|
302
|
+
uStpMat: { value: Array.from({ length: MAX_STAMPS }, () => new Matrix4()) },
|
|
303
|
+
uStpAgeA: { value: new Array(MAX_STAMPS).fill(0) },
|
|
304
|
+
uStpSeedA: { value: new Array(MAX_STAMPS).fill(0) },
|
|
305
|
+
uStpPx: { value: 2 },
|
|
306
|
+
}),
|
|
307
|
+
transparent: true, depthWrite: false, side: DoubleSide,
|
|
308
|
+
blending: cfg.additive ? AdditiveBlending : NormalBlending,
|
|
309
|
+
});
|
|
310
|
+
const obj = points ? new Points(geo, mat) : cfg.kind === 'lines' ? new LineSegments(geo, mat) : new Mesh(geo, mat);
|
|
311
|
+
obj.frustumCulled = false;
|
|
312
|
+
obj.raycast = () => undefined;
|
|
313
|
+
obj.renderOrder = 1;
|
|
314
|
+
obj.matrixAutoUpdate = false;
|
|
315
|
+
ctx.group.add(obj);
|
|
316
|
+
const stamps = new Stamps();
|
|
317
|
+
state.set(ctx, { obj, mat, stamps });
|
|
318
|
+
ctx.onReset = () => stamps.reset();
|
|
319
|
+
d.geometry.dispose?.();
|
|
320
|
+
},
|
|
321
|
+
update(ctx) {
|
|
322
|
+
const st = state.get(ctx);
|
|
323
|
+
if (!st)
|
|
324
|
+
return;
|
|
325
|
+
st.stamps.update(ctx, cfg);
|
|
326
|
+
const u = st.mat.uniforms;
|
|
327
|
+
syncUniforms(u, ctx, cfg.opacity ?? 1);
|
|
328
|
+
const gl = SceneStore.gl;
|
|
329
|
+
u.uStpPx.value = (1.6 + ctx.p.size * 3.2) * (gl?.getPixelRatio?.() || 1);
|
|
330
|
+
const list = st.stamps.list;
|
|
331
|
+
for (let s = 0; s < MAX_STAMPS; s++) {
|
|
332
|
+
const stamp = list[s];
|
|
333
|
+
u.uStpAgeA.value[s] = stamp ? st.stamps.age(ctx, stamp, cfg) : 0;
|
|
334
|
+
u.uStpSeedA.value[s] = stamp ? stamp.seed : 0;
|
|
335
|
+
if (stamp)
|
|
336
|
+
u.uStpMat.value[s].copy(stamp.m);
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
alive(ctx) { const st = state.get(ctx); return !!st && st.stamps.alive(ctx, cfg); },
|
|
340
|
+
dispose(ctx) {
|
|
341
|
+
const st = state.get(ctx);
|
|
342
|
+
if (!st)
|
|
343
|
+
return;
|
|
344
|
+
st.obj.geometry.dispose();
|
|
345
|
+
st.mat.dispose();
|
|
346
|
+
state.delete(ctx);
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailStreaks.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/trailStreaks.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA0ClH,eAAO,MAAM,OAAO,EAAE,UA6ErB,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Streaks — thin camera-facing light ribbons pulled from points spread over the
|
|
2
|
+
// object's surface (farthest-point picks), each point carried back through the
|
|
3
|
+
// object's recent poses. They taper and fade along their length; a segment that
|
|
4
|
+
// does not move draws nothing. Ribbon edges are anti-aliased in the shader; colour
|
|
5
|
+
// runs from Colour at the head to Tail colour.
|
|
6
|
+
// Length × 1 (seconds of history); amount = how many ribbons; size = width.
|
|
7
|
+
import { AdditiveBlending, BufferAttribute, BufferGeometry, Color, DoubleSide, Matrix4, Mesh, Quaternion, ShaderMaterial, Vector3 } from 'three';
|
|
8
|
+
import { GLSL_AA, poseAgo, smooth, spreadPoints } from './trailCore.js';
|
|
9
|
+
const PTS = 40;
|
|
10
|
+
const VERT = /* glsl */ `
|
|
11
|
+
attribute float aTrlAlpha;
|
|
12
|
+
attribute float aTrlSide;
|
|
13
|
+
attribute float aTrlT;
|
|
14
|
+
varying float vTrlA;
|
|
15
|
+
varying float vTrlS;
|
|
16
|
+
varying float vTrlT;
|
|
17
|
+
void main() {
|
|
18
|
+
vTrlA = aTrlAlpha;
|
|
19
|
+
vTrlS = aTrlSide;
|
|
20
|
+
vTrlT = aTrlT;
|
|
21
|
+
gl_Position = projectionMatrix * viewMatrix * vec4(position, 1.0);
|
|
22
|
+
}`;
|
|
23
|
+
const FRAG = /* glsl */ `
|
|
24
|
+
uniform vec3 uTrlColor;
|
|
25
|
+
uniform vec3 uTrlColor2;
|
|
26
|
+
uniform float uTrlOpacity;
|
|
27
|
+
varying float vTrlA;
|
|
28
|
+
varying float vTrlS;
|
|
29
|
+
varying float vTrlT;
|
|
30
|
+
${GLSL_AA}
|
|
31
|
+
void main() {
|
|
32
|
+
// a crisp ribbon: a bright core and an anti-aliased edge (no blur)
|
|
33
|
+
float edge = trlAA(abs(vTrlS) - 0.82);
|
|
34
|
+
float core = 1.0 - smoothstep(0.0, 0.7, abs(vTrlS));
|
|
35
|
+
float a = vTrlA * uTrlOpacity * edge * (0.55 + 0.45 * core);
|
|
36
|
+
if (a < 0.002) discard;
|
|
37
|
+
vec3 col = mix(uTrlColor, uTrlColor2, vTrlT); // colour at the head → tail colour
|
|
38
|
+
gl_FragColor = vec4(col * (0.8 + 0.7 * core) * a, a);
|
|
39
|
+
#include <tonemapping_fragment>
|
|
40
|
+
#include <colorspace_fragment>
|
|
41
|
+
}`;
|
|
42
|
+
const state = new WeakMap();
|
|
43
|
+
const _a = { t: 0, p: new Vector3(), q: new Quaternion(), s: new Vector3() };
|
|
44
|
+
const _w = new Matrix4(), _prev = new Vector3(), _next = new Vector3(), _dir = new Vector3(), _side = new Vector3(), _view = new Vector3();
|
|
45
|
+
export const streaks = {
|
|
46
|
+
build(ctx) {
|
|
47
|
+
const anchors = spreadPoints(ctx.target, Math.round(4 + ctx.p.amount * 14));
|
|
48
|
+
const K = anchors.length, M = PTS;
|
|
49
|
+
const geo = new BufferGeometry();
|
|
50
|
+
const pos = new BufferAttribute(new Float32Array(K * M * 2 * 3), 3);
|
|
51
|
+
const alpha = new BufferAttribute(new Float32Array(K * M * 2), 1);
|
|
52
|
+
const side = new BufferAttribute(new Float32Array(K * M * 2), 1);
|
|
53
|
+
const tAt = new BufferAttribute(new Float32Array(K * M * 2), 1);
|
|
54
|
+
for (let i = 0; i < K * M; i++) {
|
|
55
|
+
side.array[i * 2] = -1;
|
|
56
|
+
side.array[i * 2 + 1] = 1;
|
|
57
|
+
tAt.array[i * 2] = tAt.array[i * 2 + 1] = (i % M) / (M - 1);
|
|
58
|
+
}
|
|
59
|
+
const idx = [];
|
|
60
|
+
for (let k = 0; k < K; k++)
|
|
61
|
+
for (let j = 0; j < M - 1; j++) {
|
|
62
|
+
const a = (k * M + j) * 2;
|
|
63
|
+
idx.push(a, a + 1, a + 2, a + 1, a + 3, a + 2);
|
|
64
|
+
}
|
|
65
|
+
geo.setIndex(idx);
|
|
66
|
+
geo.setAttribute('position', pos);
|
|
67
|
+
geo.setAttribute('aTrlAlpha', alpha);
|
|
68
|
+
geo.setAttribute('aTrlSide', side);
|
|
69
|
+
geo.setAttribute('aTrlT', tAt);
|
|
70
|
+
pos.setUsage(35048);
|
|
71
|
+
alpha.setUsage(35048);
|
|
72
|
+
const mesh = new Mesh(geo, new ShaderMaterial({
|
|
73
|
+
vertexShader: VERT, fragmentShader: FRAG,
|
|
74
|
+
uniforms: { uTrlColor: { value: new Color() }, uTrlColor2: { value: new Color() }, uTrlOpacity: { value: ctx.p.opacity } },
|
|
75
|
+
transparent: true, depthWrite: false, blending: AdditiveBlending, side: DoubleSide,
|
|
76
|
+
}));
|
|
77
|
+
mesh.frustumCulled = false;
|
|
78
|
+
mesh.raycast = () => undefined;
|
|
79
|
+
mesh.renderOrder = 2;
|
|
80
|
+
ctx.group.add(mesh);
|
|
81
|
+
state.set(ctx, {
|
|
82
|
+
mesh, pos, alpha, anchors,
|
|
83
|
+
pts: Array.from({ length: K }, () => Array.from({ length: M }, () => new Vector3())),
|
|
84
|
+
ok: new Array(M).fill(false),
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
update(ctx) {
|
|
88
|
+
const st = state.get(ctx);
|
|
89
|
+
if (!st)
|
|
90
|
+
return;
|
|
91
|
+
const u = st.mesh.material.uniforms;
|
|
92
|
+
u.uTrlOpacity.value = ctx.p.opacity * 1.6;
|
|
93
|
+
u.uTrlColor.value.copy(ctx.p.color);
|
|
94
|
+
u.uTrlColor2.value.copy(ctx.p.color2);
|
|
95
|
+
const K = st.anchors.length, M = PTS;
|
|
96
|
+
const len = ctx.p.length;
|
|
97
|
+
const width = (0.006 + ctx.p.size * 0.05) * ctx.span;
|
|
98
|
+
const P = st.pos.array, A = st.alpha.array;
|
|
99
|
+
for (let j = 0; j < M; j++) {
|
|
100
|
+
st.ok[j] = poseAgo(ctx, (len * j) / (M - 1), _a);
|
|
101
|
+
_w.compose(_a.p, _a.q, _a.s);
|
|
102
|
+
for (let k = 0; k < K; k++)
|
|
103
|
+
st.pts[k][j].copy(st.anchors[k]).applyMatrix4(_w);
|
|
104
|
+
}
|
|
105
|
+
for (let k = 0; k < K; k++) {
|
|
106
|
+
for (let j = 0; j < M; j++) {
|
|
107
|
+
const cur = st.pts[k][j];
|
|
108
|
+
_prev.copy(st.pts[k][Math.max(0, j - 1)]);
|
|
109
|
+
_next.copy(st.pts[k][Math.min(M - 1, j + 1)]);
|
|
110
|
+
_dir.subVectors(_prev, _next);
|
|
111
|
+
const seg = _dir.length();
|
|
112
|
+
if (ctx.cam)
|
|
113
|
+
_view.subVectors(ctx.cam, cur).normalize();
|
|
114
|
+
else
|
|
115
|
+
_view.set(0, 0, 1);
|
|
116
|
+
_side.crossVectors(_dir, _view);
|
|
117
|
+
if (_side.lengthSq() < 1e-12)
|
|
118
|
+
_side.set(0, 1, 0);
|
|
119
|
+
else
|
|
120
|
+
_side.normalize();
|
|
121
|
+
const t = j / (M - 1);
|
|
122
|
+
const w = width * (1 - 0.8 * t);
|
|
123
|
+
const i = (k * M + j) * 2;
|
|
124
|
+
P[i * 3] = cur.x - _side.x * w;
|
|
125
|
+
P[i * 3 + 1] = cur.y - _side.y * w;
|
|
126
|
+
P[i * 3 + 2] = cur.z - _side.z * w;
|
|
127
|
+
P[i * 3 + 3] = cur.x + _side.x * w;
|
|
128
|
+
P[i * 3 + 4] = cur.y + _side.y * w;
|
|
129
|
+
P[i * 3 + 5] = cur.z + _side.z * w;
|
|
130
|
+
const moving = smooth(0.002, 0.03, (seg * (M - 1)) / (2 * ctx.span));
|
|
131
|
+
const a = st.ok[j] ? ctx.env.v * Math.pow(1 - t, 1.6) * moving : 0;
|
|
132
|
+
A[i] = a;
|
|
133
|
+
A[i + 1] = a;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
st.pos.needsUpdate = true;
|
|
137
|
+
st.alpha.needsUpdate = true;
|
|
138
|
+
},
|
|
139
|
+
dispose(ctx) {
|
|
140
|
+
const st = state.get(ctx);
|
|
141
|
+
if (!st)
|
|
142
|
+
return;
|
|
143
|
+
st.mesh.geometry.dispose();
|
|
144
|
+
st.mesh.material.dispose();
|
|
145
|
+
state.delete(ctx);
|
|
146
|
+
},
|
|
147
|
+
};
|
|
@@ -50,6 +50,26 @@ export interface FieldState {
|
|
|
50
50
|
sweep: {
|
|
51
51
|
value: Vector3;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* 1 = the object is drawn only where the effect has painted it (`__reveal`: the effect
|
|
55
|
+
* follows the object's visibility — see `presence` in types.ts). Each effect's own
|
|
56
|
+
* shader decides what "painted" means.
|
|
57
|
+
*/
|
|
58
|
+
reveal: {
|
|
59
|
+
value: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Direct handover: 0..1, the progress of the look that is replacing this one. Where its
|
|
63
|
+
* front has passed (a little behind it, `clearEdge`), this look is gone — see goneGlsl.
|
|
64
|
+
* The controller copies the incoming look's direction / scale / sweep into this state
|
|
65
|
+
* while it wipes, so the two fronts are the same front.
|
|
66
|
+
*/
|
|
67
|
+
clear: {
|
|
68
|
+
value: number;
|
|
69
|
+
};
|
|
70
|
+
clearEdge: {
|
|
71
|
+
value: number;
|
|
72
|
+
};
|
|
53
73
|
}
|
|
54
74
|
/** Bounds of `root` in its own (root-local) space. */
|
|
55
75
|
export declare function localBounds(root: Object3D): Box3;
|
|
@@ -68,6 +88,8 @@ export declare function screenRight(root: Object3D, ctx?: {
|
|
|
68
88
|
* left → right / right → left directions can be taken from the screen at trigger.
|
|
69
89
|
*/
|
|
70
90
|
export declare function setFieldParams(st: FieldState, p: Record<string, unknown>, root?: Object3D, ctx?: any): void;
|
|
91
|
+
/** `__reveal` on: only what the effect has painted is drawn. Set on every apply and revert. */
|
|
92
|
+
export declare const setReveal: (st: FieldState, p: Record<string, unknown>) => void;
|
|
71
93
|
export declare const syncRoot: (root: Object3D, st: FieldState) => void;
|
|
72
94
|
/** The field's uniforms under a prefix: `u<P>Progress`, `u<P>RootInv`, … */
|
|
73
95
|
export declare function fieldUniforms(P: string, st: FieldState): Record<string, {
|
|
@@ -81,6 +103,14 @@ export declare function fieldUniforms(P: string, st: FieldState): Record<string,
|
|
|
81
103
|
* Calm, low-frequency fBm — stretched so the front moves evenly over the whole run.
|
|
82
104
|
*/
|
|
83
105
|
export declare const fieldGlsl: (P: string) => string;
|
|
106
|
+
/**
|
|
107
|
+
* GLSL for take-overs that can be wiped (after fieldGlsl):
|
|
108
|
+
* <P>Gone(vec3 q) → 1 where the look that replaces this one has fully arrived
|
|
109
|
+
* The wipe front is the incoming look's own front (same field, its progress in u<P>Clear),
|
|
110
|
+
* trailing by the incoming edge width — so the old look goes exactly where the new one is
|
|
111
|
+
* complete, and the object underneath never shows.
|
|
112
|
+
*/
|
|
113
|
+
export declare const goneGlsl: (P: string) => string;
|
|
84
114
|
/** Whether a field state is holding (tests / debugging). */
|
|
85
115
|
export declare const isHolding: (st: FieldState) => boolean;
|
|
86
116
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitionField.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/transitionField.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,eAAO,MAAM,iBAAiB;;;GAO7B,CAAC;AACF,0FAA0F;AAC1F,eAAO,MAAM,aAAa;;;GAA8E,CAAC;AAGzG,MAAM,WAAW,UAAU;IACvB,yFAAyF;IACzF,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5B,SAAS,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9B,UAAU,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/B,0EAA0E;IAC1E,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAC5B;;;;OAIG;IACH,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"transitionField.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/transitionField.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC,eAAO,MAAM,iBAAiB;;;GAO7B,CAAC;AACF,0FAA0F;AAC1F,eAAO,MAAM,aAAa;;;GAA8E,CAAC;AAGzG,MAAM,WAAW,UAAU;IACvB,yFAAyF;IACzF,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5B,SAAS,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9B,UAAU,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/B,0EAA0E;IAC1E,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAC5B;;;;OAIG;IACH,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC1B;;;;OAIG;IACH,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAchD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAU3D;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM;YAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YAAC,MAAM,EAAE,MAAM,EAAE,CAAA;SAAE,GAAG,IAAI,CAAA;KAAE,CAAA;CAAE,GAAG,OAAO,CAW7I;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,GAAG,QAcpG;AAED,+FAA+F;AAC/F,eAAO,MAAM,SAAS,GAAI,IAAI,UAAU,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAAuD,CAAC;AAE5H,eAAO,MAAM,QAAQ,GAAI,MAAM,QAAQ,EAAE,IAAI,UAAU,SAGtD,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAQ3F;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,WAoBlC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,WAMjC,CAAC;AA4BF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,GAAI,IAAI,UAAU,YAAkB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAC1C,IAAI,EAAE;IACF,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/E,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,GACF,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAgB;;eAhJzB,OAAO;;;;;EAyKxF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,QAOxE;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAKnD"}
|
|
@@ -61,6 +61,7 @@ export function createFieldState(root) {
|
|
|
61
61
|
boundsMin: { value: b.min.clone() }, boundsSize: { value: size }, extent: { value: Math.max(size.length(), 1e-3) },
|
|
62
62
|
scale: { value: 3 }, direction: { value: 0 }, edgeWidth: { value: 0.08 }, edgeColor: { value: new Color('#ff7a2e') },
|
|
63
63
|
sweep: { value: new Vector3(1, 0, 0) },
|
|
64
|
+
reveal: { value: 0 }, clear: { value: 0 }, clearEdge: { value: 0.05 },
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
/** The camera's screen-right, in `root`'s local space (world X when there is no camera). */
|
|
@@ -82,6 +83,8 @@ export function screenRight(root, ctx) {
|
|
|
82
83
|
* left → right / right → left directions can be taken from the screen at trigger.
|
|
83
84
|
*/
|
|
84
85
|
export function setFieldParams(st, p, root, ctx) {
|
|
86
|
+
setReveal(st, p);
|
|
87
|
+
st.clear.value = 0; // applied again: whatever was wiping it is over
|
|
85
88
|
if (p.direction !== undefined) {
|
|
86
89
|
const d = String(p.direction);
|
|
87
90
|
st.direction.value = Math.max(0, DIRECTIONS.indexOf(d));
|
|
@@ -97,6 +100,8 @@ export function setFieldParams(st, p, root, ctx) {
|
|
|
97
100
|
if (p.edgeColor !== undefined)
|
|
98
101
|
st.edgeColor.value.set(String(p.edgeColor));
|
|
99
102
|
}
|
|
103
|
+
/** `__reveal` on: only what the effect has painted is drawn. Set on every apply and revert. */
|
|
104
|
+
export const setReveal = (st, p) => { st.reveal.value = p.__reveal === true ? 1 : 0; };
|
|
100
105
|
export const syncRoot = (root, st) => {
|
|
101
106
|
root.updateWorldMatrix(true, false);
|
|
102
107
|
st.rootInv.value.copy(root.matrixWorld).invert();
|
|
@@ -108,6 +113,7 @@ export function fieldUniforms(P, st) {
|
|
|
108
113
|
[`u${P}Min`]: st.boundsMin, [`u${P}Size`]: st.boundsSize, [`u${P}Extent`]: st.extent,
|
|
109
114
|
[`u${P}Scale`]: st.scale, [`u${P}Direction`]: st.direction,
|
|
110
115
|
[`u${P}EdgeWidth`]: st.edgeWidth, [`u${P}EdgeColor`]: st.edgeColor, [`u${P}Sweep`]: st.sweep,
|
|
116
|
+
[`u${P}Reveal`]: st.reveal, [`u${P}Clear`]: st.clear, [`u${P}ClearEdge`]: st.clearEdge,
|
|
111
117
|
};
|
|
112
118
|
}
|
|
113
119
|
/**
|
|
@@ -138,6 +144,20 @@ float ${P}Threshold() { return clamp(u${P}Progress, 0.0, 1.0) * (1.0 + 2.0 * u${
|
|
|
138
144
|
// progress at which the front reaches field value f (inverse of Threshold)
|
|
139
145
|
float ${P}BirthOf(float f) { return (f + u${P}EdgeWidth) / (1.0 + 2.0 * u${P}EdgeWidth); }
|
|
140
146
|
`;
|
|
147
|
+
/**
|
|
148
|
+
* GLSL for take-overs that can be wiped (after fieldGlsl):
|
|
149
|
+
* <P>Gone(vec3 q) → 1 where the look that replaces this one has fully arrived
|
|
150
|
+
* The wipe front is the incoming look's own front (same field, its progress in u<P>Clear),
|
|
151
|
+
* trailing by the incoming edge width — so the old look goes exactly where the new one is
|
|
152
|
+
* complete, and the object underneath never shows.
|
|
153
|
+
*/
|
|
154
|
+
export const goneGlsl = (P) => /* glsl */ `
|
|
155
|
+
float ${P}Gone(vec3 q) {
|
|
156
|
+
if (u${P}Clear <= 0.0) return 0.0;
|
|
157
|
+
float t = clamp(u${P}Clear, 0.0, 1.0) * (1.0 + 2.0 * u${P}ClearEdge) - u${P}ClearEdge;
|
|
158
|
+
return step(u${P}ClearEdge, t - ${P}Field(q));
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
141
161
|
// ---------------------------------------------------------------- hold clock
|
|
142
162
|
/** Field states holding their finished state → their root. One ticker drives them all. */
|
|
143
163
|
const holds = new Map();
|
|
@@ -238,6 +258,7 @@ export function surfaceLayer(P, st, edge = 'ember') {
|
|
|
238
258
|
v${P}Q = ${P}Norm((u${P}RootInv * modelMatrix * vec4(transformed, 1.0)).xyz);`,
|
|
239
259
|
fragment: /* glsl */ `
|
|
240
260
|
{
|
|
261
|
+
if (u${P}Reveal > 0.5) discard; // revealed by its particles alone
|
|
241
262
|
float ${P}D = ${P}Field(v${P}Q) - ${P}Threshold();
|
|
242
263
|
if (${P}D < 0.0) discard;
|
|
243
264
|
float ${P}E = 1.0 - smoothstep(0.0, u${P}EdgeWidth, ${P}D);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turnAway.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/turnAway.ts"],"names":[],"mappings":";AA6BA,wBA4BG"}
|