SapereAude1490 | Posted: 16 Jan 2025, 11:04 AM |
---|---|
![]() Member Posts: 3 Joined: 16-January 25 |
Hello there, I recently saw your incredible video about the fluid simulation pendant and I was in awe. I am learning WebGPU at the moment and trying to make a PIC-FLIP simulation using compute shaders. Now I started with the Ten Minute Physics approach, figuring out how it works. Obviously, I had to modify quite a few things to make it more GPU compatible - for example, I'm using the conjugate gradient method (with Jacobi preconditioner) for the solver instead of the Gauss Seidel method. I read in your blog post that you found a mistake in the Matthias' code in the boundary condition on the left edge. But I can't seem to spot it. Would you mind sharing more information on the mistake? Best regards. ------------- |
[top] | |
mit | Posted: 16 Jan 2025, 03:04 PM |
![]() yeah whatever Admin Posts: 596 Joined: 4-May 16 |
It is very subtle. Not sure if you mean you can't spot it in the source code, or can't see the effect in the demo. The particles on the left edge are constantly pushed downwards. It also affects the top edge if I remember right, if you invert gravity. I can check my notes, it was very tricky to spot (and doesn't really matter as the fluid sim clearly works anyway). Edit: OK found again what I think was the mistake, sent it as a pull request. Last edit by mit at 16 Jan 2025, 03:44 PM ------------- |
[top] | |
SapereAude1490 | Posted: 23 Apr 2025, 02:06 PM |
![]() Member Posts: 3 Joined: 16-January 25 |
Just a quick update. I managed to get it worker with compute shaders. Here's a demo: https://metarapi.github.io/fluid-sim-webgpu/. Note that it requires a chromium browser (for now) to work or Firefox nightly build. Thank you for your earlier response and the pull request! ------------- |
[top] | |
mit | Posted: 24 Apr 2025, 03:31 PM |
![]() yeah whatever Admin Posts: 596 Joined: 4-May 16 |
Nice work! I've not done much with shaders myself. I notice that if the damping is set to 1.0, there are some similar boundary effects to Matthias' version. I can't remember the details from when I implemented mine, but I do remember spending a long time making the walls work well. It's definitely possible to have the fluid eventually come to rest with only minimal friction on the walls. ------------- |
[top] | |
Sign in to post a reply.