Posts: 4
Threads: 2
Joined: Nov 2019
Reputation:
0
26-11-2019, 12:05 PM
(This post was last modified: 26-11-2019, 12:55 PM by android44444.)
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 !
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
26-11-2019, 12:16 PM
(This post was last modified: 26-11-2019, 12:16 PM by josemendez.)
(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
Posts: 4
Threads: 2
Joined: Nov 2019
Reputation:
0
26-11-2019, 01:00 PM
(This post was last modified: 26-11-2019, 01:01 PM by android44444.)
(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 ?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
26-11-2019, 01:49 PM
(This post was last modified: 26-11-2019, 01:51 PM by josemendez.)
(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.
Posts: 4
Threads: 2
Joined: Nov 2019
Reputation:
0
(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 ?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
29-11-2019, 04:57 PM
(This post was last modified: 29-11-2019, 04:58 PM by josemendez.)
(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.
Posts: 4
Threads: 0
Joined: Jan 2020
Reputation:
0
(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
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
15-01-2020, 09:05 AM
(This post was last modified: 15-01-2020, 09:11 AM by josemendez.)
(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.
Posts: 4
Threads: 0
Joined: Jan 2020
Reputation:
0
(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.
Posts: 1
Threads: 0
Joined: Jan 2020
Reputation:
0
(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!
|