Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Running 3D Fluid on iOS
#5
(11-09-2018, 09:20 PM)skicattx Wrote: For any who read this later, an update.

In fact it does run just fine in Metal, on 2018.2.x on iOS. I was able to get the Faucet scene running on an iPhone X with 1000 3D particles in the bowl at nearly 90FPS, a total CPU frame time of about 12ms. So, it is quite possible to run the fluid sim on at least a high-end phone. Sure it's a simple example, but it does run just fine...at least with the default camera position. Move the camera in closer so the water fills more of the screen and it tanks, so the rendering does need some work...but a promising start...

Fillrate is most mobile devices achilles' heel, so moving the camera closer to the fluid (making it fill the entire screen) is probably getting the GPU to its knees. If you'd profile this, you'd see the fragment shaders taking up most of the frame time.

One easy way to alleviate this is to simply reduce the fluid rendering resolution. To do this, go to the UpdateFluidRenderingCommandBuffer() method in ObiFluidRenderer.cs, and reduce the resolution of all buffers. For instance:

Code:
renderFluid.GetTemporaryRT(refraction,-1,-1,0,FilterMode.Bilinear);

would become this, if rendering at half-screen resolution:

Code:
renderFluid.GetTemporaryRT(refraction,-2,-2,0,FilterMode.Bilinear);

Currently only the thickness buffers are rendered at half-res, but I think you can get away with less resolution for pretty much all buffers.
Reply


Messages In This Thread
Running 3D Fluid on iOS - by skicattx - 06-09-2018, 03:17 PM
RE: Running 3D Fluid on iOS - by josemendez - 06-09-2018, 04:40 PM
RE: Running 3D Fluid on iOS - by skicattx - 06-09-2018, 08:53 PM
RE: Running 3D Fluid on iOS - by skicattx - 11-09-2018, 09:20 PM
RE: Running 3D Fluid on iOS - by josemendez - 12-09-2018, 08:19 AM
RE: Running 3D Fluid on iOS - by skicattx - 12-09-2018, 01:36 PM