Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small FPS on Android mobile phone
#1
Pregunta 
Hello!

I have Obi Fluid 5.0
unity 2019.2.12f1

mobile phone Sony compact z3 ( android 4.4.4 openGL es 3.0)
Xiaomi Redmi 4 ( android 6.0.1 openGL es 3.1)

Small FPS on Android telephone !
Video attached:
https://yadi.sk/i/qA7CTZn4GnbBlw
https://yadi.sk/i/zFFCqUWcKZ0eng

how to fix ?
thanks !
Reply
#2
(26-11-2019, 12:05 PM)android44444 Wrote: Hello!

I have Obi Fluid 5.0
unity 2019.2.12f1

mobile phone Sony compact z3 ( android 4.4.4 openGL es 3.0)
Xiaomi Redmi 4 ( android 6.0.1 openGL es 3.1)

Small FPS on Android telephone !
Video attached:
https://yadi.sk/i/zFFCqUWcKZ0eng

how to fix ?
thanks !

Mobile devices are generally very fill-rate limited. Using the standard FluidRenderer at full resolution will probably be too much for most mobile GPUs. Try using the SimpleFluidRenderer instead. The included sample scene "SimpleFluid" uses it.

Also, see:
http://obi.virtualmethodstudio.com/tutor...ering.html
Reply
#3
(26-11-2019, 12:16 PM)josemendez Wrote: Mobile devices are generally very fill-rate limited. Using the standard FluidRenderer at full resolution will probably be too much for most mobile GPUs. Try using the SimpleFluidRenderer instead. The included sample scene "SimpleFluid" uses it.

Also, see:
http://obi.virtualmethodstudio.com/tutor...ering.html

this option scene "SimpleFluid" does not suit me .
how can I optimize my scene ?
Reply
#4
(26-11-2019, 01:00 PM)android44444 Wrote: this option scene "SimpleFluid" does not suit me .
how can I optimize my scene ?

The SimpleFluid scene is optimized for mobile, all other scenes are optimized for multicore desktop computers.
Performance is the result of multiple factors:

