Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Mobile beer + foam simulation
#2
(20-04-2020, 01:58 PM)Nyarlukhotep Wrote: Hello. Our task is to make a simulation of pouring beer into a glass with the generation of foam for mobile devices. After some searches and tests, we decided to purchase your asset, it is truly magnificent. Our idea is quite simple - this is a 2d game with beer pouring into a glass.
Alas, we ran into a performance issue. When using ObiFluidRenderer on mobile devices, we get 1-5 fps. This is not at all what we would like.
I read that Obi is well optimized and therefore confident that it is capable of more.
Also in Obi there is ObiFluidRendererFeature, which is designed for use with LWRP / URP. I tried using this, but unfortunately the result was similar.
Perhaps we are somehow doing it wrong.

Tell me, please, how to use Obi for the purposes we need? Maybe there is a video tutorial on Obi + mobile?

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.
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 josemendez - 20-04-2020, 05:44 PM
RE: Mobile beer + foam simulation - by josemendez - 20-04-2020, 06:04 PM