Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Mobile beer + foam simulation
#3
(20-04-2020, 02:49 PM)josemendez Wrote: Hi,

While Obi is indeed extremely well optimized (fully multithreaded, hand-optimized simd, data-oriented design written in unmanaged code), this does not mean you can throw anything to a mobile device and get the same performance you get in a desktop computer. Profile your game. I cannot stress enough the importance of this.  Mobile devices are completely different beasts compared to desktop computers, and their requirements/performance profile are very different.

Off the top of my head, I can think of two potential culprits for general low-performance on mobile devices:

- Death spiraling. This is very often a cause of terrible performance for physics-intensive applications, not just when using Obi, but any physics engine. There's many threads on the forums regarding this, and many good online resources that explain it very well and how to deal with it. If you find that FixedUpdate() is being called more than once per frame according to your profiler, there's a good change this is the issue. Try reducing your max fixed timestep to limit the amount of time Unity can spend per frame on physics.

- Too expensive rendering: Mobile devices are extremely fillrate -limited. Obi's built in fluid renderer is a kind of deferred renderer, and most mobile devices have high-density screens. Pair both, and you have a very expensive per-fragment shader that must be run several times per pixel in a high-density screen using a moderately powerful GPU = slow rendering. That's why ObiSimpleFluidRenderer exists, and why the rendering pipeline was designed to be easily extensible to accommodate custom renderers. Again, you will find if this is your case by profiling. In that case, try using ObiSimpleFluidRenderer instead. See: http://obi.virtualmethodstudio.com/tutor...ering.html

We're able to get +60 fps on an iPhone 7, 1000 particles on screen using the simple renderer and making sure no death spiraling takes place, so there's a good chance you're being bitten by one of the two (or the two) issues I mentioned.

Thanks for the answer. The profiler shows that the problem is in rendering. Unfortunately, the profiler does not support the GPU of my device, however, I see that VSink takes an incredibly long time waiting for the renderer.

I absolutely understand that although the Obi is optimized, it will not behave like on desktop devices, but I still hope to get at least 20 fps. I already tried changing the depth buffer values for GetTemporaryRT in ObiFluidRendererFeature, alas, to no avail...
Reply


Messages In This Thread
Mobile beer + foam simulation - by Nyarlukhotep - 20-04-2020, 01:58 PM
RE: Mobile beer + foam simulation - by josemendez - 20-04-2020, 02:49 PM
RE: Mobile beer + foam simulation - by Nyarlukhotep - 20-04-2020, 04:17 PM
RE: Mobile beer + foam simulation - by josemendez - 20-04-2020, 05:44 PM
RE: Mobile beer + foam simulation - by josemendez - 20-04-2020, 06:04 PM