24-08-2022, 07:32 AM
(This post was last modified: 24-08-2022, 07:36 AM by josemendez.)
(24-08-2022, 04:53 AM)khanx078 Wrote: so for that scene , when i remove the gradients from the color, like only give one color to emitter A and another color to emitter B they do not mix ,
That's not how mixing works. The gradients represent the color transition for each fluid when they come in contact with each other: the color at the left of the gradient is one fluid in unmixed state, the color at the other end is the color of the other fluid in unmixed state, and the color in the middle of the gradient is the color of a 50/50 mix.
If you remove the gradients and use flat colors, no mixing will take place at all because you're asking for colors to be the same regardless of mixing percentages.
Note that you don't have to rely on gradients to do mixing, it's just how the sample scene does it. At its core, mixing works by assigning 4 user-defined values to all particles in each fluid blueprint, then averaging these values together when particles get close to each other. This process is called diffusion, and can be used for many things other than color mixing (heat transfer, chemical reactions, etc), see the manual for details: http://obi.virtualmethodstudio.com/manua...usion.html)
You can use these 4 values any way you want: you can store RGB values in them and use the result as a color directly, or you can use them to drive other properties. For instance, the sample scene uses just 1 out of the 4 values, and uses it to sample a color gradient.
If you want to mix 3 colors and use a custom look up table to determine how the different mixes should look like (as opposed to just averaging the 3 colors), you can still use a single user defined value together with barycentric interpolation of colors in a triangle.
kind regards,