https://turbowarp.org/1239756460/fullscreen?fps=60 Now added foam (although doesn't look realistic yet. Im gonna also implement proper frustrum culling (the version rn I got slack so I just invent my own algorithm which doesn't work very well).
Unfortunately there's a bug where if u move ur camera, a bunch of foam is generated. Luckily, I know the problem. However, I cannot fix it until I rewrite the code to proper frustum culling. The engine is pretty bad tbh, I am going to remake this entirely from scratch (in scratch) but Im going to be inactive for around 2 months so it won't come out too soon. How the foam works (if anyone wants to know): The hessian determinant of the waves is computed (the determinant of a matrix of second order partial derivatives). This basically shows me where the slope is zero or the local maxima and minima. I then applied an exponential decay (which is buggy rn when you move your camera - I have to rewrite the rendering code before I can fix it) to make the foam accumulate.