Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small FPS on Android mobile phone
#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


Messages In This Thread
RE: Small FPS on Android mobile phone - by josemendez - 15-01-2020, 09:05 AM
RE: Small FPS on Android mobile phone - by ktpttd - 15-02-2020, 05:38 AM