Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  [Resolved] (Android/Unity) The Obi Fluid Renderer kill the performance.
#1
Hi,

I have 250 3D particles. I use the default Obi Fluid Renderer (Color Material : FluidColorBlend, Fluid Material : CleaFluid).

With the Obi fluid Renderer activated i have 5~8 FPS
Without the Obi Fluid Renderer i have 50 FPS good enough for me.

The hardwer is a SM-T390 :
Processor : 8cores @ 1.4Ghz Exynos 787
GPU : Mali-T830
RAM : 3GB


Have you any idea to have water look&feel with 30~50FPS ?
Reply
#2
(28-06-2019, 08:48 AM)Suryavarman Wrote: Hi,

I have 250 3D particles. I use the default Obi Fluid Renderer (Color Material : FluidColorBlend, Fluid Material : CleaFluid).

With the Obi fluid Renderer activated i have 5~8 FPS
Without the Obi Fluid Renderer i have 50 FPS good enough for me.

The hardwer is a SM-T390 :
Processor : 8cores @ 1.4Ghz Exynos 787
GPU : Mali-T830
RAM : 3GB


Have you any idea to have water look&feel with 30~50FPS ?

Hi,

The default FluidRenderer is way too heavy for mobile use. Use the SimpleFluidRenderer instead, or write your own custom renderer. Note that the vanilla SimpleFluidRenderer only works in 2D though, you'd have to add rendering to the depth buffer to do 3D with it. See:

http://obi.virtualmethodstudio.com/tutor...ering.html
Reply
#3
Just adding the Write Depth on the simple shader ... doesn't work on the android. The particles have no rendering.

Code:
Shader "Toto/Fluid/Simple3DFluid"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
        _RefractionCoeff ("Refraction", Range (-0.1, 0.1)) = 0.01
        _Color ("Fluid color", Color) = (0.3,0.6,1,1)
    }

    SubShader
   {
        Cull Back
        ZWrite On
        ZTest LEqual

       Pass
       {
           Name "Simple3DFluid"
           Tags {"LightMode" = "ForwardBase"}
            Offset 1, 1

           Blend SrcAlpha OneMinusSrcAlpha

           CGPROGRAM
           #pragma vertex vert
           #pragma fragment frag
           //#pragma target 3.0

            #include "../Obi/Resources/ObiMaterials/ObiParticles.cginc"

...


Code:
Shader "Toto/Simple 3D Particles" {

Properties {
    _Color         ("Particle color", Color) = (1,1,1,1)
}

    SubShader
    {
        Cull Back
        ZWrite On
        ZTest LEqual

        Pass
        {
            Name "ParticleFwdBase"
            Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "ForwardBase"}
            Blend SrcAlpha OneMinusSrcAlpha  

            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma fragmentoption ARB_precision_hint_fastest

            #pragma multi_compile_fwdbase nolightmap

            #include "../Obi/Resources/ObiMaterials/ObiParticles.cginc"
Reply
#4
(28-06-2019, 11:16 AM)Suryavarman Wrote: Just adding the Write Depth on the simple shader ... doesn't work on the android. The particles have no rendering.

Code:
Shader "Toto/Fluid/Simple3DFluid"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
        _RefractionCoeff ("Refraction", Range (-0.1, 0.1)) = 0.01
        _Color ("Fluid color", Color) = (0.3,0.6,1,1)
    }

    SubShader
   {
        Cull Back
        ZWrite On
        ZTest LEqual

       Pass
       {
           Name "Simple3DFluid"
           Tags {"LightMode" = "ForwardBase"}
            Offset 1, 1

           Blend SrcAlpha OneMinusSrcAlpha

           CGPROGRAM
           #pragma vertex vert
           #pragma fragment frag
           //#pragma target 3.0

            #include "../Obi/Resources/ObiMaterials/ObiParticles.cginc"

...


Code:
Shader "Toto/Simple 3D Particles" {

Properties {
    _Color         ("Particle color", Color) = (1,1,1,1)
}

    SubShader
    {
        Cull Back
        ZWrite On
        ZTest LEqual

        Pass
        {
            Name "ParticleFwdBase"
            Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "ForwardBase"}
            Blend SrcAlpha OneMinusSrcAlpha  

            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma fragmentoption ARB_precision_hint_fastest

            #pragma multi_compile_fwdbase nolightmap

            #include "../Obi/Resources/ObiMaterials/ObiParticles.cginc"

Hi,

I don't see where you're adding depth RenderTexture to the renderer, reading from or writing to it in the shaders.. you've just added a ZWrite flag on two shaders, but that won't make your renderer work with depth automagically.

Read about how RenderTextures work in conjunction with shaders, and take the FluidRenderer's UpdateFluidRenderingCommandBuffer() implementation as reference on how to set up your buffers, and how to cull fragments in a fragment shader when they're occluded by scene geometry, based on what you read from the depth buffer.
Reply
#5
Ooo i have read too quickly. Rodar ojos
Thank you.

I test that.
Reply
#6
... I don't understand how work your shader system. _Maintex still white. I have no time for that... this the reason why I have buy your plugin. But surprise i have to implement the 3D rendering for android.

I'm a bit angry.
Reply
#7
(01-07-2019, 08:51 AM)Suryavarman Wrote: ... I don't understand how work your shader system. _Maintex still white. I have no time for that... this the reason why I have buy your plugin. But surprise i have to implement the 3D rendering for android.

I'm a bit angry.

Hi there,

3D simulation and rendering of fluid on most mobile platforms is very performance heavy (fluid simulation always is, regardless of target platform, more so on mobile), so we provide a 2D renderer for mobile, cheaper than the full 3D one by means of removing depth testing among other features, since that's what most people need fluids for in mobile games. Sorry if you were mislead by the asset info/videos, but we do warn about its performance implications in the store description.

You could still tweak the 3D one, removing functionality to make it faster. However each and every user will need a different combination of capabilities in their renderer (2D/3D, with/without foam, translucency, transmittance, reflection/refractions, opaque, flat colored or per-particle colored, etc...), and we can't possibly provide a renderer for each specific combination of features as there's hundreds. That's the reason why our rendering pipeline is designed to be extensible and modifiable by the user, kinda like Unity does with SRPs: we do expect most users to implement their own renderer as the included ones are meant for either high-quality rendering in desktop platforms (akin to HDRP), or basic rendering on less powerful devices (similar to LWRP).

If you want a refund, we have no problem with that. Just write to support(at)virtualmethodstudio.com including your Invoice Number.

kind regards,
Reply
#8
It's ok. Just with a custom Obi Particle Renderer and without Obi Fluid Renderer, i have a functionnal fluid for my needs.

Android:
100 3D Particles -> 15~30FPS.

Thanks for your reply.

Best Guiño
Reply