3 ms·
I understand why real 3D fluid sim is much harder to do at reasonable speeds than 2D but I wonder if there's a pseudo-3D version that would look good (I'm espec
by andybak 6y ago
I understand why real 3D fluid sim is much harder to do at reasonable speeds than 2D but I wonder if there's a pseudo-3D version that would look good (I'm especially thinking of VR here)
A few transparent layers to add depth? Or something akin to parallax occlusion mapping?
EDIT - this Shadertoy is remarkably awesome despite only running on a 128x128x128 grid: https://www.shadertoy.com/view/wlG3RW https://www.shadertoy.com/view/wlG3RW
- xioxox 6y agoThere's this paper which describes a simplified fluid dynamics appropriate for games: Real-Time Fluid Dynamics for Games by Jos Stam. You can find the paper and implementations by searching. It's based around numerical stability and speed, rather than accuracy. I think it would be interesting to put this into a simcity-like game to get good air pollution maps. I'm not sure if this WebGL page is based around this algorithm.
- iainmerrick 6y agoWhat does that have to do with 3D versus 2D?
- xioxox 6y ago3D is hard to do in real time as you have many more grid points. The method I linked to is much faster than properly solving the fluid equations, so is suitable for a 3D interactive simulation.
- slavik81 6y agoThe GitHub WebGL page is based on a GPU Gems article, which was based on Stable Fluids. The ShaderToy 128³ cube appears to be quite different. I don't entirely follow what it's doing, but the pressure solve seems to be heavily simplified.
- imjasonmiller 6y agoI recently came across EmberGen which seems to offer real-time volumetric fluid simulation [1] and I wonder what's driving it and whether it's down to the hardware, algorithm or something else? 1. https://youtu.be/iDqWLwYhd9Y https://youtu.be/iDqWLwYhd9Y
- dorkwood 6y agoParallax occlusion mapping is quite heavy itself, though. Transparent layers stacked on top of each other are also quite expensive due to overdraw. Probably the cheapest way to add a little bit of 3D-ness would be to write the fluid sim to a texture, use it as a height map, and sample the texture a second time while offsetting the uvs slightly based on height map and camera position. Still not a great solution, and would probably only work if it was a wall of fluid in front of you.