Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Setting up 2D Sticky gooey white fluid
#1
Hi,
I just purchased Obi Fluid in order to use it in my WIP game.
I've read the documents and played the Obi Fluid for a while, but I can't quite figure out what I need to do exactly.
If you can point me into a right direction, that would be great. Sonrisa


I'd like to setup a scene where non-transparent sticky gooey white fluid(much like a paint) dripping down from the top flowing between simple objects in 2D space.
It's a mobile game so performance needs to be considered as well. How would I set this up?

Also, I'd like to control the amount of the fluid emitted depending a player stats. Should I use EmitParticle() and KillParticle()?

Thank you in advance.
Reply
#2
(17-08-2018, 04:47 AM)redhairjino Wrote: Hi,
I just purchased Obi Fluid in order to use it in my WIP game.
I've read the documents and played the Obi Fluid for a while, but I can't quite figure out what I need to do exactly.
If you can point me into a right direction, that would be great. Sonrisa


I'd like to setup a scene where non-transparent sticky gooey white fluid(much like a paint) dripping down from the top flowing between simple objects in 2D space.
It's a mobile game so performance needs to be considered as well. How would I set this up?

Also, I'd like to control the amount of the fluid emitted depending a player stats. Should I use EmitParticle() and KillParticle()?

Thank you in advance.

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. Sonrisa
Reply
#3
(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. Sonrisa

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).
Reply