24-08-2022, 08:51 AM
(24-08-2022, 07:32 AM)josemendez Wrote: 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.got it, one more thing is that the performance is taking a very big hit, I am using the burst renderer as pointed out in the tutorial on youtube and turned vsync of , used late update.... but my frame rate on pc in a very simple scene is around 18 FPS on a gtx 1080... What can i do to improve performance in your youtube video it jumped but in my case it jumped from 6 fps to 18 fps
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,