Obi Official Forum
Obi Fluid for 3D paint - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Obi Fluid for 3D paint (/thread-2486.html)



Obi Fluid for 3D paint - sanyam - 14-09-2020

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?


RE: Obi Fluid for 3D paint - josemendez - 14-09-2020

(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.


RE: Obi Fluid for 3D paint - sanyam - 14-09-2020

(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.


RE: Obi Fluid for 3D paint - josemendez - 14-09-2020

(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/shaders-for-simulations/
https://www.alanzucconi.com/2016/03/09/simulate-smoke-with-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/2486965_Stable_Fluids