GPU shallow-water and sand simulation sandbox: real waves, erosion, sandcastles, digging tools, draggable rocks and floating props. Compute-based, mass-conserving, Unity 6.SandFlow turns a patch of your scene into a living beach diorama: a real-time GPU shallow-water solver coupled to granular sand transport, running entirely in compute shaders.WATER. A mass-conserving shallow-water core (Rusanov flux, positivity-preserving reconstruction) drives waves, surf, swash and backwash. Procedural wave dressing, caustics, foam, whitecaps and spray render on top of the simulated surface. Water level, wave amplitude, drift ripple and more are tunable live.SAND. Sand erodes, travels with the flow and settles: dig channels, watch the sea carve the shore, build dams and watch them fail realistically. Wet sand darkens and smooths; dry sand keeps wind ripples.INTERACTION. A full toolset ships in the demo: a shovel that scoops and pours real volume, castle stamps, terrain brushes, cannons, draggable rocks and props that displace water honestly and leave prints that heal, plus floating objects with buoyancy and wakes.TUNING. An in-game control panel exposes the simulation and look parameters, with persistent settings, map presets (beaches, rivers, lagoons, atolls) and camera controls.Ships as clean C# + compute/HLSL source with a complete interactive demo scene and a standalone-build entry point. Desktop platforms with compute shader support (DX11/DX12, Vulkan, Metal).RIVERS (new in 1.1). Three river maps in the demo picker: a spring fills a dry channel, the creek runs downhill to an open outlet, and the scene's boulders already stand as a dam, so a pond builds up and spills over - open it, move the rocks, or seal the gaps with the shovel. The River Preset Creator window turns a few dials (channel, slope, meander, banks, spring, discharge, dam) into your own river maps, and any surface PNG becomes a river with a small sidecar file. Water sources and drains ship as components.BEACH UPDATE (new in 1.1). Twelve original beach props at real-world scale, some of which float. Sand castles, walls and towers are stamped into the real sand field, so dry sand holds its walls and the surf erodes them. A cannon battery lobs real iron rounds: each round digs a crater the way the shovel digs, throws sand, and takes a castle wall out exactly where it hits, all as GPU work with the mass conserved.READY FOR MODIFICATION. The package includes SKILL.md (Assets/SandFlow/SKILL.md), a maintenance playbook for you or your AI coding agent: the layout, the call order, the invariants the simulation depends on, where each common change belongs and the traps already solved. That makes SandFlow easy to edit, extend and support.Real-time GPU shallow-water solver (compute shaders), exactly mass-conservingCoupled sand erosion, transport and deposition with wet/dry shadingProcedural wave dressing, caustics, foam, whitecaps and sprayInteractive tools: volumetric shovel, castle stamps, terrain brushes, cannonsDraggable rocks and props displace water honestly; prints heal when movedFloating objects with buoyancy and wakesIn-game tuning panel, persistent settings, 25+ map presetsFull C# and compute/HLSL source, interactive demo scene, standalone build entryRender pipelines: Built-in, URP 17 and HDRP 17 on Unity 6000.3Requires compute shader support: DX11/DX12, Vulkan or Metal, desktop platformsRivers (1.1): three river maps, spring sources and drains, open-outlet boundary, dry-start creeks with a standing dam, River Preset Creator windowBeach update (1.1): 12 real-scale beach props, real-sand castles and A-to-B walls, cannon rounds that dig craters and break castle walls where they hitSKILL.md included: a maintenance playbook for developers and AI coding agents, ready for modificationAI coding assistants were used to write and review C# and HLSL source code, the procedural Blender scripts that build the 3D props, the SVG tool icons (authored as vector code), the test and validation tooling, and the documentation (including SKILL.md). All code was verified by automated tests on Unity 6000.3.21f1 in Built-in, URP and HDRP. No AI image, texture, model or audio generators were used for any content shipped in the package.




