Posts: 5
Threads: 1
Joined: Jun 2019
Reputation:
0
28-06-2019, 08:48 AM
(This post was last modified: 02-07-2019, 11:00 AM by Suryavarman.)
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 ?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
28-06-2019, 08:57 AM
(This post was last modified: 28-06-2019, 08:57 AM by josemendez.)
(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
Posts: 5
Threads: 1
Joined: Jun 2019
Reputation:
0
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"
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(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.
Posts: 5
Threads: 1
Joined: Jun 2019
Reputation:
0
Ooo i have read too quickly.
Thank you.
I test that.
Posts: 5
Threads: 1
Joined: Jun 2019
Reputation:
0
01-07-2019, 08:51 AM
(This post was last modified: 01-07-2019, 08:57 AM by Suryavarman.)
... 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.
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
01-07-2019, 09:05 AM
(This post was last modified: 01-07-2019, 09:24 AM by josemendez.)
(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,
Posts: 5
Threads: 1
Joined: Jun 2019
Reputation:
0
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
|