This is the first time I partcipate on one of Harrys challenge, for this one we had to create a waterfall and I decided to implement a waterfall with flow interruption.
A lot of what I did comes from James Broderick breakdown of his effect.
To perform the interaction I have an orthographic camera above the waterfall that renders the Y position of a sphere into a texture. With this, you can already interrupt flow, but only on a straight line, to make the water fall afterwards I have a compute shader that receives the texture that the camera rendered and does the following:
First of all, it writes on the R channel the Y position of the sphere and on the G channel the Y position of the sphere + some offset, this G channel is then used to make the foam around the cut-out area. This pass does not clear the texture, the sphere leaves a trail on the texture.
Then in a second pass, the compute shader subtracts a delta to everything on the texture, this way we simulate that the sphere is leaving a trail that falls down.
Now it's only a matter of cutting out all the parts of the waterfall that are below something on the texture, the compute shader will keep on subtracting and the flow will continue.
The shading on the waterfall is quite simple, the only thing is that the uvs are unwrapped to go from 0 to 1 from the beginning to the end of the waterfall to simulate the flow of water, also the part that falls is shrunk on the uvs to make the water appear to scroll faster.
The other interesting thing is that to make the waterfall appear to have volume the inside faces are painted white so that they blend with the outline on the outside.
To shade the ripple effect i made the following mesh:
The uvs are also used to move the ripples from the center to the outside so i unwrapped them like the this: