Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Is there a way to calculate "bulks"?
#1
Pregunta 
Is there a way to know if a particle is part of a bigger chunk of fluid?

I want to do a system in which two emitters emit the same fluid with different colors each, and as they mix together, so does the color of all the fluids. Similar to the "FluidMixing" sample scene, with the difference in that scene the color change occurs on an individual particle basis; here I want it to happen to everything connected to the bigger mass of fluid, bus skip droplets that aren't part (yet) of the bigger mass.

On a somewhat related question. In that "FluidMixing" sample scene I saw the main script in charge of changing the color uses the "userData" property; according to the manual, that property holds data that was... well, placed there by the user. But I didn't saw any other place in which those values could have been modified (or added, to begin with), so I'm not sure how that works.

Thanks.
Reply
#2
(04-03-2021, 10:41 PM)Samadhi Wrote: Is there a way to know if a particle is part of a bigger chunk of fluid?

No built-in way to do that. There's no concept of "fluid chunk" in Obi (or in any other fluid simulator afaik). This is partly because there's many possible definitions of what a "chunk" is, but mainly because there isn't any need to keep track of chunks to simulate fluid dynamics.

(04-03-2021, 10:41 PM)Samadhi Wrote: I want to do a system in which two emitters emit the same fluid with different colors each, and as they mix together, so does the color of all the fluids. Similar to the "FluidMixing" sample scene, with the difference in that scene the color change occurs on an individual particle basis; here I want it to happen to everything connected to the bigger mass of fluid, bus skip droplets that aren't part (yet) of the bigger mass.

To do this you could implement some kind of "flood fill" algorithm: start from one particle, check its immediate neighbors, tint them if they have a different color. Then repeat this recursively for each neighbor: check its neighbors, tint them, etc. Similar to a pre-order traversal of a tree.

This is considerably expensive though, so I'd advise against doing it every frame.

(04-03-2021, 10:41 PM)Samadhi Wrote: On a somewhat related question. In that "FluidMixing" sample scene I saw the main script in charge of changing the color uses the "userData" property; according to the manual, that property holds data that was... well, placed there by the user. But I didn't saw any other place in which those values could have been modified (or added, to begin with), so I'm not sure how that works.

Thanks.

These can be defined in the fluid blueprint, look for "diffusion data":
http://obi.virtualmethodstudio.com/tutor...rials.html

Quote:There's 4 diffusion channels available. The meaning of these channels is completely up tp you: each one could be temperature, color, viscosity, or any other. The data contained in these 4 channels is smoothed out between particles over time, at a rate determined by the average diffusion property (see above).

cheers!
Reply