Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Fluid for 3D paint
#1
Hi,

I want to paint on a canvas. It will be 3D and there shall be gravity acting on the paint fluid as well. Do you think Obi Fluid can do the job for this particular task?
Reply
#2
(14-09-2020, 08:15 AM)sanyam Wrote: Hi,

I want to paint on a canvas. It will be 3D and there shall be gravity acting on the paint fluid as well. Do you think Obi Fluid can do the job for this particular task?

In realtime, I'm afraid not. In a canvas there's barely any pressure, vorticity, or other fluid effects that may make using a particle-based simulation worthwhile. So using ObiFluid (or any other particle-based system) for this is absolute overkill.

This use case screams texture-space fluid simulation in a fragment shader. As long as you don't need paint to drip off the canvas, a simple shader that smears paint in the direction of gravity will get the job done much faster and easier.
Reply
#3
(14-09-2020, 08:19 AM)josemendez Wrote: In realtime, I'm afraid not. In a canvas there's barely any pressure, vorticity, or other fluid effects that may make using a particle-based simulation worthwhile. So using ObiFluid (or any other particle-based system) for this is absolute overkill.

This use case screams texture-space fluid simulation in a fragment shader. As long as you don't need paint to drip off the canvas, a simple shader that smears paint in the direction of gravity will get the job done much faster and easier.
But I also want to add different kinds of paint which will push around the previous paint particles when poured on to them.
Reply
#4
(14-09-2020, 08:23 AM)sanyam Wrote: But I also want to add different kinds of paint which will push around the previous paint particles when poured on to them.

This is what the smearing/smudge tool does in most painting programs, isn't it? This is much faster to do in a shader, considering you're limiting yourself to an essentially 2D canvas.

Even if you wanted to get really fancy, with effects similar to the paint pouring technique:
[Image: Pour-Painting-1.jpg]

Using 2D velocity fields to displace the paint would still be so much simpler and faster than a full blown 3D particle based fluid simulation. You might want to look into 2D shader based fluid simulators such as Cocuy if you want a ready-made solution that does this.

if you want to roll your own, Alan Zucconi has a great tutorial series on how to do 2D simulation using shaders:
https://www.alanzucconi.com/2016/03/02/s...mulations/
https://www.alanzucconi.com/2016/03/09/s...h-shaders/
These two links will get you 70% of the way. Once you've got a basic simulation going on, Josh Stam's stable fluids will do the rest:
https://www.researchgate.net/publication...ble_Fluids
Reply