21-08-2018, 12:36 PM
(This post was last modified: 21-08-2018, 12:40 PM by josemendez.)
(21-08-2018, 05:30 AM)redhairjino Wrote: Now that I've gained more knowledge about Obi Fluid, I will add more explanation to my question.
Please take a look at the attached image for easier understanding.
I am trying to make flat 2D game with orthographic camera where sticky fluid flows(drips) downward as shown in the image.
The fluid will be generated where the arrows are at as a player does some appropriate actions.
Details aside, the goal of the game is to generate as much as fluid as possible.
The fluid has to have thick and gooey feel to it(like FluidViscosity sample) , and it's going to be white and non-transparent.
The fluid don't need to interact with a light. It's always going to be solid white no matter what.
It's a mobile game, so I need to be careful about performance also.
My questions are:
1) What is your suggestion going about achieving this? 2D simple fluid & simple renderer with 2D mode? Or go with full 3D mode?
2) How do you create a white non-transparent fluid? It seems like changing the particle color to white makes fluid transparent rather than white.
Thank you.
1) 2D mode, and SimpleRenderer without a doubt: you do not need depth testing, reflections or refractions of any kind (which would negatively affect performance).
2) Write a custom shader that does not perform refraction. Instead it should simply return a color. You can use ObiMaterials/SimpleFluid.shader as a starting point. Line 65 should read:
Code:
return output*_Color;
by changing it to
Code:
return _Color;
you should achieve what you want. For maximum performance, you could even modify ObiSimpleFluidRenderer (or write your own renderer:http://obi.virtualmethodstudio.com/tutorials/customparticlerendering.html) so that it does not grab the background image for the refraction effect (which you are not using anyway).