06-09-2018, 08:53 PM
(06-09-2018, 04:40 PM)josemendez Wrote: 1.- Performing a full 3D fluid simulation in mobile is going to use most of the resources in the device (supposing it is even capable of running it, which is a long shot), so unless your game revolves around it I'd advise against doing that. However nothing stops you from running a 3D simulation in a mobile device, you just need to adapt rendering to take depth testing into account. The physics simulation itself is platform agnostic and doesn't care if it is running in 2D or 3D. The only difference lies in rendering.
Obi's fluid renderer pipeline is made to be extensible. Akin to Unity's SRP, it allows you to write your own renderer/shader combinations and comes with two working implementations, each one at one end of the quality/performance spectrum: FluidRenderer (high quality, performance heavy) and SimpleFluidRenderer (low quality, lightweight). See:
http://obi.virtualmethodstudio.com/tutor...ering.html
The SimpleFluidRenderer is designed with mobile devices in mind, since most aren't capable of running a full 3D simulation. Pretty much all fluid gameplay dynamics we've seen in mobile devices are 2D. For this reason the SFP only supports 2D rendering.
You could either:
- Grab the FluidRenderer, see how it performs in your target device, and tweak it until performance is acceptable (downscale fluid buffers, drop lightning calculations from the shaders, etc).
- Build depth-testing on top of the SimpleFluidRenderer.
2.- Yep, it is compatible with all Unity versions up to 2018.2. Haven't tested 2018.3 yet, but should work fine there too.
Thanks for the info. A couple more questions:
3. Does this work with Metal, or does it require OpenGL on iOS? We are using Metal only.
4. "adapt rendering to take depth testing into account" Is there something about the PC 3D fluid rendering pipeline, say in the Unity example scene with the faucet and bowl, that would not function on say an iPhone 10, or iPad Pro? Just slowly.
We would certainly customize the rendering to our use case, but for now I just want to get something visible on the device regardless of performance.