I’m especially hopeful there are still improvements to be made to the technical side of the simulation. Please share your feedback and suggestions. Both demo scenes are included for your own experimentation. Ultimately, I found the multi-pass solution still looked the best. It uses a semi-lagrangian scheme to solve for pressure, and saves the result in the vector fields z-component. I eventually implemented a single-pass solution after facing challenges to the multi-pass solution. Trinity is a programmable 3D fluid simulator which runs in the browser on GPU via WebGL. Doing so rapidly caused massive disturbances to the vector field and flashing lights (warning)! I opted instead for using the vector field after viscosity had been added (and before the pressure gradient was subtracted) as the next frame’s initial vector field. Since the solution to the pressure gradient is perpetually lagging behind the rest of the math (and insufficient anyway), I also don’t use the final vector field as the next frame’s initial vector field. This repo is a little old and dusty and likely doesn't build with the latest tools, If you're looking for a version with working build instructions check out this fork: BathBombFluidDynamics by Oliver Curtis which adds some interesting effects. ![]() This problem becomes more pronounced as the number of Jacobi iterations for solving the pressure gradient increases. Cross-platform GPU fluid simulation Demo. However, every viewport in a scene adds a delay to the final output image. ![]() The main demonstration uses layered viewports to simulate multi-passes that converge on solutions for the viscosity as well as the pressure gradient of every pixel. It’s not as accurate as other simulations, and a major hurdle was the lack of proper multi-pass post-processing support in Godot. There’s a lot of great resources I’ll link to on that subject below. It attempts to solve the Navier-Stokes equation in real time by taking advantage of the parallelism of GPU’s. ![]() This is my implementation of a 2D Fluid Simulator in Godot 3.4.2, running on the GPU through Godot’s shader language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |