@3driseai/3drise-viewer 0.1.41 → 0.1.43
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/ClipsRuntime.d.ts +16 -1
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +144 -25
- package/dist/animationsV2/appliers.d.ts +9 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +62 -2
- package/dist/animationsV2/clipUtils.d.ts +30 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -1
- package/dist/animationsV2/clipUtils.js +163 -17
- package/dist/animationsV2/elementSettings.d.ts +5 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -1
- package/dist/animationsV2/elementSettings.js +6 -3
- package/dist/animationsV2/sequenceUtils.js +4 -4
- package/dist/animationsV2/types.d.ts +23 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +2 -2
- package/dist/components/CreatedObject.d.ts +3 -0
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +6 -2
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +1 -10
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +11 -5
- package/dist/components/GeometryShape.d.ts +5 -2
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +71 -10
- package/dist/components/LandObject.d.ts.map +1 -1
- package/dist/components/LandObject.js +1 -1
- package/dist/components/LayoutInstances.d.ts +2 -1
- package/dist/components/LayoutInstances.d.ts.map +1 -1
- package/dist/components/LayoutInstances.js +39 -6
- package/dist/components/LightObject.d.ts.map +1 -1
- package/dist/components/LightObject.js +3 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +62 -13
- package/dist/components/OceanBuilder.d.ts +2 -0
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -1
- package/dist/components/RenderEffects.d.ts +8 -0
- package/dist/components/RenderEffects.d.ts.map +1 -0
- package/dist/components/RenderEffects.js +120 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +18 -9
- package/dist/components/SportsObject.d.ts +9 -0
- package/dist/components/SportsObject.d.ts.map +1 -0
- package/dist/components/SportsObject.js +20 -0
- package/dist/components/UrbanObject.d.ts +9 -0
- package/dist/components/UrbanObject.d.ts.map +1 -0
- package/dist/components/UrbanObject.js +28 -0
- package/dist/components/VegetationObject.d.ts +9 -0
- package/dist/components/VegetationObject.d.ts.map +1 -0
- package/dist/components/VegetationObject.js +26 -0
- package/dist/components/WaterObject.d.ts +15 -0
- package/dist/components/WaterObject.d.ts.map +1 -0
- package/dist/components/WaterObject.js +29 -0
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -1
- package/dist/components/land/LandPatch.d.ts +3 -1
- package/dist/components/land/LandPatch.d.ts.map +1 -1
- package/dist/components/land/LandPatch.js +80 -7
- package/dist/components/layout/InstancedLayout.d.ts +19 -0
- package/dist/components/layout/InstancedLayout.d.ts.map +1 -0
- package/dist/components/layout/InstancedLayout.js +154 -0
- package/dist/components/layout/LayoutGrounds.d.ts +19 -0
- package/dist/components/layout/LayoutGrounds.d.ts.map +1 -0
- package/dist/components/layout/LayoutGrounds.js +104 -0
- package/dist/components/layout/LinkProxies.d.ts +5 -0
- package/dist/components/layout/LinkProxies.d.ts.map +1 -0
- package/dist/components/layout/LinkProxies.js +51 -0
- package/dist/components/layout/LinkedSource.d.ts +14 -0
- package/dist/components/layout/LinkedSource.d.ts.map +1 -0
- package/dist/components/layout/LinkedSource.js +129 -0
- package/dist/components/projector/Projector.d.ts +14 -0
- package/dist/components/projector/Projector.d.ts.map +1 -0
- package/dist/components/projector/Projector.js +44 -0
- package/dist/components/projector/index.d.ts +4 -0
- package/dist/components/projector/index.d.ts.map +1 -0
- package/dist/components/projector/index.js +2 -0
- package/dist/components/projector/projectorCore.d.ts +19 -0
- package/dist/components/projector/projectorCore.d.ts.map +1 -0
- package/dist/components/projector/projectorCore.js +545 -0
- package/dist/components/sports/SportsBall.d.ts +9 -0
- package/dist/components/sports/SportsBall.d.ts.map +1 -0
- package/dist/components/sports/SportsBall.js +23 -0
- package/dist/components/sports/SportsCourt.d.ts +9 -0
- package/dist/components/sports/SportsCourt.d.ts.map +1 -0
- package/dist/components/sports/SportsCourt.js +23 -0
- package/dist/components/sports/SportsEquipment.d.ts +9 -0
- package/dist/components/sports/SportsEquipment.d.ts.map +1 -0
- package/dist/components/sports/SportsEquipment.js +23 -0
- package/dist/components/sports/SportsGoal.d.ts +9 -0
- package/dist/components/sports/SportsGoal.d.ts.map +1 -0
- package/dist/components/sports/SportsGoal.js +23 -0
- package/dist/components/sports/core/ball.d.ts +166 -0
- package/dist/components/sports/core/ball.d.ts.map +1 -0
- package/dist/components/sports/core/ball.js +402 -0
- package/dist/components/sports/core/court.d.ts +442 -0
- package/dist/components/sports/core/court.d.ts.map +1 -0
- package/dist/components/sports/core/court.js +658 -0
- package/dist/components/sports/core/equipment.d.ts +103 -0
- package/dist/components/sports/core/equipment.d.ts.map +1 -0
- package/dist/components/sports/core/equipment.js +403 -0
- package/dist/components/sports/core/goal.d.ts +98 -0
- package/dist/components/sports/core/goal.d.ts.map +1 -0
- package/dist/components/sports/core/goal.js +44 -0
- package/dist/components/sports/index.d.ts +11 -0
- package/dist/components/sports/index.d.ts.map +1 -0
- package/dist/components/sports/index.js +8 -0
- package/dist/components/sports/sportsCore.d.ts +195 -0
- package/dist/components/sports/sportsCore.d.ts.map +1 -0
- package/dist/components/sports/sportsCore.js +758 -0
- package/dist/components/sports/useSportsInstance.d.ts +35 -0
- package/dist/components/sports/useSportsInstance.d.ts.map +1 -0
- package/dist/components/sports/useSportsInstance.js +47 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +14 -0
- package/dist/components/urban/UrbanBlock.d.ts +9 -0
- package/dist/components/urban/UrbanBlock.d.ts.map +1 -0
- package/dist/components/urban/UrbanBlock.js +23 -0
- package/dist/components/urban/UrbanBuilding.d.ts +9 -0
- package/dist/components/urban/UrbanBuilding.d.ts.map +1 -0
- package/dist/components/urban/UrbanBuilding.js +23 -0
- package/dist/components/urban/UrbanJunction.d.ts +9 -0
- package/dist/components/urban/UrbanJunction.d.ts.map +1 -0
- package/dist/components/urban/UrbanJunction.js +23 -0
- package/dist/components/urban/UrbanPark.d.ts +9 -0
- package/dist/components/urban/UrbanPark.d.ts.map +1 -0
- package/dist/components/urban/UrbanPark.js +23 -0
- package/dist/components/urban/UrbanParkingLot.d.ts +9 -0
- package/dist/components/urban/UrbanParkingLot.d.ts.map +1 -0
- package/dist/components/urban/UrbanParkingLot.js +23 -0
- package/dist/components/urban/UrbanPlaza.d.ts +9 -0
- package/dist/components/urban/UrbanPlaza.d.ts.map +1 -0
- package/dist/components/urban/UrbanPlaza.js +23 -0
- package/dist/components/urban/UrbanRoad.d.ts +9 -0
- package/dist/components/urban/UrbanRoad.d.ts.map +1 -0
- package/dist/components/urban/UrbanRoad.js +23 -0
- package/dist/components/urban/UrbanSignage.d.ts +9 -0
- package/dist/components/urban/UrbanSignage.d.ts.map +1 -0
- package/dist/components/urban/UrbanSignage.js +23 -0
- package/dist/components/urban/UrbanSkyline.d.ts +9 -0
- package/dist/components/urban/UrbanSkyline.d.ts.map +1 -0
- package/dist/components/urban/UrbanSkyline.js +23 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts +9 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetFurniture.js +23 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts +9 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetGrid.js +34 -0
- package/dist/components/urban/UrbanTraffic.d.ts +9 -0
- package/dist/components/urban/UrbanTraffic.d.ts.map +1 -0
- package/dist/components/urban/UrbanTraffic.js +23 -0
- package/dist/components/urban/core/block.d.ts +119 -0
- package/dist/components/urban/core/block.d.ts.map +1 -0
- package/dist/components/urban/core/block.js +266 -0
- package/dist/components/urban/core/building.d.ts +128 -0
- package/dist/components/urban/core/building.d.ts.map +1 -0
- package/dist/components/urban/core/building.js +741 -0
- package/dist/components/urban/core/junction.d.ts +152 -0
- package/dist/components/urban/core/junction.d.ts.map +1 -0
- package/dist/components/urban/core/junction.js +617 -0
- package/dist/components/urban/core/park.d.ts +67 -0
- package/dist/components/urban/core/park.d.ts.map +1 -0
- package/dist/components/urban/core/park.js +176 -0
- package/dist/components/urban/core/parkingLot.d.ts +82 -0
- package/dist/components/urban/core/parkingLot.d.ts.map +1 -0
- package/dist/components/urban/core/parkingLot.js +284 -0
- package/dist/components/urban/core/plaza.d.ts +24 -0
- package/dist/components/urban/core/plaza.d.ts.map +1 -0
- package/dist/components/urban/core/plaza.js +243 -0
- package/dist/components/urban/core/road.d.ts +113 -0
- package/dist/components/urban/core/road.d.ts.map +1 -0
- package/dist/components/urban/core/road.js +347 -0
- package/dist/components/urban/core/signage.d.ts +83 -0
- package/dist/components/urban/core/signage.d.ts.map +1 -0
- package/dist/components/urban/core/signage.js +209 -0
- package/dist/components/urban/core/skyline.d.ts +100 -0
- package/dist/components/urban/core/skyline.d.ts.map +1 -0
- package/dist/components/urban/core/skyline.js +89 -0
- package/dist/components/urban/core/streetFurniture.d.ts +75 -0
- package/dist/components/urban/core/streetFurniture.d.ts.map +1 -0
- package/dist/components/urban/core/streetFurniture.js +193 -0
- package/dist/components/urban/core/streetGrid.d.ts +134 -0
- package/dist/components/urban/core/streetGrid.d.ts.map +1 -0
- package/dist/components/urban/core/streetGrid.js +422 -0
- package/dist/components/urban/core/traffic.d.ts +125 -0
- package/dist/components/urban/core/traffic.d.ts.map +1 -0
- package/dist/components/urban/core/traffic.js +305 -0
- package/dist/components/urban/index.d.ts +29 -0
- package/dist/components/urban/index.d.ts.map +1 -0
- package/dist/components/urban/index.js +16 -0
- package/dist/components/urban/textureSetResolver.d.ts +8 -0
- package/dist/components/urban/textureSetResolver.d.ts.map +1 -0
- package/dist/components/urban/textureSetResolver.js +16 -0
- package/dist/components/urban/urbanCore.d.ts +262 -0
- package/dist/components/urban/urbanCore.d.ts.map +1 -0
- package/dist/components/urban/urbanCore.js +928 -0
- package/dist/components/urban/useUrbanInstance.d.ts +53 -0
- package/dist/components/urban/useUrbanInstance.d.ts.map +1 -0
- package/dist/components/urban/useUrbanInstance.js +100 -0
- package/dist/components/vegetation/VegetationBush.d.ts +9 -0
- package/dist/components/vegetation/VegetationBush.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationBush.js +23 -0
- package/dist/components/vegetation/VegetationCrops.d.ts +9 -0
- package/dist/components/vegetation/VegetationCrops.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationCrops.js +23 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts +9 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFlowers.js +23 -0
- package/dist/components/vegetation/VegetationForest.d.ts +9 -0
- package/dist/components/vegetation/VegetationForest.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationForest.js +23 -0
- package/dist/components/vegetation/VegetationFruit.d.ts +9 -0
- package/dist/components/vegetation/VegetationFruit.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFruit.js +23 -0
- package/dist/components/vegetation/VegetationGrass.d.ts +9 -0
- package/dist/components/vegetation/VegetationGrass.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationGrass.js +23 -0
- package/dist/components/vegetation/VegetationHedge.d.ts +9 -0
- package/dist/components/vegetation/VegetationHedge.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationHedge.js +23 -0
- package/dist/components/vegetation/VegetationIvy.d.ts +9 -0
- package/dist/components/vegetation/VegetationIvy.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationIvy.js +23 -0
- package/dist/components/vegetation/VegetationTree.d.ts +9 -0
- package/dist/components/vegetation/VegetationTree.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationTree.js +23 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts +9 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationVegetable.js +23 -0
- package/dist/components/vegetation/core/bush.d.ts +1256 -0
- package/dist/components/vegetation/core/bush.d.ts.map +1 -0
- package/dist/components/vegetation/core/bush.js +376 -0
- package/dist/components/vegetation/core/crops.d.ts +1033 -0
- package/dist/components/vegetation/core/crops.d.ts.map +1 -0
- package/dist/components/vegetation/core/crops.js +378 -0
- package/dist/components/vegetation/core/flowers.d.ts +648 -0
- package/dist/components/vegetation/core/flowers.d.ts.map +1 -0
- package/dist/components/vegetation/core/flowers.js +225 -0
- package/dist/components/vegetation/core/forest.d.ts +138 -0
- package/dist/components/vegetation/core/forest.d.ts.map +1 -0
- package/dist/components/vegetation/core/forest.js +310 -0
- package/dist/components/vegetation/core/fruit.d.ts +99 -0
- package/dist/components/vegetation/core/fruit.d.ts.map +1 -0
- package/dist/components/vegetation/core/fruit.js +77 -0
- package/dist/components/vegetation/core/grass.d.ts +103 -0
- package/dist/components/vegetation/core/grass.d.ts.map +1 -0
- package/dist/components/vegetation/core/grass.js +102 -0
- package/dist/components/vegetation/core/hedge.d.ts +193 -0
- package/dist/components/vegetation/core/hedge.d.ts.map +1 -0
- package/dist/components/vegetation/core/hedge.js +243 -0
- package/dist/components/vegetation/core/ivy.d.ts +213 -0
- package/dist/components/vegetation/core/ivy.d.ts.map +1 -0
- package/dist/components/vegetation/core/ivy.js +173 -0
- package/dist/components/vegetation/core/tree.d.ts +1117 -0
- package/dist/components/vegetation/core/tree.d.ts.map +1 -0
- package/dist/components/vegetation/core/tree.js +408 -0
- package/dist/components/vegetation/core/vegetable.d.ts +99 -0
- package/dist/components/vegetation/core/vegetable.d.ts.map +1 -0
- package/dist/components/vegetation/core/vegetable.js +76 -0
- package/dist/components/vegetation/index.d.ts +23 -0
- package/dist/components/vegetation/index.d.ts.map +1 -0
- package/dist/components/vegetation/index.js +14 -0
- package/dist/components/vegetation/produceCore.d.ts +929 -0
- package/dist/components/vegetation/produceCore.d.ts.map +1 -0
- package/dist/components/vegetation/produceCore.js +723 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts +39 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts.map +1 -0
- package/dist/components/vegetation/useVegetationInstance.js +45 -0
- package/dist/components/vegetation/vegetationCore.d.ts +412 -0
- package/dist/components/vegetation/vegetationCore.d.ts.map +1 -0
- package/dist/components/vegetation/vegetationCore.js +1728 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +5 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -13
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -2
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +31 -10
- package/dist/components/water/WaterFountain.d.ts +9 -0
- package/dist/components/water/WaterFountain.d.ts.map +1 -0
- package/dist/components/water/WaterFountain.js +24 -0
- package/dist/components/water/WaterStream.d.ts +9 -0
- package/dist/components/water/WaterStream.d.ts.map +1 -0
- package/dist/components/water/WaterStream.js +24 -0
- package/dist/components/water/WaterWaterfall.d.ts +9 -0
- package/dist/components/water/WaterWaterfall.d.ts.map +1 -0
- package/dist/components/water/WaterWaterfall.js +24 -0
- package/dist/components/water/core/fountain.d.ts +70 -0
- package/dist/components/water/core/fountain.d.ts.map +1 -0
- package/dist/components/water/core/fountain.js +619 -0
- package/dist/components/water/core/stream.d.ts +72 -0
- package/dist/components/water/core/stream.d.ts.map +1 -0
- package/dist/components/water/core/stream.js +167 -0
- package/dist/components/water/core/waterfall.d.ts +78 -0
- package/dist/components/water/core/waterfall.d.ts.map +1 -0
- package/dist/components/water/core/waterfall.js +325 -0
- package/dist/components/water/index.d.ts +8 -0
- package/dist/components/water/index.d.ts.map +1 -1
- package/dist/components/water/index.js +7 -0
- package/dist/components/water/types.d.ts +3 -0
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/components/water/useWaterInstance.d.ts +43 -0
- package/dist/components/water/useWaterInstance.d.ts.map +1 -0
- package/dist/components/water/useWaterInstance.js +89 -0
- package/dist/components/water/waterCore.d.ts +179 -0
- package/dist/components/water/waterCore.d.ts.map +1 -0
- package/dist/components/water/waterCore.js +516 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -1
- package/dist/hooks/index.d.ts +7 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +5 -2
- package/dist/hooks/useActionPatch.d.ts +23 -0
- package/dist/hooks/useActionPatch.d.ts.map +1 -0
- package/dist/hooks/useActionPatch.js +38 -0
- package/dist/hooks/useCloudSun.d.ts.map +1 -1
- package/dist/hooks/useCloudSun.js +3 -2
- package/dist/hooks/useCommittedInstance.d.ts +6 -0
- package/dist/hooks/useCommittedInstance.d.ts.map +1 -0
- package/dist/hooks/useCommittedInstance.js +42 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +36 -20
- package/dist/hooks/useGridLayout.d.ts +7 -0
- package/dist/hooks/useGridLayout.d.ts.map +1 -0
- package/dist/hooks/useGridLayout.js +10 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -1
- package/dist/hooks/useInteractionEffects.js +48 -9
- package/dist/hooks/useLightLive.d.ts.map +1 -1
- package/dist/hooks/useLightLive.js +2 -0
- package/dist/hooks/useLinkStatus.d.ts +7 -0
- package/dist/hooks/useLinkStatus.d.ts.map +1 -0
- package/dist/hooks/useLinkStatus.js +20 -0
- package/dist/hooks/useMaterialApplication.d.ts +6 -1
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -1
- package/dist/hooks/useMaterialApplication.js +7 -2
- package/dist/hooks/useOceanMaterial.d.ts +11 -1
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +185 -27
- package/dist/hooks/usePathAnimation.d.ts +8 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -1
- package/dist/hooks/usePathAnimation.js +140 -59
- package/dist/hooks/useResolvedLayout.d.ts +10 -0
- package/dist/hooks/useResolvedLayout.d.ts.map +1 -0
- package/dist/hooks/useResolvedLayout.js +17 -0
- package/dist/hooks/useTimeLighting.d.ts +36 -0
- package/dist/hooks/useTimeLighting.d.ts.map +1 -0
- package/dist/hooks/useTimeLighting.js +67 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -1
- package/dist/operations/catalogue/shaderLayers.js +26 -3
- package/dist/render/renderLive.d.ts +11 -0
- package/dist/render/renderLive.d.ts.map +1 -0
- package/dist/render/renderLive.js +57 -0
- 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 +35 -5
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +12 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +55 -7
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +28 -0
- package/dist/triggers/kinds/change.js +1 -1
- package/dist/ui/UiLayers.d.ts +17 -1
- package/dist/ui/UiLayers.d.ts.map +1 -1
- package/dist/ui/UiLayers.js +76 -3
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/utils/composerHostedPass.d.ts +74 -0
- package/dist/utils/composerHostedPass.d.ts.map +1 -0
- package/dist/utils/composerHostedPass.js +63 -0
- package/dist/utils/geometryScript.d.ts +17 -0
- package/dist/utils/geometryScript.d.ts.map +1 -0
- package/dist/utils/geometryScript.js +92 -0
- package/dist/utils/geometryScript.worker.d.ts +2 -0
- package/dist/utils/geometryScript.worker.d.ts.map +1 -0
- package/dist/utils/geometryScript.worker.js +42 -0
- package/dist/utils/groundRegistry.d.ts +11 -0
- package/dist/utils/groundRegistry.d.ts.map +1 -0
- package/dist/utils/groundRegistry.js +39 -0
- package/dist/utils/instancingSupport.d.ts +9 -0
- package/dist/utils/instancingSupport.d.ts.map +1 -0
- package/dist/utils/instancingSupport.js +13 -0
- package/dist/utils/landPatch.d.ts +26 -5
- package/dist/utils/landPatch.d.ts.map +1 -1
- package/dist/utils/landPatch.js +124 -9
- package/dist/utils/layoutPlacement.d.ts +30 -0
- package/dist/utils/layoutPlacement.d.ts.map +1 -0
- package/dist/utils/layoutPlacement.js +113 -0
- package/dist/utils/linkRegistry.d.ts +15 -0
- package/dist/utils/linkRegistry.d.ts.map +1 -0
- package/dist/utils/linkRegistry.js +11 -0
- package/dist/utils/shapes.d.ts +28 -2
- package/dist/utils/shapes.d.ts.map +1 -1
- package/dist/utils/shapes.js +32 -3
- package/dist/utils/sharedParts.d.ts +61 -0
- package/dist/utils/sharedParts.d.ts.map +1 -0
- package/dist/utils/sharedParts.js +268 -0
- package/dist/utils/svgAsset.d.ts +6 -0
- package/dist/utils/svgAsset.d.ts.map +1 -0
- package/dist/utils/svgAsset.js +46 -0
- package/dist/utils/waterLight.d.ts +29 -0
- package/dist/utils/waterLight.d.ts.map +1 -0
- package/dist/utils/waterLight.js +67 -0
- package/dist/utils/waterReflection.d.ts +185 -0
- package/dist/utils/waterReflection.d.ts.map +1 -0
- package/dist/utils/waterReflection.js +616 -0
- package/package.json +4 -3
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
// Emitted from Claude outputs/water-lab/fountain.mjs by gen_family.mjs — edit the lab module and re-emit.
|
|
2
|
+
// water/core/fountain — Fountain (type 'water', config.type 'fountain'). Shared core: ../waterCore. six kinds of fountain, all water only (the basin, bowls and nozzles are the
|
|
3
|
+
// user's meshes):
|
|
4
|
+
// jets ballistic jets (single / ring / crown / fan) that break into droplets
|
|
5
|
+
// laminar the same arcs as unbroken glass rods (laminar-flow nozzles), landing without splash
|
|
6
|
+
// dancing jets whose heights run as a wave / chase / pulse over time (a show fountain)
|
|
7
|
+
// geyser one thick aerated column that bursts up, collapses into a plume and pulses
|
|
8
|
+
// bell a laminar dome: a thin sheet leaving a nozzle radially and falling as a bell
|
|
9
|
+
// tiers stacked bowls: water discs spilling over their rims as curtains onto the next
|
|
10
|
+
//
|
|
11
|
+
// Construction (jets):
|
|
12
|
+
// COLUMN. Near the nozzle a jet is a coherent glassy rod, so it is drawn as geometry: a tube
|
|
13
|
+
// swept along the closed-form parabola (x = v·sinθ·t, y = v·cosθ·t − ½gt²), radius growing
|
|
14
|
+
// slightly with flight, its surface wobbling with advected noise; shaded as water — Fresnel
|
|
15
|
+
// sky reflection, the background tinted through it, a tight sun glint — and fading out where
|
|
16
|
+
// the jet breaks up (`breakup` sets where). BREAK-UP. Past that point the water is drops in
|
|
17
|
+
// CLUMPS (slugs): droplets share a slug phase with jitter, stretched along their velocity,
|
|
18
|
+
// scattering sideways with flight time; near the apex they droop and thin out. Each droplet
|
|
19
|
+
// is a tiny lens — sky through it, a glint. SPLASH. Where a jet lands: a crown of short
|
|
20
|
+
// upward streaks, a CHURN patch (boiling foam on the basin) and expanding RINGS on the jet's
|
|
21
|
+
// cadence. BASIN. Round, tiled floor seen through the water with refraction, caustics and
|
|
22
|
+
// Beer–Lambert absorption. Patterns: single, ring, crown (alternating heights), arc (fan).
|
|
23
|
+
import * as THREE from 'three';
|
|
24
|
+
import { GLSL_COMMON, GLSL_BILLBOARD, createSunUniforms, createBasinUniforms, createBasin, applyBasinWind, instancedQuads, mulberry32, ringSpawner, createMistVolume } from '../waterCore.js';
|
|
25
|
+
export const STRUCTURAL = ['kind', 'pattern', 'jets', 'droplets', 'basinSize', 'tiers', 'topRadius', 'spread', 'tierHeight', 'bellRadius', 'nozzleHeight'];
|
|
26
|
+
const MAX_JETS = 24;
|
|
27
|
+
const G = 9.81;
|
|
28
|
+
export function createUniforms() {
|
|
29
|
+
return {
|
|
30
|
+
...createSunUniforms(),
|
|
31
|
+
uJets: { value: Array.from({ length: MAX_JETS }, () => new THREE.Vector4()) }, // nozzle x, z, dir angle, speed
|
|
32
|
+
uJetAux: { value: Array.from({ length: MAX_JETS }, () => new THREE.Vector4()) }, // tilt, flight time, phase, apex
|
|
33
|
+
uJetCount: { value: 0 },
|
|
34
|
+
uThickness: { value: 1 }, uBreakup: { value: 0.45 }, uSplash: { value: 1 }, uSpin: { value: 0 }, uFroth: { value: 1 },
|
|
35
|
+
uWaterColor: { value: new THREE.Color('#cfe9f2') }, uFoamColor: { value: new THREE.Color('#eef6f8') },
|
|
36
|
+
uCamPos: { value: new THREE.Vector3() },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Per-jet apex-height factors for the dancing kind. */
|
|
40
|
+
function danceFactors(c, n, now) {
|
|
41
|
+
const f = new Float32Array(n).fill(1);
|
|
42
|
+
if (c.kind !== 'dancing')
|
|
43
|
+
return f;
|
|
44
|
+
const sp = c.danceSpeed;
|
|
45
|
+
for (let i = 0; i < n; i++) {
|
|
46
|
+
const ph = i / n;
|
|
47
|
+
if (c.dance === 'wave')
|
|
48
|
+
f[i] = 0.35 + 0.65 * (0.5 + 0.5 * Math.sin((now * sp - ph * 2) * 2.2));
|
|
49
|
+
else if (c.dance === 'chase') {
|
|
50
|
+
const d = ((now * sp * 0.6) % 1 + 1 - ph) % 1;
|
|
51
|
+
f[i] = 0.25 + 0.75 * Math.max(0, 1 - d * 3);
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
f[i] = 0.3 + 0.7 * Math.pow(0.5 + 0.5 * Math.sin(now * sp * 2.5 + i * 0.3), 2.0);
|
|
55
|
+
}
|
|
56
|
+
return f;
|
|
57
|
+
}
|
|
58
|
+
export function layoutJets(u, c, now = 0) {
|
|
59
|
+
const n = Math.min(MAX_JETS, Math.max(1, Math.round(c.jets)));
|
|
60
|
+
const tilt = (c.tilt * Math.PI) / 180;
|
|
61
|
+
const rng = mulberry32(11);
|
|
62
|
+
const single = c.pattern === 'single' || c.kind === 'geyser';
|
|
63
|
+
u.uJetCount.value = single ? 1 : n;
|
|
64
|
+
const dance = danceFactors(c, u.uJetCount.value, now);
|
|
65
|
+
for (let i = 0; i < MAX_JETS; i++) {
|
|
66
|
+
if (i >= u.uJetCount.value) {
|
|
67
|
+
u.uJets.value[i].set(0, 0, 0, 0);
|
|
68
|
+
u.uJetAux.value[i].set(0, 1, 0, 0);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
let x = 0, z = 0, dir = 0, h = c.height * dance[i], th = tilt;
|
|
72
|
+
if (c.kind === 'geyser') {
|
|
73
|
+
// a geyser surges: slow noise over the height, with sharper bursts
|
|
74
|
+
const n1 = Math.sin(now * 0.9) * 0.5 + Math.sin(now * 2.3 + 1.0) * 0.3 + Math.sin(now * 5.1) * 0.2;
|
|
75
|
+
h = c.height * (0.6 + 0.4 * (0.5 + 0.5 * n1));
|
|
76
|
+
th = 0.02;
|
|
77
|
+
}
|
|
78
|
+
if (single) {
|
|
79
|
+
if (c.kind !== 'geyser')
|
|
80
|
+
th = 0;
|
|
81
|
+
}
|
|
82
|
+
else if (c.pattern === 'ring' || c.pattern === 'crown') {
|
|
83
|
+
const a = (i / n) * Math.PI * 2;
|
|
84
|
+
x = Math.cos(a) * c.radius;
|
|
85
|
+
z = Math.sin(a) * c.radius;
|
|
86
|
+
dir = a;
|
|
87
|
+
if (c.pattern === 'crown')
|
|
88
|
+
h = c.height * (i % 2 ? 0.55 : 1);
|
|
89
|
+
}
|
|
90
|
+
else if (c.pattern === 'arc') {
|
|
91
|
+
const t = n === 1 ? 0 : i / (n - 1) - 0.5;
|
|
92
|
+
x = t * c.radius * 2;
|
|
93
|
+
dir = Math.PI / 2;
|
|
94
|
+
th = tilt * 0.6 + Math.abs(t) * 0.3;
|
|
95
|
+
h = c.height * (1 - 0.5 * Math.abs(t));
|
|
96
|
+
}
|
|
97
|
+
const vy = Math.sqrt(2 * G * h), v = vy / Math.max(Math.cos(th), 0.05), T = (2 * vy) / G;
|
|
98
|
+
u.uJets.value[i].set(x, z, dir, v);
|
|
99
|
+
u.uJetAux.value[i].set(th, T, rng(), h);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function applyConfig(u, c) {
|
|
103
|
+
if (c.thickness !== undefined)
|
|
104
|
+
u.uThickness.value = c.thickness;
|
|
105
|
+
if (c.breakup !== undefined)
|
|
106
|
+
u.uBreakup.value = c.breakup;
|
|
107
|
+
if (c.kind !== undefined) {
|
|
108
|
+
// kind presets over the shared machinery
|
|
109
|
+
if (c.kind === 'laminar') {
|
|
110
|
+
u.uBreakup.value = 1.0;
|
|
111
|
+
u.uFroth.value = 0;
|
|
112
|
+
}
|
|
113
|
+
else if (c.kind === 'geyser') {
|
|
114
|
+
u.uBreakup.value = Math.min(c.breakup ?? 0.45, 0.4);
|
|
115
|
+
u.uFroth.value = 2.0;
|
|
116
|
+
u.uThickness.value = (c.thickness ?? 1) * 6;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
u.uFroth.value = 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (c.splash !== undefined)
|
|
123
|
+
u.uSplash.value = c.splash;
|
|
124
|
+
if (c.spin !== undefined)
|
|
125
|
+
u.uSpin.value = c.spin;
|
|
126
|
+
if (c.waterColor !== undefined)
|
|
127
|
+
u.uWaterColor.value.set(c.waterColor);
|
|
128
|
+
if (c.foamColor !== undefined)
|
|
129
|
+
u.uFoamColor.value.set(c.foamColor);
|
|
130
|
+
}
|
|
131
|
+
// shared: where jet j is at flight fraction f (with spin)
|
|
132
|
+
const GLSL_JET = /* glsl */ `
|
|
133
|
+
uniform vec4 uJets[${MAX_JETS}];
|
|
134
|
+
uniform vec4 uJetAux[${MAX_JETS}];
|
|
135
|
+
uniform int uJetCount;
|
|
136
|
+
uniform float uThickness, uBreakup, uSplash, uSpin, uFroth;
|
|
137
|
+
void jetAt(int j, float t, out vec3 p, out vec3 vel, out vec3 out_, out vec2 nozzle) {
|
|
138
|
+
vec4 J = uJets[j]; vec4 A = uJetAux[j];
|
|
139
|
+
float spin = uSpin * uTime * 6.2832 / 60.0;
|
|
140
|
+
float ang = J.z + spin;
|
|
141
|
+
nozzle = vec2(cos(spin) * J.x - sin(spin) * J.y, sin(spin) * J.x + cos(spin) * J.y);
|
|
142
|
+
out_ = vec3(cos(ang), 0.0, sin(ang));
|
|
143
|
+
float v = J.w, th = A.x;
|
|
144
|
+
vec3 vel0 = vec3(out_.x * v * sin(th), v * cos(th), out_.z * v * sin(th));
|
|
145
|
+
p = vec3(nozzle.x, 0.0, nozzle.y) + vel0 * t + vec3(0.0, -0.5 * 9.81 * t * t, 0.0);
|
|
146
|
+
vel = vel0 + vec3(0.0, -9.81 * t, 0.0);
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
// ---------------------------------------------------------------------------- the column: a tube swept along the arc (vertex stage places a ring at each segment)
|
|
150
|
+
const COLUMN_VERT = /* glsl */ `
|
|
151
|
+
${GLSL_COMMON}
|
|
152
|
+
${GLSL_JET}
|
|
153
|
+
attribute vec2 aRing; // x: flight fraction along the tube (0..1 of the whole flight), y: angle around (0..1)
|
|
154
|
+
attribute float aJet;
|
|
155
|
+
varying vec3 vP; varying vec3 vN; varying float vF; varying float vAng; varying vec3 vAxis;
|
|
156
|
+
void main() {
|
|
157
|
+
int j = int(aJet + 0.5);
|
|
158
|
+
float T = uJetAux[j].y;
|
|
159
|
+
float f = aRing.x;
|
|
160
|
+
vec3 p, vel, out_; vec2 nz;
|
|
161
|
+
jetAt(j, f * T, p, vel, out_, nz);
|
|
162
|
+
vec3 axis = normalize(vel);
|
|
163
|
+
vec3 side = normalize(cross(axis, vec3(0.0, 1.0, 0.0) + out_ * 0.01));
|
|
164
|
+
vec3 upv = normalize(cross(side, axis));
|
|
165
|
+
float ang = aRing.y * 6.2832;
|
|
166
|
+
// radius: nozzle diameter, swelling with flight; wobble advected along the jet
|
|
167
|
+
float wob = (vnoise21(vec2(f * 14.0 - uTime * 6.0, ang * 0.5)) - 0.5) * 0.3 * f;
|
|
168
|
+
float r = (0.035 + 0.04 * uThickness) * (0.75 + 1.1 * f) * (1.0 + wob);
|
|
169
|
+
vec3 n = cos(ang) * side + sin(ang) * upv;
|
|
170
|
+
vec3 lp = p + n * r;
|
|
171
|
+
vP = (modelMatrix * vec4(lp, 1.0)).xyz;
|
|
172
|
+
vN = normalize(mat3(modelMatrix) * n);
|
|
173
|
+
vAxis = normalize(mat3(modelMatrix) * axis);
|
|
174
|
+
vF = f; vAng = ang;
|
|
175
|
+
gl_Position = projectionMatrix * viewMatrix * vec4(vP, 1.0);
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
178
|
+
const COLUMN_FRAG = /* glsl */ `
|
|
179
|
+
${GLSL_COMMON}
|
|
180
|
+
${GLSL_JET}
|
|
181
|
+
uniform vec3 uWaterColor, uFoamColor, uCamPos;
|
|
182
|
+
varying vec3 vP; varying vec3 vN; varying float vF; varying float vAng; varying vec3 vAxis;
|
|
183
|
+
void main() {
|
|
184
|
+
float f = vF;
|
|
185
|
+
vec3 N = normalize(vN);
|
|
186
|
+
// surface texture travelling along the jet: it is a rod of water, streaked
|
|
187
|
+
float st = vnoise21(vec2(vAng * 1.2, f * 30.0 - uTime * 9.0));
|
|
188
|
+
float st2 = vnoise21(vec2(vAng * 3.0 + 5.0, f * 60.0 - uTime * 14.0));
|
|
189
|
+
N = normalize(N + vAxis * (st - 0.5) * 0.6 + cross(N, vAxis) * (st2 - 0.5) * 0.4);
|
|
190
|
+
vec3 V = normalize(uCamPos - vP);
|
|
191
|
+
vec3 L = normalize(uSunDir);
|
|
192
|
+
float fres = fresnelWater(N, V);
|
|
193
|
+
vec3 skyR = skyColor(reflect(-V, N));
|
|
194
|
+
// through the rod: the sky behind, tinted — a jet is clear glass near the nozzle
|
|
195
|
+
vec3 through = skyColor(refract(-V, N, 0.75)) * 0.75 * mix(vec3(1.0), uWaterColor, 0.35);
|
|
196
|
+
// aeration: white froth grows toward the break-up
|
|
197
|
+
float froth = smoothstep(uBreakup * 0.5, uBreakup, f) * (0.4 + 0.6 * st2) * uFroth;
|
|
198
|
+
vec3 frothCol = uFoamColor * (uSkyAmbient * 0.55 + uSunColor * (0.2 + 0.3 * max(dot(N, L), 0.0)));
|
|
199
|
+
vec3 col = mix(through, skyR, fres) + uSunColor * ggx(N, L, V, 0.06) * fres * 2.0;
|
|
200
|
+
col = mix(col, frothCol, froth * 0.8);
|
|
201
|
+
// the column fades out across the break-up; the drops take over
|
|
202
|
+
float a = (1.0 - smoothstep(uBreakup * 0.85, uBreakup * 1.15, f)) * (0.65 + 0.35 * froth);
|
|
203
|
+
if (a < 0.01) discard;
|
|
204
|
+
gl_FragColor = vec4(col * a, a);
|
|
205
|
+
#include <colorspace_fragment>
|
|
206
|
+
}
|
|
207
|
+
`;
|
|
208
|
+
// ---------------------------------------------------------------------------- the drops: clumps past the break-up
|
|
209
|
+
const DROP_VERT = /* glsl */ `
|
|
210
|
+
${GLSL_COMMON}
|
|
211
|
+
${GLSL_BILLBOARD}
|
|
212
|
+
${GLSL_JET}
|
|
213
|
+
attribute vec4 aSeed;
|
|
214
|
+
varying vec2 vUv; varying float vA; varying vec3 vP; varying float vCore;
|
|
215
|
+
void main() {
|
|
216
|
+
vUv = uv;
|
|
217
|
+
int j = int(floor(aSeed.x * float(uJetCount)));
|
|
218
|
+
float T = uJetAux[j].y;
|
|
219
|
+
// slugs: 8 per flight, drops share a slug phase with jitter, the stream is continuous in time
|
|
220
|
+
float slug = floor(aSeed.y * 8.0);
|
|
221
|
+
float phase = (slug + hash11(aSeed.z * 9.0) * mix(0.35, 1.0, clamp(uFroth - 1.0, 0.0, 1.0))) / 8.0;
|
|
222
|
+
float t = mod(phase * T + uTime, T);
|
|
223
|
+
float f = t / T;
|
|
224
|
+
vec3 p, vel, out_; vec2 nz;
|
|
225
|
+
jetAt(j, t, p, vel, out_, nz);
|
|
226
|
+
// only past the break-up (the column draws before it); fade in across it
|
|
227
|
+
float born = smoothstep(uBreakup * 0.85, uBreakup * 1.15, f);
|
|
228
|
+
vec3 axis = normalize(vel);
|
|
229
|
+
vec3 side = normalize(cross(axis, vec3(0.0, 1.0, 0.0) + out_ * 0.01));
|
|
230
|
+
vec3 upv = normalize(cross(side, axis));
|
|
231
|
+
vec2 sc = (hash22(aSeed.zw * 40.0) - 0.5) * 2.0;
|
|
232
|
+
float grow = max(f - uBreakup, 0.0);
|
|
233
|
+
float radial = ((0.03 + 0.04 * uThickness) + grow * grow * 0.6 + grow * 0.12) * (1.0 + 0.8 * clamp(uFroth - 1.0, 0.0, 1.0));
|
|
234
|
+
p += (side * sc.x + upv * sc.y) * radial * (0.3 + 0.7 * aSeed.w);
|
|
235
|
+
float core = 1.0 - smoothstep(0.0, 0.35, grow);
|
|
236
|
+
float size = (0.007 + 0.009 * uThickness) * (0.7 + 0.8 * aSeed.z) * (1.0 + grow * 0.6);
|
|
237
|
+
if (p.y < 0.0) p.y = 0.0;
|
|
238
|
+
vec3 wc = (modelMatrix * vec4(p, 1.0)).xyz;
|
|
239
|
+
vP = wc; vA = born * (0.75 - 0.3 * grow); vCore = core;
|
|
240
|
+
gl_Position = billboard(wc, position.xy, size, 1.0 + core * 2.5, vel);
|
|
241
|
+
}
|
|
242
|
+
`;
|
|
243
|
+
const DROP_FRAG = /* glsl */ `
|
|
244
|
+
${GLSL_COMMON}
|
|
245
|
+
uniform vec3 uWaterColor, uFoamColor, uCamPos;
|
|
246
|
+
varying vec2 vUv; varying float vA; varying vec3 vP; varying float vCore;
|
|
247
|
+
void main() {
|
|
248
|
+
vec2 d = vUv - 0.5; float r = length(d) * 2.0;
|
|
249
|
+
float a = smoothstep(1.0, 0.3, r) * vA;
|
|
250
|
+
if (a < 0.01) discard;
|
|
251
|
+
vec3 L = normalize(uSunDir); vec3 V = normalize(uCamPos - vP);
|
|
252
|
+
vec3 N = normalize(vec3(d * 2.0, sqrt(max(0.0, 1.0 - r * r))));
|
|
253
|
+
float glint = pow(max(dot(reflect(-L, N), V), 0.0), 30.0);
|
|
254
|
+
vec3 col = skyColor(reflect(-V, N)) * 0.7 + uFoamColor * (uSkyAmbient * 0.35 + uSunColor * 0.12) * (0.4 + 0.6 * vCore) + uSunColor * glint * 1.3;
|
|
255
|
+
gl_FragColor = vec4(col * a, a);
|
|
256
|
+
#include <colorspace_fragment>
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
259
|
+
// splash crowns at the landing points
|
|
260
|
+
const SPLASH_VERT = /* glsl */ `
|
|
261
|
+
${GLSL_COMMON}
|
|
262
|
+
${GLSL_BILLBOARD}
|
|
263
|
+
${GLSL_JET}
|
|
264
|
+
attribute vec4 aSeed;
|
|
265
|
+
varying vec2 vUv; varying float vA; varying vec3 vP; varying float vCore;
|
|
266
|
+
void main() {
|
|
267
|
+
vUv = uv; vCore = 0.6;
|
|
268
|
+
int j = int(floor(aSeed.x * float(uJetCount)));
|
|
269
|
+
float T = uJetAux[j].y;
|
|
270
|
+
vec3 land, vel0, out_; vec2 nz;
|
|
271
|
+
jetAt(j, T, land, vel0, out_, nz);
|
|
272
|
+
land.y = 0.0;
|
|
273
|
+
float life = 0.3 + aSeed.z * 0.25;
|
|
274
|
+
float t = mod(aSeed.y * life * 4.0 + uTime, life);
|
|
275
|
+
float f = t / life;
|
|
276
|
+
float a0 = aSeed.w * 6.2832;
|
|
277
|
+
// the crown leans away from the incoming jet
|
|
278
|
+
vec2 away = normalize(vel0.xz) * 0.8;
|
|
279
|
+
vec3 vel = vec3(cos(a0) * (0.5 + aSeed.z * 1.4) + away.x, 1.6 + aSeed.z * 2.4, sin(a0) * (0.5 + aSeed.z * 1.4) + away.y);
|
|
280
|
+
vec3 p = land + vel * t + vec3(0.0, -4.9 * t * t, 0.0);
|
|
281
|
+
if (p.y < 0.0) p.y = 0.0;
|
|
282
|
+
vec3 wc = (modelMatrix * vec4(p, 1.0)).xyz;
|
|
283
|
+
vP = wc; vA = uSplash * (1.0 - f) * 0.8;
|
|
284
|
+
gl_Position = billboard(wc, position.xy, 0.006 + aSeed.z * 0.01, 1.5, vel + vec3(0.0, -9.81 * t, 0.0));
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
287
|
+
// ---------------------------------------------------------------------------- lathe sheets: the bell and the tier curtains
|
|
288
|
+
/** A surface of revolution: profile(t) -> [r, y] for t in 0..1, uv = (angle, t). */
|
|
289
|
+
function lathe(profile, around = 72, along = 40) {
|
|
290
|
+
const pos = [], uv = [], idx = [];
|
|
291
|
+
for (let i = 0; i <= along; i++) {
|
|
292
|
+
const t = i / along;
|
|
293
|
+
const [r, y] = profile(t);
|
|
294
|
+
for (let a = 0; a <= around; a++) {
|
|
295
|
+
const ang = (a / around) * Math.PI * 2;
|
|
296
|
+
pos.push(Math.cos(ang) * r, y, Math.sin(ang) * r);
|
|
297
|
+
uv.push(a / around, t);
|
|
298
|
+
if (i < along && a < around) {
|
|
299
|
+
const k = i * (around + 1) + a;
|
|
300
|
+
idx.push(k, k + around + 1, k + 1, k + 1, k + around + 1, k + around + 2);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
const geo = new THREE.BufferGeometry();
|
|
305
|
+
geo.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
|
|
306
|
+
geo.setAttribute('uv', new THREE.Float32BufferAttribute(uv, 2));
|
|
307
|
+
geo.setIndex(idx);
|
|
308
|
+
geo.computeVertexNormals();
|
|
309
|
+
geo.computeBoundingSphere();
|
|
310
|
+
return geo;
|
|
311
|
+
}
|
|
312
|
+
const SHEET_VERT = /* glsl */ `
|
|
313
|
+
${GLSL_COMMON}
|
|
314
|
+
uniform float uSheetTime; // flight time of the whole sheet (s)
|
|
315
|
+
varying vec2 vUv; varying vec3 vP; varying vec3 vN;
|
|
316
|
+
void main() {
|
|
317
|
+
vUv = uv;
|
|
318
|
+
// a little sway growing with the fall
|
|
319
|
+
float sw = (vnoise21(vec2(uv.x * 10.0, uv.y * 3.0 - uTime * 1.2)) - 0.5) * 0.06 * uv.y;
|
|
320
|
+
vec3 p = position + normal * sw;
|
|
321
|
+
vP = (modelMatrix * vec4(p, 1.0)).xyz;
|
|
322
|
+
vN = normalize(mat3(modelMatrix) * normal);
|
|
323
|
+
gl_Position = projectionMatrix * viewMatrix * vec4(vP, 1.0);
|
|
324
|
+
}
|
|
325
|
+
`;
|
|
326
|
+
// the bell: a smooth laminar sheet — glass, not ropes
|
|
327
|
+
const BELL_FRAG = /* glsl */ `
|
|
328
|
+
${GLSL_COMMON}
|
|
329
|
+
uniform float uSheetTime, uSplash;
|
|
330
|
+
uniform vec3 uWaterColor, uFoamColor, uCamPos;
|
|
331
|
+
varying vec2 vUv; varying vec3 vP; varying vec3 vN;
|
|
332
|
+
void main() {
|
|
333
|
+
float t = vUv.y; // 0 at the nozzle, 1 at the rim
|
|
334
|
+
vec3 N = normalize(vN);
|
|
335
|
+
vec3 V = normalize(uCamPos - vP);
|
|
336
|
+
if (dot(N, V) < 0.0) N = -N;
|
|
337
|
+
// laminar sheet: faint ribs flowing outward, thinning toward the rim
|
|
338
|
+
float rib = vnoise21(vec2(vUv.x * 60.0, t * 6.0 - uTime * 2.5));
|
|
339
|
+
float rib2 = vnoise21(vec2(vUv.x * 140.0 + 3.0, t * 14.0 - uTime * 4.0));
|
|
340
|
+
N = normalize(N + vec3((rib - 0.5) * 0.12 + (rib2 - 0.5) * 0.08));
|
|
341
|
+
vec3 L = normalize(uSunDir);
|
|
342
|
+
float fres = fresnelWater(N, V);
|
|
343
|
+
vec3 skyR = skyColor(reflect(-V, N));
|
|
344
|
+
vec3 through = skyColor(refract(-V, N, 0.78)) * 0.8 * mix(vec3(1.0), uWaterColor, 0.25);
|
|
345
|
+
vec3 col = mix(through, skyR, fres) + uSunColor * ggx(N, L, V, 0.04) * fres * 2.5;
|
|
346
|
+
// the rim tears into lace as the sheet thins
|
|
347
|
+
float lace = smoothstep(0.85, 1.0, t) * smoothstep(0.45, 0.75, vnoise21(vec2(vUv.x * 90.0, t * 30.0 - uTime * 5.0)));
|
|
348
|
+
vec3 foamLit = uFoamColor * (uSkyAmbient * 0.5 + uSunColor * 0.25);
|
|
349
|
+
col = mix(col, foamLit, lace * 0.5);
|
|
350
|
+
float thickness = 1.0 - t * 0.55; // the sheet thins as it spreads
|
|
351
|
+
float a = (0.18 + 0.72 * fres) * thickness * (1.0 - smoothstep(0.92, 1.0, t) * (1.0 - lace));
|
|
352
|
+
gl_FragColor = vec4(col * a, a);
|
|
353
|
+
#include <colorspace_fragment>
|
|
354
|
+
}
|
|
355
|
+
`;
|
|
356
|
+
// a tier curtain: a thin falling sheet off a rim — ropes by angle, aerating with the fall
|
|
357
|
+
const CURTAIN_FRAG = /* glsl */ `
|
|
358
|
+
${GLSL_COMMON}
|
|
359
|
+
uniform float uSheetTime, uRimRadius, uSplash;
|
|
360
|
+
uniform vec3 uWaterColor, uFoamColor, uCamPos;
|
|
361
|
+
varying vec2 vUv; varying vec3 vP; varying vec3 vN;
|
|
362
|
+
void main() {
|
|
363
|
+
float fall = vUv.y;
|
|
364
|
+
float tf = uSheetTime * sqrt(fall);
|
|
365
|
+
vec2 q = vec2(vUv.x * uRimRadius * 6.2832 / 0.12, (tf + uTime) * 3.0);
|
|
366
|
+
float ropes = fbm21(vec2(q.x, q.y * 0.12));
|
|
367
|
+
float ropes2 = vnoise21(vec2(q.x * 0.45 + 3.0, q.y * 0.06));
|
|
368
|
+
float dens = ropes * 0.7 + ropes2 * 0.35 + 0.1;
|
|
369
|
+
float cover = smoothstep(0.42, 0.62, dens);
|
|
370
|
+
if (cover < 0.02) discard;
|
|
371
|
+
float tau = cover * (0.08 + 0.6 * max(dens - 0.42, 0.0)) * (0.6 + fall * 1.2);
|
|
372
|
+
vec3 N = normalize(vN);
|
|
373
|
+
vec3 V = normalize(uCamPos - vP);
|
|
374
|
+
if (dot(N, V) < 0.0) N = -N;
|
|
375
|
+
float dsx = (fbm21(vec2(q.x + 0.12, q.y * 0.12)) - ropes) * 6.0;
|
|
376
|
+
N = normalize(N + cross(N, vec3(0.0, 1.0, 0.0)) * dsx * 0.5);
|
|
377
|
+
vec3 L = normalize(uSunDir);
|
|
378
|
+
float T = exp(-tau * 2.0);
|
|
379
|
+
vec3 skyR = skyColor(reflect(-V, N));
|
|
380
|
+
vec3 thin = mix(uWaterColor, vec3(0.8), 0.5) * (uSkyAmbient * 0.45 + uSunColor * 0.22) * 0.8 + skyR * 0.28;
|
|
381
|
+
vec3 thick = uFoamColor * (uSkyAmbient * 0.45 + uSunColor * (0.14 + 0.24 * max(dot(N, L), 0.0)));
|
|
382
|
+
vec3 col = mix(thick, thin, T);
|
|
383
|
+
float fres = fresnelWater(N, V);
|
|
384
|
+
col = mix(col, skyR, fres * 0.5 * T) + uSunColor * ggx(N, L, V, 0.12) * fres * 0.8;
|
|
385
|
+
float a = (1.0 - T * 0.6) * cover * 0.85;
|
|
386
|
+
gl_FragColor = vec4(col * a, a);
|
|
387
|
+
#include <colorspace_fragment>
|
|
388
|
+
}
|
|
389
|
+
`;
|
|
390
|
+
function buildBell(u, c) {
|
|
391
|
+
const h0 = c.nozzleHeight, R = c.bellRadius, r0 = 0.08 + 0.05 * c.thickness;
|
|
392
|
+
// apex above the nozzle: a fraction of the radius (a bell is wider than it is tall)
|
|
393
|
+
const apex = Math.max(0.15, R * 0.35);
|
|
394
|
+
const vy = Math.sqrt(2 * G * apex);
|
|
395
|
+
const T = (vy + Math.sqrt(vy * vy + 2 * G * h0)) / G; // time to y = 0
|
|
396
|
+
const vr = (R - r0) / T;
|
|
397
|
+
const geo = lathe((t) => { const tt = t * T; return [r0 + vr * tt, h0 + vy * tt - 0.5 * G * tt * tt]; }, 96, 48);
|
|
398
|
+
const mat = new THREE.ShaderMaterial({ uniforms: { ...u, uSheetTime: { value: T } }, vertexShader: SHEET_VERT, fragmentShader: BELL_FRAG, side: THREE.DoubleSide, transparent: true, depthWrite: false, blending: THREE.CustomBlending, blendSrc: THREE.OneFactor, blendDst: THREE.OneMinusSrcAlphaFactor });
|
|
399
|
+
const m = new THREE.Mesh(geo, mat);
|
|
400
|
+
m.frustumCulled = false;
|
|
401
|
+
m.renderOrder = 4;
|
|
402
|
+
return m;
|
|
403
|
+
}
|
|
404
|
+
function buildTiers(u, c) {
|
|
405
|
+
const meshes = [], discs = [];
|
|
406
|
+
const n = Math.max(1, Math.round(c.tiers));
|
|
407
|
+
for (let i = 0; i < n; i++) {
|
|
408
|
+
const R = c.topRadius + i * c.spread, H = (n - i) * c.tierHeight;
|
|
409
|
+
// the bowl's water disc, with a churn ring where the tier above lands
|
|
410
|
+
const bu = createBasinUniforms();
|
|
411
|
+
const disc = createBasin(bu, R * 2, R * 2, 48, true);
|
|
412
|
+
disc.position.y = H;
|
|
413
|
+
bu.uDeepColor.value.set(c.basinColor);
|
|
414
|
+
bu.uFoamColor.value.set(c.foamColor);
|
|
415
|
+
bu.uRough.value = 0.04;
|
|
416
|
+
bu.uDetail.value = 0.35;
|
|
417
|
+
bu.uDetailSize.value = 0.2;
|
|
418
|
+
bu.uEdgeFade.value = 0.02;
|
|
419
|
+
applyBasinWind(bu, 0.4, 90, R * 2, 60);
|
|
420
|
+
if (i > 0) {
|
|
421
|
+
const Rp = c.topRadius + (i - 1) * c.spread + 0.2;
|
|
422
|
+
for (let j = 0; j < 20; j++) {
|
|
423
|
+
const a = (j / 20) * Math.PI * 2;
|
|
424
|
+
bu.uChurn.value[j].set(Math.cos(a) * Rp, Math.sin(a) * Rp, Rp * 0.14, 0.3 * c.splash);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
meshes.push(disc);
|
|
428
|
+
discs.push(bu);
|
|
429
|
+
// the curtain off this rim down to the next disc (or the basin)
|
|
430
|
+
const drop = i < n - 1 ? c.tierHeight : H;
|
|
431
|
+
const T = Math.sqrt(2 * drop / G), throwV = 0.35 + 0.1 * c.thickness;
|
|
432
|
+
const geo = lathe((t) => { const tt = t * T; return [R + throwV * tt, H - 0.5 * G * tt * tt]; }, 96, 24);
|
|
433
|
+
const mat = new THREE.ShaderMaterial({ uniforms: { ...u, uSheetTime: { value: T }, uRimRadius: { value: R } }, vertexShader: SHEET_VERT, fragmentShader: CURTAIN_FRAG, side: THREE.DoubleSide, transparent: true, depthWrite: false, blending: THREE.CustomBlending, blendSrc: THREE.OneFactor, blendDst: THREE.OneMinusSrcAlphaFactor });
|
|
434
|
+
const m = new THREE.Mesh(geo, mat);
|
|
435
|
+
m.frustumCulled = false;
|
|
436
|
+
m.renderOrder = 4 + i;
|
|
437
|
+
meshes.push(m);
|
|
438
|
+
}
|
|
439
|
+
return { meshes, update: (dt, now) => { for (const bu of discs) {
|
|
440
|
+
bu.uTime.value = now;
|
|
441
|
+
bu.uCamPos.value.copy(u.uCamPos.value);
|
|
442
|
+
for (const k of ['uSunDir', 'uSunColor', 'uSkyAmbient', 'uGroundAmbient', 'uSkyTop', 'uSkyHorizon', 'uNight'])
|
|
443
|
+
bu[k].value = u[k].value;
|
|
444
|
+
} } };
|
|
445
|
+
}
|
|
446
|
+
function columnGeometry(nJets, breakup) {
|
|
447
|
+
// rings along the first (breakup * 1.2) of the flight; 10 around
|
|
448
|
+
const segs = 36, around = 10;
|
|
449
|
+
const pos = [], ring = [], jet = [], idx = [];
|
|
450
|
+
for (let j = 0; j < nJets; j++) {
|
|
451
|
+
const base = j * (segs + 1) * (around + 1);
|
|
452
|
+
for (let s = 0; s <= segs; s++) {
|
|
453
|
+
const f = (s / segs) * Math.min(breakup * 1.25, 1);
|
|
454
|
+
for (let a = 0; a <= around; a++) {
|
|
455
|
+
pos.push(0, 0, 0);
|
|
456
|
+
ring.push(f, a / around);
|
|
457
|
+
jet.push(j);
|
|
458
|
+
if (s < segs && a < around) {
|
|
459
|
+
const k = base + s * (around + 1) + a;
|
|
460
|
+
idx.push(k, k + around + 1, k + 1, k + 1, k + around + 1, k + around + 2);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const geo = new THREE.BufferGeometry();
|
|
466
|
+
geo.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
|
|
467
|
+
geo.setAttribute('aRing', new THREE.Float32BufferAttribute(ring, 2));
|
|
468
|
+
geo.setAttribute('aJet', new THREE.Float32BufferAttribute(jet, 1));
|
|
469
|
+
geo.setIndex(idx);
|
|
470
|
+
geo.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 1e5);
|
|
471
|
+
return geo;
|
|
472
|
+
}
|
|
473
|
+
export function build(u, cfg) {
|
|
474
|
+
const c = { ...cfg };
|
|
475
|
+
applyConfig(u, c);
|
|
476
|
+
layoutJets(u, c);
|
|
477
|
+
const group = new THREE.Group();
|
|
478
|
+
const parts = [];
|
|
479
|
+
const premul = { transparent: true, depthWrite: false, blending: THREE.CustomBlending, blendSrc: THREE.OneFactor, blendDst: THREE.OneMinusSrcAlphaFactor };
|
|
480
|
+
const rng = mulberry32(5);
|
|
481
|
+
const seed = () => [rng(), rng(), rng(), rng()];
|
|
482
|
+
const nJets = u.uJetCount.value;
|
|
483
|
+
const jetKind = ['jets', 'laminar', 'dancing', 'geyser'].includes(c.kind);
|
|
484
|
+
const extra = []; // kind-specific per-frame work
|
|
485
|
+
if (jetKind) {
|
|
486
|
+
const column = new THREE.Mesh(columnGeometry(nJets, 0.95), new THREE.ShaderMaterial({ uniforms: u, vertexShader: COLUMN_VERT, fragmentShader: COLUMN_FRAG, side: THREE.DoubleSide, ...premul }));
|
|
487
|
+
column.frustumCulled = false;
|
|
488
|
+
column.renderOrder = 4;
|
|
489
|
+
group.add(column);
|
|
490
|
+
parts.push(column);
|
|
491
|
+
if (c.kind !== 'laminar') {
|
|
492
|
+
const dropN = Math.round(360 * c.droplets * nJets * (0.5 + c.height / 6) * (c.kind === 'geyser' ? 5 : 1));
|
|
493
|
+
const drops = new THREE.Mesh(instancedQuads(dropN, seed), new THREE.ShaderMaterial({ uniforms: u, vertexShader: DROP_VERT, fragmentShader: DROP_FRAG, ...premul }));
|
|
494
|
+
drops.frustumCulled = false;
|
|
495
|
+
drops.renderOrder = 5;
|
|
496
|
+
const splash = new THREE.Mesh(instancedQuads(90 * nJets * (c.kind === 'geyser' ? 6 : 1), seed), new THREE.ShaderMaterial({ uniforms: u, vertexShader: SPLASH_VERT, fragmentShader: DROP_FRAG, ...premul }));
|
|
497
|
+
splash.frustumCulled = false;
|
|
498
|
+
splash.renderOrder = 5;
|
|
499
|
+
group.add(drops, splash);
|
|
500
|
+
parts.push(drops, splash);
|
|
501
|
+
}
|
|
502
|
+
if (c.kind === 'geyser') {
|
|
503
|
+
// the plume: mist around the collapsing top
|
|
504
|
+
const pw = c.height * 0.22 + 0.6;
|
|
505
|
+
const plume = createMistVolume(u, new THREE.Vector3(0, c.height * 0.92, 0), new THREE.Vector3(pw, pw * 1.5, pw), 12, 0.3, '#e4ebef');
|
|
506
|
+
plume.mesh.renderOrder = 6;
|
|
507
|
+
plume.u.uRise.value = 0.8;
|
|
508
|
+
group.add(plume.mesh);
|
|
509
|
+
parts.push(plume.mesh);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
else if (c.kind === 'bell') {
|
|
513
|
+
const bell = buildBell(u, c);
|
|
514
|
+
group.add(bell);
|
|
515
|
+
parts.push(bell);
|
|
516
|
+
}
|
|
517
|
+
else if (c.kind === 'tiers') {
|
|
518
|
+
const t = buildTiers(u, c);
|
|
519
|
+
for (const m of t.meshes) {
|
|
520
|
+
group.add(m);
|
|
521
|
+
parts.push(m);
|
|
522
|
+
}
|
|
523
|
+
extra.push(t.update);
|
|
524
|
+
}
|
|
525
|
+
// basin: round, tiled floor through the water
|
|
526
|
+
const bu = createBasinUniforms();
|
|
527
|
+
const basin = createBasin(bu, c.basinSize, c.basinSize, 110, true);
|
|
528
|
+
bu.uDeepColor.value.set(c.basinColor);
|
|
529
|
+
bu.uFoamColor.value.set(c.foamColor);
|
|
530
|
+
bu.uRough.value = 0.03;
|
|
531
|
+
bu.uDetail.value = 0.3;
|
|
532
|
+
bu.uDetailSize.value = 0.3;
|
|
533
|
+
bu.uEdgeFade.value = 0.04;
|
|
534
|
+
bu.uFloor.value = c.floor ? 1 : 0;
|
|
535
|
+
bu.uFloorDepth.value = c.basinDepth;
|
|
536
|
+
bu.uFloorTile.value = c.tile;
|
|
537
|
+
bu.uRingSize.value.set(1.0, 1.6, 3.5);
|
|
538
|
+
applyBasinWind(bu, 0.5, 90, c.basinSize, 60);
|
|
539
|
+
group.add(basin);
|
|
540
|
+
parts.push(basin);
|
|
541
|
+
const spawn = ringSpawner(bu);
|
|
542
|
+
const nextRing = new Float32Array(MAX_JETS);
|
|
543
|
+
const landing = (j, now) => {
|
|
544
|
+
const J = u.uJets.value[j], A = u.uJetAux.value[j];
|
|
545
|
+
const spin = u.uSpin.value * now * 6.2832 / 60, ang = J.z + spin, range = J.w * Math.sin(A.x) * A.y;
|
|
546
|
+
const nx = Math.cos(spin) * J.x - Math.sin(spin) * J.y, nz = Math.sin(spin) * J.x + Math.cos(spin) * J.y;
|
|
547
|
+
return [nx + Math.cos(ang) * range, nz + Math.sin(ang) * range];
|
|
548
|
+
};
|
|
549
|
+
const setChurn = (now) => {
|
|
550
|
+
for (let j = 0; j < 24; j++)
|
|
551
|
+
bu.uChurn.value[j].set(0, 0, 0, 0);
|
|
552
|
+
if (jetKind) {
|
|
553
|
+
const r = (c.kind === 'geyser' ? 1.2 : 0.25) + 0.2 * c.thickness, st = (c.kind === 'laminar' ? 0.25 : 0.9) * c.splash;
|
|
554
|
+
for (let j = 0; j < nJets; j++) {
|
|
555
|
+
const [x, z] = landing(j, now);
|
|
556
|
+
bu.uChurn.value[j].set(x, z, r, st);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
else if (c.kind === 'bell') {
|
|
560
|
+
for (let j = 0; j < 16; j++) {
|
|
561
|
+
const a = (j / 16) * Math.PI * 2;
|
|
562
|
+
bu.uChurn.value[j].set(Math.cos(a) * c.bellRadius, Math.sin(a) * c.bellRadius, c.bellRadius * 0.18, 0.22 * c.splash);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
else if (c.kind === 'tiers') {
|
|
566
|
+
const R = c.topRadius + (c.tiers - 1) * c.spread + 0.3;
|
|
567
|
+
for (let j = 0; j < 20; j++) {
|
|
568
|
+
const a = (j / 20) * Math.PI * 2;
|
|
569
|
+
bu.uChurn.value[j].set(Math.cos(a) * R, Math.sin(a) * R, R * 0.16, 0.35 * c.splash);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
setChurn(0);
|
|
574
|
+
return {
|
|
575
|
+
object: group,
|
|
576
|
+
apply(patch) {
|
|
577
|
+
Object.assign(c, patch);
|
|
578
|
+
applyConfig(u, patch);
|
|
579
|
+
if (patch.radius !== undefined || patch.height !== undefined || patch.tilt !== undefined)
|
|
580
|
+
layoutJets(u, c, u.uTime.value);
|
|
581
|
+
if (patch.basinColor)
|
|
582
|
+
bu.uDeepColor.value.set(patch.basinColor);
|
|
583
|
+
if (patch.foamColor)
|
|
584
|
+
bu.uFoamColor.value.set(patch.foamColor);
|
|
585
|
+
if (patch.basinDepth !== undefined)
|
|
586
|
+
bu.uFloorDepth.value = c.basinDepth;
|
|
587
|
+
if (patch.tile !== undefined)
|
|
588
|
+
bu.uFloorTile.value = c.tile;
|
|
589
|
+
if (patch.floor !== undefined)
|
|
590
|
+
bu.uFloor.value = c.floor ? 1 : 0;
|
|
591
|
+
},
|
|
592
|
+
update(dt, camera) {
|
|
593
|
+
u.uTime.value += dt;
|
|
594
|
+
bu.uTime.value = u.uTime.value;
|
|
595
|
+
u.uCamPos.value.copy(camera.position);
|
|
596
|
+
bu.uCamPos.value.copy(camera.position);
|
|
597
|
+
for (const k of ['uSunDir', 'uSunColor', 'uSkyAmbient', 'uGroundAmbient', 'uSkyTop', 'uSkyHorizon', 'uNight'])
|
|
598
|
+
bu[k].value = u[k].value;
|
|
599
|
+
const now = u.uTime.value;
|
|
600
|
+
if (c.kind === 'dancing' || c.kind === 'geyser')
|
|
601
|
+
layoutJets(u, c, now);
|
|
602
|
+
setChurn(now);
|
|
603
|
+
for (const f of extra)
|
|
604
|
+
f(dt, now);
|
|
605
|
+
if (jetKind)
|
|
606
|
+
for (let j = 0; j < nJets; j++) {
|
|
607
|
+
if (now < nextRing[j])
|
|
608
|
+
continue;
|
|
609
|
+
nextRing[j] = now + 0.22 + 0.12 * Math.random();
|
|
610
|
+
const [x, z] = landing(j, now);
|
|
611
|
+
spawn(x, z, (c.kind === 'laminar' ? 0.004 : 0.01) * c.splash * (0.5 + c.thickness * 0.5), now);
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
dispose() { for (const p of parts) {
|
|
615
|
+
p.geometry.dispose();
|
|
616
|
+
p.material.dispose();
|
|
617
|
+
} },
|
|
618
|
+
};
|
|
619
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const STRUCTURAL: string[];
|
|
3
|
+
export declare function createUniforms(): {
|
|
4
|
+
uWidth: {
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
uSpeed: {
|
|
8
|
+
value: number;
|
|
9
|
+
};
|
|
10
|
+
uTurb: {
|
|
11
|
+
value: number;
|
|
12
|
+
};
|
|
13
|
+
uFoam: {
|
|
14
|
+
value: number;
|
|
15
|
+
};
|
|
16
|
+
uRipple: {
|
|
17
|
+
value: number;
|
|
18
|
+
};
|
|
19
|
+
uWaterColor: {
|
|
20
|
+
value: THREE.Color;
|
|
21
|
+
};
|
|
22
|
+
uFoamColor: {
|
|
23
|
+
value: THREE.Color;
|
|
24
|
+
};
|
|
25
|
+
uAbsorb: {
|
|
26
|
+
value: THREE.Vector3;
|
|
27
|
+
};
|
|
28
|
+
uCamPos: {
|
|
29
|
+
value: THREE.Vector3;
|
|
30
|
+
};
|
|
31
|
+
uRings: {
|
|
32
|
+
value: THREE.Vector4[];
|
|
33
|
+
};
|
|
34
|
+
uRingSize: {
|
|
35
|
+
value: THREE.Vector3;
|
|
36
|
+
};
|
|
37
|
+
uChurn: {
|
|
38
|
+
value: THREE.Vector4[];
|
|
39
|
+
};
|
|
40
|
+
uSunDir: {
|
|
41
|
+
value: THREE.Vector3;
|
|
42
|
+
};
|
|
43
|
+
uSunColor: {
|
|
44
|
+
value: THREE.Color;
|
|
45
|
+
};
|
|
46
|
+
uSkyAmbient: {
|
|
47
|
+
value: THREE.Color;
|
|
48
|
+
};
|
|
49
|
+
uGroundAmbient: {
|
|
50
|
+
value: THREE.Color;
|
|
51
|
+
};
|
|
52
|
+
uSkyTop: {
|
|
53
|
+
value: THREE.Color;
|
|
54
|
+
};
|
|
55
|
+
uSkyHorizon: {
|
|
56
|
+
value: THREE.Color;
|
|
57
|
+
};
|
|
58
|
+
uNight: {
|
|
59
|
+
value: number;
|
|
60
|
+
};
|
|
61
|
+
uTime: {
|
|
62
|
+
value: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
66
|
+
export declare function build(u: any, cfg: any): {
|
|
67
|
+
object: THREE.Group<THREE.Object3DEventMap>;
|
|
68
|
+
apply(patch: any): void;
|
|
69
|
+
update(dt: any, camera: any): void;
|
|
70
|
+
dispose(): void;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=stream.d.ts.map
|