This is Miami in Wrecked District, a car combat game I'm making in Bevy 0.20 (native only).
The tide runs on a schedule: low water, then a surge that runs inland as a front at about 70% of a car's top speed (you can outrun it, barely), high water for 35 s, then it drains back over about a minute. It's not just a visual: the water behind the front shoves cars inland (harder the deeper it stands over the wheels and the lighter the car), the backwash drags them back, and a car in water loses HP every second. The police AI reads the same front as a forecast and won't send a car where the water is about to be. Physics, the AI's forecast and the renderer all evaluate the same front function.
On the render side:
- I patched bevy_pbr with a small weather block at view binding 40 that every lit surface reads, so asphalt, kerbs and cars get wet where the water actually ran. The tide state lives in it too.
- The sea is a custom material with WESL shaders. A 640x640 depth field is baked once per city from the same terrain the physics uses, so shallow colour, sand and surf follow the real shoreline.
- The swell slows as it shoals (c ~ sqrt(depth)), so crests bunch towards the beach instead of being evenly spaced lines.
- The flood front is a bore: a raised crest with a foam cap, broken water behind it aged by the time since the front passed. The curling breakers are parametric mesh sections.
- The prepass evaluates the surface at this frame's and the previous frame's time, so TAA gets real motion vectors for the breakers instead of smearing them.
Gotcha: smoothstep with reversed edges is undefined in SPIR-V, and some drivers return NaN and drop whole triangles.
I looked at bevy_water and bevy-aqua first. Both are built for open water and I needed a shoreline that floods, so I wrote my own and borrowed their ideas for shoaling and foam.
Happy to go deeper into any part.
Disclosure, since it matters here: most of the game's code, this water included, is written with AI coding assistants under my direction. Everything in the clip is the game's own renderer; there are no AI-generated assets in it