- Amount of particles being simulated. The lower, the better for performance.
- The fluid blueprint's smoothing radius (see:http://obi.virtualmethodstudio.com/tutorials/emittermaterials.html). Again, the lower the better.
- Timestep settings (Unity's fixed timestep and max fixed tilmestep). The higher (longer) the timestep, the better.
- Solver settings (amount of substeps and density iterations). Fewer substeps/iterations result in better performance.
- Rendering resolution. Lower resolution yields better performance.

In mobile, the bottleneck is generally rendering. You can only determine this trough profiling your app in the device, using Unity's profiler. If rendering is indeed the bottleneck, then you should consider what your rendering needs are:

- If you need full 3D rendering with specular highlights, reflection, refraction, transmittance, turbidity and foam, using the standard FluidRenderer is your best bet. Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need.

- If you need simpler 2D rendering with refraction and transmittance, then start from SimpleFluidRenderer.

For most games, you'd want to write your own custom-tailored FluidRenderer anyway, as you might want some of the advanced features of the standard renderer, but not all.
Reply
#5
(26-11-2019, 01:49 PM)josemendez Wrote: The SimpleFluid scene is optimized for mobile, all other scenes are optimized for multicore desktop computers.
Performance is the result of multiple factors:

- Amount of particles being simulated. The lower, the better for performance.
- The fluid blueprint's smoothing radius (see:http://obi.virtualmethodstudio.com/tutorials/emittermaterials.html). Again, the lower the better.
- Timestep settings (Unity's fixed timestep and max fixed tilmestep). The higher (longer) the timestep, the better.
- Solver settings (amount of substeps and density iterations). Fewer substeps/iterations result in better performance.
- Rendering resolution. Lower resolution yields better performance.

In mobile, the bottleneck is generally rendering. You can only determine this trough profiling your app in the device, using Unity's profiler. If rendering is indeed the bottleneck, then you should consider what your rendering needs are:

- If you need full 3D rendering with specular highlights, reflection, refraction, transmittance, turbidity and foam, using the standard FluidRenderer is your best bet. Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need.

- If you need simpler 2D rendering with refraction and transmittance, then start from SimpleFluidRenderer.

For most games, you'd want to write your own custom-tailored FluidRenderer anyway, as you might want some of the advanced features of the standard renderer, but not all.

How can I reduce the number of triangles ?
Reply
#6
(29-11-2019, 03:37 PM)android44444 Wrote: How can I reduce the number of triangles ?

Hi,

There are no triangles involved in fluid rendering (well, two per particle, as they'r rendered as billboards). Maybe you meant particles? In that case, reduce the fluid blueprint's capacity parameter.
Reply
#7
(26-11-2019, 01:49 PM)josemendez Wrote: The SimpleFluid scene is optimized for mobile, all other scenes are optimized for multicore desktop computers.
Performance is the result of multiple factors:

- Amount of particles being simulated. The lower, the better for performance.
- The fluid blueprint's smoothing radius (see:http://obi.virtualmethodstudio.com/tutorials/emittermaterials.html). Again, the lower the better.
- Timestep settings (Unity's fixed timestep and max fixed tilmestep). The higher (longer) the timestep, the better.
- Solver settings (amount of substeps and density iterations). Fewer substeps/iterations result in better performance.
- Rendering resolution. Lower resolution yields better performance.

In mobile, the bottleneck is generally rendering. You can only determine this trough profiling your app in the device, using Unity's profiler. If rendering is indeed the bottleneck, then you should consider what your rendering needs are:

- If you need full 3D rendering with specular highlights, reflection, refraction, transmittance, turbidity and foam, using the standard FluidRenderer is your best bet. Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need.

- If you need simpler 2D rendering with refraction and transmittance, then start from SimpleFluidRenderer.

For most games, you'd want to write your own custom-tailored FluidRenderer anyway, as you might want some of the advanced features of the standard renderer, but not all.

Hi Jose,

Thank you for sharing the performance tips above, I find them very helpful.

- The requirements for my project are to render a full 3D fluid in mobile devices and I'm trying to optimize it as much as I can and that lead me to this thread. 
Now, you mentioned that by doing some tweaking in buffer resolution and shader code can help improve the performance: "Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need." - Will you be able to help me on this case ?

Thank you in advance
Reply
#8
(15-01-2020, 08:20 AM)N0Skillz Wrote: Hi Jose,

Thank you for sharing the performance tips above, I find them very helpful.

- The requirements for my project are to render a full 3D fluid in mobile devices and I'm trying to optimize it as much as I can and that lead me to this thread. 
Now, you mentioned that by doing some tweaking in buffer resolution and shader code can help improve the performance: "Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need." - Will you be able to help me on this case ?

Thank you in advance

Hi there,

Sure. Unity's GetTemporaryRT function (which is what is used to create the buffers in the FluidRenderer) will return a full screen buffer if passed -1 as the resolution, half-screen if passed -2, quarter-screen if passed -3, etc.

So simply try using lower values (I'd start with -2) in the renderFluid.GetTemporaryRT() calls in ObiFluidRenderer.cs UpdateFluidRenderingCommandBuffer() function. For instance:

Code:
// refraction (background), foam and fluid depth buffers:
renderFluid.GetTemporaryRT(refraction,-2,-2,0,FilterMode.Bilinear);
renderFluid.GetTemporaryRT(foam,-2,-2,0,FilterMode.Bilinear);
renderFluid.GetTemporaryRT(depth,-2,-2,24,FilterMode.Point,RenderTextureFormat.Depth);
    
// thickness/color, surface depth and normals buffers:
renderFluid.GetTemporaryRT(thickness1,-2,-2,16,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);
renderFluid.GetTemporaryRT(thickness2,-2,-2,0,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);
renderFluid.GetTemporaryRT(smoothDepth,-2,-2,0,FilterMode.Point,RenderTextureFormat.RFloat);
renderFluid.GetTemporaryRT(normals,-2,-2,0,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);

By default they all use full-screen resolution, except the thickness/color buffers which are rendered at half-resolution (they are blurred afterwards, so we don't need much detail).

This *should* improve performance in devices with high-density screens and low fillrate. Anyway, any tweaks you make should be profiling-driven (and always profile in the actual device, not the editor). Changing stuff without actually knowing if it impacts performance in your particular device is a waste of time at best.
Reply
#9
(15-01-2020, 09:05 AM)josemendez Wrote: Hi there,

Sure. Unity's GetTemporaryRT function (which is what is used to create the buffers in the FluidRenderer) will return a full screen buffer if passed -1 as the resolution, half-screen if passed -2, quarter-screen if passed -3, etc.

So simply try using lower values (I'd start with -2) in the renderFluid.GetTemporaryRT() calls in ObiFluidRenderer.cs UpdateFluidRenderingCommandBuffer() function. For instance:

Code:
// refraction (background), foam and fluid depth buffers:
renderFluid.GetTemporaryRT(refraction,-2,-2,0,FilterMode.Bilinear);
renderFluid.GetTemporaryRT(foam,-2,-2,0,FilterMode.Bilinear);
renderFluid.GetTemporaryRT(depth,-2,-2,24,FilterMode.Point,RenderTextureFormat.Depth);
    
// thickness/color, surface depth and normals buffers:
renderFluid.GetTemporaryRT(thickness1,-2,-2,16,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);
renderFluid.GetTemporaryRT(thickness2,-2,-2,0,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);
renderFluid.GetTemporaryRT(smoothDepth,-2,-2,0,FilterMode.Point,RenderTextureFormat.RFloat);
renderFluid.GetTemporaryRT(normals,-2,-2,0,FilterMode.Bilinear,RenderTextureFormat.ARGBHalf);

By default they all use full-screen resolution, except the thickness/color buffers which are rendered at half-resolution (they are blurred afterwards, so we don't need much detail).

This *should* improve performance in devices with high-density screens and low fillrate. Anyway, any tweaks you make should be profiling-driven (and always profile in the actual device, not the editor). Changing stuff without actually knowing if it impacts performance in your particular device is a waste of time at best.

Thank you for your prompt reply and for your support!

Yeah exactly, based on the profiling that I did I'm trying to improve the rendering part and also the collision/trigger handling side of things.

I will profile this and let's see the results.
Reply
#10
(26-11-2019, 01:49 PM)josemendez Wrote: The SimpleFluid scene is optimized for mobile, all other scenes are optimized for multicore desktop computers.
Performance is the result of multiple factors:

- Amount of particles being simulated. The lower, the better for performance.
- The fluid blueprint's smoothing radius (see:http://obi.virtualmethodstudio.com/tutorials/emittermaterials.html). Again, the lower the better.
- Timestep settings (Unity's fixed timestep and max fixed tilmestep). The higher (longer) the timestep, the better.
- Solver settings (amount of substeps and density iterations). Fewer substeps/iterations result in better performance.
- Rendering resolution. Lower resolution yields better performance.

In mobile, the bottleneck is generally rendering. You can only determine this trough profiling your app in the device, using Unity's profiler. If rendering is indeed the bottleneck, then you should consider what your rendering needs are:

- If you need full 3D rendering with specular highlights, reflection, refraction, transmittance, turbidity and foam, using the standard FluidRenderer is your best bet. Slightly tweaking buffer resolution and shader code to improve performance should be viable. I can help you with tweaking if you need.

- If you need simpler 2D rendering with refraction and transmittance, then start from SimpleFluidRenderer.

For most games, you'd want to write your own custom-tailored FluidRenderer anyway, as you might want some of the advanced features of the standard renderer, but not all.
Hello, I have same issue on mobile.
Beside, when I copy Solver(Emitter), Obi Simple Fluid Renderer from SimpleFluid Scene to my own Scene, change to Mode3D. It doesn't work, the water is invisible.
But when I use BOTH Obi Simple Fluid Renderer & Obi Fluid Renderer, the water comes out.
Finally, if I need Mode3d + SimpleFluid(without depth testing, refraction, uniform color, no lightning), How can I tweak for better performance at mobile device?
Thank you very much!
Reply