@woosh/meep-engine 3.45.0 → 3.47.0
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/build/bundle-worker-terrain.js +1 -1
- package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
- package/editor/actions/concrete/TransformModifyAction.js +10 -2
- package/editor/ecs/component/FieldDescriptor.js +15 -0
- package/editor/ecs/component/createObjectEditor.js +41 -12
- package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
- package/editor/tools/TransformToolV2.d.ts.map +1 -1
- package/editor/tools/TransformToolV2.js +4 -0
- package/editor/tools/v2/TransformControls.d.ts.map +1 -1
- package/editor/tools/v2/TransformControls.js +7 -0
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.js +4 -2
- package/package.json +1 -1
- package/src/core/assert.d.ts.map +1 -1
- package/src/core/assert.js +5 -1
- package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
- package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
- package/src/core/binary/hash/XXH128Hash.js +4 -55
- package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
- package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
- package/src/core/binary/hash/XXH3_SECRET.js +4 -25
- package/src/core/binary/hash/crc32.d.ts +1 -15
- package/src/core/binary/hash/crc32.d.ts.map +1 -1
- package/src/core/binary/hash/crc32.js +4 -96
- package/src/core/binary/hash/xxh3_128.d.ts +1 -9
- package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_128.js +4 -341
- package/src/core/binary/hash/xxh3_64.d.ts +1 -8
- package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_64.js +4 -241
- package/src/core/binary/hash/xxh3_common.d.ts +1 -223
- package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_common.js +90 -476
- package/src/core/collection/array/array_insert_at.d.ts +16 -0
- package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
- package/src/core/collection/array/array_insert_at.js +32 -0
- package/src/core/collection/array/array_remove_at.d.ts +15 -0
- package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
- package/src/core/collection/array/array_remove_at.js +30 -0
- package/src/core/collection/array/combine_hash.d.ts +6 -0
- package/src/core/collection/array/combine_hash.d.ts.map +1 -1
- package/src/core/collection/array/combine_hash.js +6 -0
- package/src/core/function/FunctionCompiler.js +2 -2
- package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
- package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
- package/src/core/geom/ConicRay.js +2 -2
- package/src/core/geom/Quaternion.d.ts +1 -0
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +12 -48
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +8 -5
- package/src/core/math/hash/XXH128Hash.d.ts +38 -0
- package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
- package/src/core/math/hash/XXH128Hash.js +55 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
- package/src/core/math/hash/XXH3_SECRET.js +25 -0
- package/src/core/math/hash/crc32.d.ts +16 -0
- package/src/core/math/hash/crc32.d.ts.map +1 -0
- package/src/core/math/hash/crc32.js +96 -0
- package/src/core/math/hash/xxh3_128.d.ts +10 -0
- package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_128.js +341 -0
- package/src/core/math/hash/xxh3_64.d.ts +9 -0
- package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_64.js +241 -0
- package/src/core/math/hash/xxh3_common.d.ts +224 -0
- package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_common.js +476 -0
- package/src/core/math/lookup/ParameterLookupTable.js +2 -2
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
- package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +9 -4
- package/src/engine/asset/AssetDescription.js +2 -2
- package/src/engine/ecs/animation/Animation.js +2 -2
- package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +7 -5
- package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
- package/src/engine/ecs/gui/GUIElement.js +7 -5
- package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +10 -0
- package/src/engine/ecs/transform/Transform64.d.ts +1 -1
- package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform64.js +5 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
- package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +8 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
- package/src/engine/graphics3/ParticipatingMedia.js +204 -204
- package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
- package/src/engine/graphics3/animation/AnimationClips.js +5 -0
- package/src/engine/grid/obstacle/GridObstacle.js +2 -2
- package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +7 -6
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
- package/src/engine/interpolation/Interpolated.js +2 -2
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
- package/src/engine/network/CONGESTION_CONTROL.md +9 -9
- package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
- package/src/engine/network/NetworkSession.d.ts +31 -11
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +453 -286
- package/src/engine/network/README.md +77 -27
- package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
- package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
- package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
- package/src/engine/network/orchestrator/HostJoin.js +271 -0
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
- package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
- package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
- package/src/engine/network/orchestrator/PendingSlices.js +83 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
- package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +20 -6
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +33 -8
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +7 -1
- package/src/engine/network/sim/ActionLog.d.ts +32 -5
- package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
- package/src/engine/network/sim/ActionLog.js +47 -5
- package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +100 -4
- package/src/engine/network/sim/Snapshotter.d.ts +12 -0
- package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
- package/src/engine/network/sim/Snapshotter.js +43 -0
- package/src/engine/network/state/Baseline.d.ts +1 -1
- package/src/engine/network/state/Baseline.js +1 -1
- package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
- package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
- package/src/engine/network/state/FrameBufferRing.js +51 -6
- package/src/engine/network/state/InputRing.d.ts +4 -0
- package/src/engine/network/state/InputRing.d.ts.map +1 -1
- package/src/engine/network/state/InputRing.js +7 -0
- package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
- package/src/engine/network/transport/DeferredTransport.js +1 -0
- package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +4 -2
- package/src/engine/network/transport/Transport.d.ts +7 -0
- package/src/engine/network/transport/Transport.d.ts.map +1 -1
- package/src/engine/network/transport/Transport.js +8 -0
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
- package/src/engine/network/transport/connection/Connection.d.ts +191 -0
- package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
- package/src/engine/network/transport/connection/Connection.js +1262 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RangeSet.js +260 -0
- package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
- package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RxStream.js +211 -0
- package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
- package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/TxStream.js +243 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
- package/src/engine/network/transport/connection/bytes_copy.js +34 -0
- package/src/engine/network/transport/connection/varint.d.ts +46 -0
- package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
- package/src/engine/network/transport/connection/varint.js +107 -0
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +7 -5
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.js +47 -14
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
- package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
- package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
- package/src/engine/sound/sopra/README.md +768 -644
- package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
- package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
- package/src/engine/sound/sopra/SopraEngine.js +327 -12
- package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
- package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
- package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
- package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescription.js +77 -17
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
- package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -120
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -128
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +8 -3
- package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
- package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
- package/src/format/image/png/PNGReader.js +644 -644
- package/src/format/image/png/crc32.d.ts +1 -1
- package/src/format/image/png/crc32.js +7 -8
- package/src/shade/RENDERER_CONTRACT.md +6 -3
- package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
- package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
- package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
- package/src/shade/descriptor/blend/BlendComponent.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
- package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
- package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
- package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
- package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
- package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
- package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
- package/src/shade/device/ShadeDeviceFailure.js +17 -8
- package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
- package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
- package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
- package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
- package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
- package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
- package/src/shade/device/shade_device_floor_unmet.js +32 -0
- package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
- package/src/shade/renderer/Renderer.d.ts +2 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +29 -55
- package/src/shade/renderer/binding/BufferBinding.js +2 -2
- package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
- package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
- package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
- package/src/shade/renderer/camera/Camera.js +2 -2
- package/src/shade/renderer/geometry/Attribute.js +2 -2
- package/src/shade/renderer/geometry/Geometry.js +2 -2
- package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
- package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
- package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
- package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
- package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
- package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
- package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ComputeShader.js +18 -2
- package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ImageShader.js +230 -218
- package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
- package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
- package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
- package/src/shade/renderer/texture/ShadeTexture.js +17 -10
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
- package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
- package/src/view/common/HTMLElementCacheKey.js +4 -3
- package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
- package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
- package/src/view/graphics/GraphicsContextFailureView.js +1 -2
- package/src/view/minimap/MinimapMarker.js +2 -2
- package/src/engine/network/transport/Channel.js +0 -336
- package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
- package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
- package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
- package/src/engine/network/transport/fragments/fragment_send.js +0 -157
- package/src/engine/network/transport/fragments/packet_size.js +0 -107
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
shader_water_particles_bin,
|
|
15
15
|
shader_water_particles_bounds,
|
|
16
16
|
shader_water_particles_clear,
|
|
17
|
+
shader_water_particles_cut,
|
|
17
18
|
shader_water_particles_emit,
|
|
18
19
|
shader_water_particles_finalize,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
shader_water_particles_keep,
|
|
21
|
+
shader_water_particles_links,
|
|
22
|
+
shader_water_particles_mark,
|
|
21
23
|
shader_water_particles_nest,
|
|
22
24
|
shader_water_particles_rank,
|
|
23
|
-
shader_water_particles_runs,
|
|
24
25
|
shader_water_particles_scatter,
|
|
25
|
-
shader_water_particles_share,
|
|
26
26
|
shader_water_particles_split,
|
|
27
27
|
shader_water_particles_total,
|
|
28
28
|
shader_water_particles_update,
|
|
@@ -58,17 +58,15 @@ export class GPUWaterParticles {
|
|
|
58
58
|
#children = null;
|
|
59
59
|
#child_sums = null;
|
|
60
60
|
#images = null;
|
|
61
|
-
#
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#draw = null;
|
|
61
|
+
#links = null;
|
|
62
|
+
#reaches = null;
|
|
63
|
+
#shown = null;
|
|
65
64
|
#buckets = null;
|
|
66
65
|
#offsets = null;
|
|
67
66
|
#slots = null;
|
|
68
67
|
#bucket_amplitude = null;
|
|
69
|
-
#
|
|
68
|
+
#bucket_crowd = null;
|
|
70
69
|
#bucket_nest = null;
|
|
71
|
-
#visible = null;
|
|
72
70
|
#staging = null;
|
|
73
71
|
#entries = null;
|
|
74
72
|
#body_bounds = null;
|
|
@@ -114,22 +112,21 @@ export class GPUWaterParticles {
|
|
|
114
112
|
this.#child_sums = buffer('child sums', sums(capacity));
|
|
115
113
|
// per particle the mirror image the step left beside it at the outline
|
|
116
114
|
this.#images = buffer('images', capacity * WATER_PARTICLE_STRUCT.size);
|
|
117
|
-
// per particle
|
|
118
|
-
|
|
119
|
-
this
|
|
120
|
-
this.#
|
|
121
|
-
|
|
122
|
-
this.#
|
|
115
|
+
// per particle its front's neighbours before and after it
|
|
116
|
+
this.#links = buffer('links', capacity * 8);
|
|
117
|
+
// per particle the cells its support overlaps this frame: its first, its level and spans
|
|
118
|
+
this.#reaches = buffer('reaches', capacity * 12);
|
|
119
|
+
// per particle whether its crowds draw it
|
|
120
|
+
this.#shown = buffer('shown', capacity * 4);
|
|
123
121
|
// per bucket its entries, then the hash: table size and inclusive offsets
|
|
124
122
|
this.#buckets = buffer('buckets', 16 + this.#table_limit * 4);
|
|
125
123
|
this.#offsets = buffer('offsets', sums(this.#table_limit));
|
|
126
124
|
this.#slots = buffer('slots', capacity * WATER_PARTICLE_CORNERS * 4);
|
|
127
125
|
this.#bucket_amplitude = buffer('bucket amplitude', this.#table_limit * 4);
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
this.#
|
|
126
|
+
// its runs by steepness class and in all; then the most a point under it reads at finer levels, the classes its
|
|
127
|
+
// points keep and draw, and a slot of the frame's table of cut fronts
|
|
128
|
+
this.#bucket_crowd = buffer('bucket crowd', this.#table_limit * WATER_PARTICLE_CROWD_WORDS * 4);
|
|
131
129
|
this.#bucket_nest = buffer('bucket nest', this.#table_limit * WATER_PARTICLE_NEST_WORDS * 4);
|
|
132
|
-
this.#visible = buffer('visible', capacity * 4);
|
|
133
130
|
const entries = capacity * WATER_PARTICLE_CORNERS * WATER_PARTICLE_ENTRY_STRUCT.size;
|
|
134
131
|
this.#staging = buffer('staging', entries);
|
|
135
132
|
this.#entries = buffer('entries', entries);
|
|
@@ -157,16 +154,15 @@ export class GPUWaterParticles {
|
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
dispose() {
|
|
160
|
-
for (const buffer of [...this.#particles, this.#children, this.#child_sums, this.#images, this.#
|
|
161
|
-
this.#
|
|
162
|
-
|
|
157
|
+
for (const buffer of [...this.#particles, this.#children, this.#child_sums, this.#images, this.#links, this.#reaches, this.#shown, this.#buckets,
|
|
158
|
+
this.#offsets, this.#slots, this.#bucket_amplitude, this.#bucket_crowd, this.#bucket_nest, this.#staging, this.#entries, this.#body_bounds,
|
|
159
|
+
...(this.#commands ?? [])]) {
|
|
163
160
|
buffer?.destroy();
|
|
164
161
|
}
|
|
165
162
|
this.#particles = [];
|
|
166
163
|
this.#children = this.#child_sums = this.#images = this.#buckets = this.#offsets = this.#slots = this.#bucket_amplitude = null;
|
|
167
164
|
this.#staging = this.#entries = null;
|
|
168
|
-
this.#
|
|
169
|
-
this.#bucket_weight = this.#bucket_nest = this.#visible = null;
|
|
165
|
+
this.#links = this.#reaches = this.#shown = this.#bucket_crowd = this.#bucket_nest = null;
|
|
170
166
|
this.#body_bounds = null;
|
|
171
167
|
this.#commands = null;
|
|
172
168
|
this.#device = null;
|
|
@@ -205,8 +201,6 @@ export class GPUWaterParticles {
|
|
|
205
201
|
let child_sums = graph_import_buffer(graph, this.#child_sums, 'Water / particle child sums');
|
|
206
202
|
let buckets = graph_import_buffer(graph, this.#buckets, 'Water / particle buckets');
|
|
207
203
|
let offsets = graph_import_buffer(graph, this.#offsets, 'Water / particle offsets');
|
|
208
|
-
let fronts = graph_import_buffer(graph, this.#fronts, 'Water / particle fronts');
|
|
209
|
-
let front_sums = graph_import_buffer(graph, this.#front_sums, 'Water / particle front sums');
|
|
210
204
|
const node = (name, execute, reads, writes) => {
|
|
211
205
|
const data = {};
|
|
212
206
|
const pass = graph.add(name, data, (d, resources, context) => execute(resources, context, d));
|
|
@@ -243,49 +237,46 @@ export class GPUWaterParticles {
|
|
|
243
237
|
}, { child_sums }, {});
|
|
244
238
|
}
|
|
245
239
|
|
|
246
|
-
//
|
|
247
|
-
|
|
240
|
+
// The frame's hash: each particle's neighbours round its front, so that a run of them is drawn as one; how crowded
|
|
241
|
+
// each cell is and so which runs it keeps, the steepest, dooming the rest and cutting, whole, the fronts the gather
|
|
242
|
+
// cannot read;
|
|
243
|
+
// then each drawn run entered into every cell its first particle's support overlaps, offsets, entries in order.
|
|
244
|
+
buckets = node('Water / particles bin', (resources, { encoder }) => {
|
|
248
245
|
if (!stepping) {
|
|
249
246
|
// the table size the last stepping frame chose for these particles
|
|
250
247
|
shader_water_particles_finalize.dispatch({ encoder, bindings: { limits: { capacity, table_limit }, next, offsets: this.#buckets,
|
|
251
248
|
table_command: command_table } });
|
|
252
249
|
}
|
|
253
250
|
build_indirect_compute_dispatch_command(64, encoder, next, 0, command_next, 0, true);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
front_sums = graph_prefix_scan_csdldf({ graph, input: fronts, output: front_sums, element_max_count: capacity });
|
|
258
|
-
|
|
259
|
-
// The frame's hash: how each particle is drawn, how crowded each cell is and so how much of each run its crowd
|
|
260
|
-
// leaves drawn, then each packet drawn into the cells its support overlaps, offsets, entries in order.
|
|
261
|
-
buckets = node('Water / particles bin', (resources, { encoder }) => {
|
|
262
|
-
const draw = this.#draw, runs = this.#runs;
|
|
263
|
-
shader_water_particles_runs.dispatchIndirect({ encoder, command: command_next, bindings: { next, fronts: this.#front_sums, runs } });
|
|
264
|
-
shader_water_particles_groups.dispatchIndirect({ encoder, command: command_next, bindings: { next, fronts: this.#front_sums, runs, draw } });
|
|
251
|
+
const links = this.#links;
|
|
252
|
+
const reaches = this.#reaches;
|
|
253
|
+
shader_water_particles_links.dispatchIndirect({ encoder, command: command_next, bindings: { next, links, reaches } });
|
|
265
254
|
shader_water_particles_clear.dispatchIndirect({ encoder, command: command_table, bindings: {
|
|
266
|
-
buckets: this.#buckets, bucket_amplitude: this.#bucket_amplitude,
|
|
267
|
-
bucket_nest: this.#bucket_nest } });
|
|
268
|
-
shader_water_particles_weigh.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
269
|
-
next, activity, offsets: this.#buckets, draw, bucket_weight: this.#bucket_weight, body_bounds: this.#body_bounds } });
|
|
270
|
-
shader_water_particles_nest.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
271
|
-
next, activity, offsets: this.#buckets, draw, body_bounds: this.#body_bounds, bucket_weight: this.#bucket_weight,
|
|
255
|
+
buckets: this.#buckets, bucket_amplitude: this.#bucket_amplitude, bucket_crowd: this.#bucket_crowd,
|
|
272
256
|
bucket_nest: this.#bucket_nest } });
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
257
|
+
const crowd = { next, activity, offsets: this.#buckets, links, reaches, body_bounds: this.#body_bounds,
|
|
258
|
+
bucket_crowd: this.#bucket_crowd };
|
|
259
|
+
shader_water_particles_weigh.dispatchIndirect({ encoder, command: command_next, bindings: crowd });
|
|
260
|
+
shader_water_particles_nest.dispatchIndirect({ encoder, command: command_next, bindings: { ...crowd, bucket_nest: this.#bucket_nest } });
|
|
261
|
+
shader_water_particles_cut.dispatchIndirect({ encoder, command: command_next, bindings: { ...crowd, bucket_nest: this.#bucket_nest } });
|
|
262
|
+
const shown = this.#shown;
|
|
263
|
+
shader_water_particles_mark.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
264
|
+
next, activity, offsets: this.#buckets, reaches, bucket_nest: this.#bucket_nest } });
|
|
265
|
+
shader_water_particles_keep.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
266
|
+
next, activity, offsets: this.#buckets, reaches, bucket_nest: this.#bucket_nest, shown } });
|
|
276
267
|
shader_water_particles_bin.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
277
268
|
next, activity, buckets: this.#buckets, slots: this.#slots, bucket_amplitude: this.#bucket_amplitude,
|
|
278
|
-
body_bounds: this.#body_bounds,
|
|
279
|
-
}, {
|
|
269
|
+
body_bounds: this.#body_bounds, links, reaches, shown } });
|
|
270
|
+
}, {}, { buckets }).buckets;
|
|
280
271
|
offsets = graph_prefix_scan_csdldf({ graph, input: buckets, output: offsets, element_max_count: table_limit });
|
|
281
272
|
node('Water / particles order and bound', (resources, { encoder }) => {
|
|
282
|
-
const bindings = { next, offsets: this.#offsets, slots: this.#slots,
|
|
273
|
+
const bindings = { next, offsets: this.#offsets, slots: this.#slots, reaches: this.#reaches };
|
|
283
274
|
shader_water_particles_scatter.dispatchIndirect({ encoder, command: command_next, bindings: { ...bindings,
|
|
284
|
-
|
|
275
|
+
links: this.#links, shown: this.#shown, staging: this.#staging } });
|
|
285
276
|
shader_water_particles_rank.dispatchIndirect({ encoder, command: command_next, bindings: { ...bindings,
|
|
286
277
|
staging: this.#staging, entries: this.#entries } });
|
|
287
|
-
shader_water_particles_bounds.dispatchIndirect({ encoder, command: command_next, bindings: {
|
|
288
|
-
|
|
278
|
+
shader_water_particles_bounds.dispatchIndirect({ encoder, command: command_next, bindings: { ...bindings, activity,
|
|
279
|
+
bucket_amplitude: this.#bucket_amplitude, body_bounds: this.#body_bounds } });
|
|
289
280
|
}, { offsets }, {});
|
|
290
281
|
}
|
|
291
282
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export const WATER_PARTICLE_STRUCT: WebGPUStruct;
|
|
10
10
|
/**
|
|
11
|
-
* A
|
|
12
|
-
* time, and the cell it was entered for, since
|
|
13
|
-
* two cells may share a bucket.
|
|
11
|
+
* A run of a front's particles as one hash cell holds it for the surface sampler: everything its kernel needs at the
|
|
12
|
+
* frame's time, from the run's first particle, and the cell it was entered for, since a front is entered in every cell
|
|
13
|
+
* its support overlaps and two cells may share a bucket.
|
|
14
14
|
*/
|
|
15
15
|
export const WATER_PARTICLE_ENTRY_STRUCT: WebGPUStruct;
|
|
16
16
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WATER_PARTICLE_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"WATER_PARTICLE_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,iDAyBoB;AAEpB;;;;GAIG;AACH,uDAuByB;6BAjEI,sCAAsC"}
|
|
@@ -29,12 +29,17 @@ export const WATER_PARTICLE_STRUCT = WebGPUStruct.from({
|
|
|
29
29
|
* image was emitted then, and it dies once the last of it has left too. 0 from emission.
|
|
30
30
|
*/
|
|
31
31
|
reflected: u32,
|
|
32
|
+
/**
|
|
33
|
+
* 0, or once a crowd it cannot be drawn in has doomed it, the steepness |a|/r below which it dies: it fades from
|
|
34
|
+
* then on, as a packet below the drawing threshold does.
|
|
35
|
+
*/
|
|
36
|
+
fading: f32,
|
|
32
37
|
}, 'WaterParticle');
|
|
33
38
|
|
|
34
39
|
/**
|
|
35
|
-
* A
|
|
36
|
-
* time, and the cell it was entered for, since
|
|
37
|
-
* two cells may share a bucket.
|
|
40
|
+
* A run of a front's particles as one hash cell holds it for the surface sampler: everything its kernel needs at the
|
|
41
|
+
* frame's time, from the run's first particle, and the cell it was entered for, since a front is entered in every cell
|
|
42
|
+
* its support overlaps and two cells may share a bucket.
|
|
38
43
|
*/
|
|
39
44
|
export const WATER_PARTICLE_ENTRY_STRUCT = WebGPUStruct.from({
|
|
40
45
|
position: vec2f,
|
|
@@ -48,10 +53,15 @@ export const WATER_PARTICLE_ENTRY_STRUCT = WebGPUStruct.from({
|
|
|
48
53
|
phase: f32,
|
|
49
54
|
/** water_waves row and level, as water_particle_key packs them */
|
|
50
55
|
key: u32,
|
|
51
|
-
/** Index of the particle, which orders a bucket. */
|
|
56
|
+
/** Index of the run's first particle, which orders a bucket. */
|
|
52
57
|
source: u32,
|
|
53
58
|
/** How far the particle stands from its front's centre, metres. */
|
|
54
59
|
distance: f32,
|
|
55
60
|
/** Half the length of its envelope across its front, metres. */
|
|
56
61
|
half_length: f32,
|
|
62
|
+
/**
|
|
63
|
+
* The run of the front's particles it draws, from this one on, each β further round: their count, and which ends
|
|
64
|
+
* are open, tapering by the end particle's own window (chunk_water_particle's water_particle_run_profile).
|
|
65
|
+
*/
|
|
66
|
+
run: u32,
|
|
57
67
|
}, 'WaterParticleEntry');
|
|
@@ -19,6 +19,14 @@ export const WATER_PARTICLE_LEVEL0_CELL: number;
|
|
|
19
19
|
* gathers at that speed and the peak falls as t^(−1/3), which no κ draws: up to 16% below r = 12 mm, 27% at 3 cm.
|
|
20
20
|
*/
|
|
21
21
|
export const WATER_PARTICLE_STRETCH: number[];
|
|
22
|
+
/** Bits of a hash entry's run word that hold its count of particles; the two above them mark its open ends. */
|
|
23
|
+
export const WATER_PARTICLE_RUN_MEMBERS: 1073741823;
|
|
24
|
+
/** A run whose first particle has no neighbour of its front before it: it tapers there by that particle's window. */
|
|
25
|
+
export const WATER_PARTICLE_RUN_OPEN_START: 1073741824;
|
|
26
|
+
/** A run whose last particle has no neighbour of its front after it. */
|
|
27
|
+
export const WATER_PARTICLE_RUN_OPEN_END: 2147483648;
|
|
28
|
+
/** A particle drawn alone: a run of one, open at both ends, which is its own window. */
|
|
29
|
+
export const WATER_PARTICLE_LONE: number;
|
|
22
30
|
/**
|
|
23
31
|
* The physics of one wave particle as pure functions (WATER_SURFACE_SIMULATION_PLAN_2026_10_06.md §5).
|
|
24
32
|
*
|
|
@@ -34,7 +42,8 @@ export const WATER_PARTICLE_STRETCH: number[];
|
|
|
34
42
|
* The particles of a front are β apart in angle around its centre, and a packet's crests are arcs around that
|
|
35
43
|
* centre; a cosine window of half-angle β is a partition of unity over them at every radius, so the front's
|
|
36
44
|
* height is the packet's amplitude whatever the spacing, splitting a front changes none of it, and one front
|
|
37
|
-
* adds at most two particles at any point.
|
|
45
|
+
* adds at most two particles at any point. So a run of neighbours alike in all but angle is drawn as one: height one
|
|
46
|
+
* over its particles and its own window past either end that has no neighbour, the same surface its windows sum to.
|
|
38
47
|
*
|
|
39
48
|
* @type {CodeChunk}
|
|
40
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_water_particle.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,uCAAwC;AAKxC,yHAAyH;AACzH,gDAAkD;AAElD;;;;;;;;;;;;GAYG;AACH,8CAIE;AAKF
|
|
1
|
+
{"version":3,"file":"chunk_water_particle.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,uCAAwC;AAKxC,yHAAyH;AACzH,gDAAkD;AAElD;;;;;;;;;;;;GAYG;AACH,8CAIE;AAKF,+GAA+G;AAC/G,oDAAqD;AAErD,qHAAqH;AACrH,uDAAwD;AAExD,wEAAwE;AACxE,qDAAsD;AAEtD,wFAAwF;AACxF,yCAA2G;AAE3G;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mCAFU,SAAS,CAgP6G;0BArTtG,uCAAuC"}
|
|
@@ -37,6 +37,18 @@ export const WATER_PARTICLE_STRETCH = [
|
|
|
37
37
|
/** log₂(k/k_m) of the stretch table's first entry; entries are a quarter apart. */
|
|
38
38
|
const WATER_PARTICLE_STRETCH_FIRST = -7;
|
|
39
39
|
|
|
40
|
+
/** Bits of a hash entry's run word that hold its count of particles; the two above them mark its open ends. */
|
|
41
|
+
export const WATER_PARTICLE_RUN_MEMBERS = 0x3fffffff;
|
|
42
|
+
|
|
43
|
+
/** A run whose first particle has no neighbour of its front before it: it tapers there by that particle's window. */
|
|
44
|
+
export const WATER_PARTICLE_RUN_OPEN_START = 0x40000000;
|
|
45
|
+
|
|
46
|
+
/** A run whose last particle has no neighbour of its front after it. */
|
|
47
|
+
export const WATER_PARTICLE_RUN_OPEN_END = 0x80000000;
|
|
48
|
+
|
|
49
|
+
/** A particle drawn alone: a run of one, open at both ends, which is its own window. */
|
|
50
|
+
export const WATER_PARTICLE_LONE = (1 | WATER_PARTICLE_RUN_OPEN_START | WATER_PARTICLE_RUN_OPEN_END) >>> 0;
|
|
51
|
+
|
|
40
52
|
/**
|
|
41
53
|
* The physics of one wave particle as pure functions (WATER_SURFACE_SIMULATION_PLAN_2026_10_06.md §5).
|
|
42
54
|
*
|
|
@@ -52,7 +64,8 @@ const WATER_PARTICLE_STRETCH_FIRST = -7;
|
|
|
52
64
|
* The particles of a front are β apart in angle around its centre, and a packet's crests are arcs around that
|
|
53
65
|
* centre; a cosine window of half-angle β is a partition of unity over them at every radius, so the front's
|
|
54
66
|
* height is the packet's amplitude whatever the spacing, splitting a front changes none of it, and one front
|
|
55
|
-
* adds at most two particles at any point.
|
|
67
|
+
* adds at most two particles at any point. So a run of neighbours alike in all but angle is drawn as one: height one
|
|
68
|
+
* over its particles and its own window past either end that has no neighbour, the same surface its windows sum to.
|
|
56
69
|
*
|
|
57
70
|
* @type {CodeChunk}
|
|
58
71
|
*/
|
|
@@ -62,6 +75,10 @@ const WATER_PARTICLE_LEVEL_BITS: u32 = ${WATER_PARTICLE_LEVEL_BITS}u;
|
|
|
62
75
|
const WATER_PARTICLE_LEVEL0_CELL: f32 = ${WATER_PARTICLE_LEVEL0_CELL};
|
|
63
76
|
const WATER_PARTICLE_STRETCH = array<f32, ${WATER_PARTICLE_STRETCH.length}>(${WATER_PARTICLE_STRETCH.join(', ')});
|
|
64
77
|
const WATER_PARTICLE_STRETCH_FIRST: f32 = ${WATER_PARTICLE_STRETCH_FIRST}.0;
|
|
78
|
+
const WATER_PARTICLE_RUN_MEMBERS: u32 = ${WATER_PARTICLE_RUN_MEMBERS}u;
|
|
79
|
+
const WATER_PARTICLE_RUN_OPEN_START: u32 = ${WATER_PARTICLE_RUN_OPEN_START}u;
|
|
80
|
+
const WATER_PARTICLE_RUN_OPEN_END: u32 = ${WATER_PARTICLE_RUN_OPEN_END}u;
|
|
81
|
+
const WATER_PARTICLE_LONE: u32 = ${WATER_PARTICLE_LONE}u;
|
|
65
82
|
// kinematic viscosity of water, m²/s
|
|
66
83
|
const WATER_VISCOSITY: f32 = 1e-6;
|
|
67
84
|
const WATER_PI: f32 = 3.14159265358979;
|
|
@@ -153,38 +170,57 @@ fn water_particle_support_limit() -> f32 {
|
|
|
153
170
|
return 0.5 * water_particle_cell_size(WATER_PARTICLE_LEVELS - 1u);
|
|
154
171
|
}
|
|
155
172
|
|
|
156
|
-
//
|
|
157
|
-
fn
|
|
173
|
+
// An angle as a turn from 0 round to 2π.
|
|
174
|
+
fn water_particle_turn(angle: f32) -> f32 {
|
|
175
|
+
return angle - WATER_TAU * floor(angle / WATER_TAU);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Where round its centre a front's particles are not neighbours: an angle of the front's own, from its centre, so that
|
|
179
|
+
// fronts' ends lie anywhere rather than all to one side of them.
|
|
180
|
+
fn water_particle_break(particle: ${WATER_PARTICLE_STRUCT.wgsl_ref}) -> f32 {
|
|
181
|
+
let bits = pcg3d(vec3<u32>(bitcast<u32>(particle.origin.x), bitcast<u32>(particle.origin.y), particle.body)).x;
|
|
182
|
+
return f32(bits >> 8u) * (WATER_TAU / 16777216.0);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Whether two particles are of one front as it is drawn: one splash's, neither faded apart from the other, alike in all
|
|
186
|
+
// but angle. A doom does not part them until the fade it starts does: what is drawn is all that links them.
|
|
187
|
+
fn water_particle_alike(a: ${WATER_PARTICLE_STRUCT.wgsl_ref}, b: ${WATER_PARTICLE_STRUCT.wgsl_ref}) -> bool {
|
|
158
188
|
return a.body == b.body && all(a.origin == b.origin) && a.age == b.age && a.amplitude == b.amplitude
|
|
159
189
|
&& a.radius == b.radius && a.dispersion == b.dispersion;
|
|
160
190
|
}
|
|
161
191
|
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (members != u32(round(WATER_TAU / particle.dispersion))) { return 1u; }
|
|
170
|
-
var group = 1u;
|
|
171
|
-
for (var g = 0u; g < 20u && members % (3u * group) == 0u; g++) { group *= 3u; }
|
|
172
|
-
let distance = water_particle_distance(particle);
|
|
173
|
-
let half_length = water_particle_half_length_at(particle.radius, distance);
|
|
174
|
-
for (var g = 0u; g < 20u && group > 1u; g++) {
|
|
175
|
-
let dispersion = particle.dispersion * f32(group);
|
|
176
|
-
let width = max(dispersion * distance, 1e-3 * particle.radius);
|
|
177
|
-
if (water_particle_support(half_length, width, dispersion) <= water_particle_support_limit()) { break; }
|
|
178
|
-
group /= 3u;
|
|
179
|
-
}
|
|
180
|
-
return select(0u, group, offset % group == group / 2u);
|
|
192
|
+
// Whether b is a's neighbour round their front, β further on. Angles are compared as turns from the front's break, so
|
|
193
|
+
// its particles either side of it are never neighbours and a run of them never closes on itself; that pair's windows sum
|
|
194
|
+
// to one there as any unlinked pair's do.
|
|
195
|
+
fn water_particle_linked(a: ${WATER_PARTICLE_STRUCT.wgsl_ref}, b: ${WATER_PARTICLE_STRUCT.wgsl_ref}) -> bool {
|
|
196
|
+
if (!water_particle_alike(a, b)) { return false; }
|
|
197
|
+
let cut = water_particle_break(a);
|
|
198
|
+
return abs(water_particle_turn(b.angle - cut) - water_particle_turn(a.angle - cut) - a.dispersion) < 0.01 * a.dispersion;
|
|
181
199
|
}
|
|
182
200
|
|
|
183
|
-
//
|
|
184
|
-
fn
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
201
|
+
// A particle's window over x from its axis, |x| < β, and its derivative.
|
|
202
|
+
fn water_particle_taper(x: f32, dispersion: f32) -> vec2<f32> {
|
|
203
|
+
let t = WATER_PI * x / dispersion;
|
|
204
|
+
return vec2<f32>(0.5 * (1.0 + cos(t)), -0.5 * WATER_PI / dispersion * sin(t));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// The angular profile of a run of a front's particles at ψ round the front's centre from its first particle's axis, and
|
|
208
|
+
// its derivative: one from its first particle's axis to its last's, where the windows of neighbours β apart sum to one;
|
|
209
|
+
// past an open end the end particle's own window, all there is of the front there; past an end with a neighbour, nothing,
|
|
210
|
+
// since that neighbour's own run draws it there.
|
|
211
|
+
fn water_particle_run_profile(psi: f32, dispersion: f32, run: u32) -> vec2<f32> {
|
|
212
|
+
let span = f32(max(run & WATER_PARTICLE_RUN_MEMBERS, 1u) - 1u) * dispersion;
|
|
213
|
+
let onward = water_particle_turn(psi);
|
|
214
|
+
if (onward <= span) { return vec2<f32>(1.0, 0.0); }
|
|
215
|
+
var profile = vec2<f32>(0.0);
|
|
216
|
+
if ((run & WATER_PARTICLE_RUN_OPEN_START) != 0u && psi < 0.0 && psi > -dispersion) {
|
|
217
|
+
profile += water_particle_taper(psi, dispersion);
|
|
218
|
+
}
|
|
219
|
+
let past = onward - span;
|
|
220
|
+
if ((run & WATER_PARTICLE_RUN_OPEN_END) != 0u && past < dispersion) {
|
|
221
|
+
profile += water_particle_taper(past, dispersion);
|
|
222
|
+
}
|
|
223
|
+
return profile;
|
|
188
224
|
}
|
|
189
225
|
|
|
190
226
|
// The smallest hash level whose cell is at least the support's diameter, so the support overlaps at most
|
|
@@ -220,13 +256,13 @@ struct WaterParticleField {
|
|
|
220
256
|
displacement_gradient: vec2<f32>,
|
|
221
257
|
}
|
|
222
258
|
|
|
223
|
-
// The
|
|
224
|
-
// centre and u = ρ − distance across the front, ψ the angle around the centre
|
|
225
|
-
// envelope E(u) over half_length either side,
|
|
226
|
-
// Height a·E·T·cos; horizontal displacement −a·E·T·sin along the radius (Gerstner-like orbits, Yuksel's
|
|
227
|
-
// sign); with derivatives, ∇ψ = e_ψ/ρ.
|
|
228
|
-
fn
|
|
229
|
-
phase: f32) -> WaterParticleField {
|
|
259
|
+
// The run of a front's packets from the particle at offset d (water_particle_run_profile), which stands distance from
|
|
260
|
+
// its front's centre. ρ the radius from the centre and u = ρ − distance across the front, ψ the angle around the centre
|
|
261
|
+
// from the particle's direction: envelope E(u) over half_length either side, the run's profile T(ψ), carrier phase
|
|
262
|
+
// πu/r − phase. Height a·E·T·cos; horizontal displacement −a·E·T·sin along the radius (Gerstner-like orbits, Yuksel's
|
|
263
|
+
// longitudinal sign); with derivatives, ∇ψ = e_ψ/ρ.
|
|
264
|
+
fn water_particle_run_field(d: vec2<f32>, angle: f32, amplitude: f32, radius: f32, half_length: f32, dispersion: f32, distance: f32,
|
|
265
|
+
phase: f32, run: u32) -> WaterParticleField {
|
|
230
266
|
var field: WaterParticleField;
|
|
231
267
|
let direction = water_particle_direction(angle);
|
|
232
268
|
let tangent = vec2<f32>(-direction.y, direction.x);
|
|
@@ -236,15 +272,15 @@ fn water_particle_field(d: vec2<f32>, angle: f32, amplitude: f32, radius: f32, h
|
|
|
236
272
|
let u = (dot(d, d) + 2.0 * distance * dot(d, direction)) / max(rho + distance, 1e-30);
|
|
237
273
|
if (abs(u) >= half_length || !(rho > 0.0)) { return field; }
|
|
238
274
|
let psi = atan2(dot(d, tangent), distance + dot(d, direction));
|
|
239
|
-
|
|
275
|
+
let profile = water_particle_run_profile(psi, dispersion, run);
|
|
276
|
+
if (!(profile.x > 0.0)) { return field; }
|
|
240
277
|
let radial = q / rho;
|
|
241
278
|
let around = vec2<f32>(-radial.y, radial.x);
|
|
242
279
|
let eu = WATER_PI * u / half_length;
|
|
243
280
|
let envelope = 0.5 * (1.0 + cos(eu));
|
|
244
281
|
let envelope_du = -0.5 * WATER_PI / half_length * sin(eu);
|
|
245
|
-
let
|
|
246
|
-
let
|
|
247
|
-
let window_dpsi = -0.5 * WATER_PI / dispersion * sin(tv);
|
|
282
|
+
let window = profile.x;
|
|
283
|
+
let window_dpsi = profile.y;
|
|
248
284
|
let carrier = WATER_PI * u / radius - phase;
|
|
249
285
|
let c = cos(carrier);
|
|
250
286
|
let s = sin(carrier);
|
|
@@ -257,12 +293,18 @@ fn water_particle_field(d: vec2<f32>, angle: f32, amplitude: f32, radius: f32, h
|
|
|
257
293
|
let h_psi = -amplitude * envelope * window_dpsi * s;
|
|
258
294
|
let gradient_h = h_u * radial + (h_psi / rho) * around;
|
|
259
295
|
// the radius turns as the point moves around the centre: ∂e_ρ/∂x_j = e_ψ (e_ψ)_j / ρ
|
|
260
|
-
let
|
|
296
|
+
let swing = (h / rho) * around;
|
|
261
297
|
field.height = z;
|
|
262
298
|
field.slope = z_u * radial + (z_psi / rho) * around;
|
|
263
299
|
field.displacement = h * radial;
|
|
264
|
-
field.jacobian = mat2x2<f32>(radial * gradient_h.x +
|
|
300
|
+
field.jacobian = mat2x2<f32>(radial * gradient_h.x + swing * around.x, radial * gradient_h.y + swing * around.y);
|
|
265
301
|
field.displacement_gradient = gradient_h;
|
|
266
302
|
return field;
|
|
267
303
|
}
|
|
304
|
+
|
|
305
|
+
// One particle's packet: a run of one, its window over the dispersion β either side of its axis.
|
|
306
|
+
fn water_particle_field(d: vec2<f32>, angle: f32, amplitude: f32, radius: f32, half_length: f32, dispersion: f32, distance: f32,
|
|
307
|
+
phase: f32) -> WaterParticleField {
|
|
308
|
+
return water_particle_run_field(d, angle, amplitude, radius, half_length, dispersion, distance, phase, WATER_PARTICLE_LONE);
|
|
309
|
+
}
|
|
268
310
|
`, [chunk_water_spectrum, chunk_pcg3d, WATER_PARTICLE_STRUCT.declaration_chunk, WATER_PARTICLE_ENTRY_STRUCT.declaration_chunk]);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Time constant of a dying packet's fade: one that has fallen below the drawing threshold fades to a tenth of it, where
|
|
3
|
+
* it dies, and one a crowd doomed to a tenth of its steepness then; about a third of a second either way.
|
|
4
|
+
*/
|
|
2
5
|
export const WATER_PARTICLE_FADE_SECONDS: 0.15;
|
|
3
6
|
/**
|
|
4
7
|
* One frame of one wave particle (WATER_SURFACE_SIMULATION_PLAN_2026_10_06.md §5.1): it ages, spreads over its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_water_particle_step.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle_step.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"chunk_water_particle_step.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/water/surface/particles/chunk_water_particle_step.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,+CAAgD;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wCAFU,SAAS,CAuN8E;0BAlPvE,uCAAuC"}
|
|
@@ -6,7 +6,10 @@ import { RAY_HIT_INFO } from "../../../shader/chunk/geometry/ray/RAY_HIT_INFO.js
|
|
|
6
6
|
import { WATER_PARTICLE_STRUCT } from "./WATER_PARTICLE_STRUCT.js";
|
|
7
7
|
import { chunk_water_particle } from "./chunk_water_particle.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Time constant of a dying packet's fade: one that has fallen below the drawing threshold fades to a tenth of it, where
|
|
11
|
+
* it dies, and one a crowd doomed to a tenth of its steepness then; about a third of a second either way.
|
|
12
|
+
*/
|
|
10
13
|
export const WATER_PARTICLE_FADE_SECONDS = 0.15;
|
|
11
14
|
|
|
12
15
|
/**
|
|
@@ -141,11 +144,12 @@ fn water_particle_advance(input: ${WATER_PARTICLE_STRUCT.wgsl_ref}, dt: f32, geo
|
|
|
141
144
|
particle.amplitude *= sqrt(max(distance_before, 1e-30) / max(distance_after, 1e-30)
|
|
142
145
|
* half_length_before / water_particle_half_length(particle)) * exp(-water_particle_damping(particle.radius) * dt);
|
|
143
146
|
// below the threshold a packet fades out rather than vanishing: its amplitude decays on top of the water's own
|
|
144
|
-
// damping until it is a tenth of the threshold's height, where it dies
|
|
147
|
+
// damping until it is a tenth of the threshold's height, where it dies; and so does one a crowd doomed, until it is
|
|
148
|
+
// as steep as its doom says
|
|
145
149
|
let floor = threshold * particle.radius;
|
|
146
|
-
if (!(abs(particle.amplitude) >= floor)) {
|
|
150
|
+
if (particle.fading > 0.0 || !(abs(particle.amplitude) >= floor)) {
|
|
147
151
|
particle.amplitude *= exp(-dt / WATER_PARTICLE_FADE_SECONDS);
|
|
148
|
-
if (!(abs(particle.amplitude) >= 0.1 * floor)) { return WaterParticleStep(particle, particle, 0u); }
|
|
152
|
+
if (!(abs(particle.amplitude) >= max(0.1 * floor, particle.fading * particle.radius))) { return WaterParticleStep(particle, particle, 0u); }
|
|
149
153
|
}
|
|
150
154
|
// its support: its envelope's half-length either side of its front, its window's angle either side of its axis
|
|
151
155
|
let reach = water_particle_half_length(particle);
|