Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Solver.OnParticleCollision not work + mix 3 color
#2
1.- solver.OnParticleCollision returns collisions between particles. If you're emitting fluids, you will always get zero contacts as fluid particles do not collide with each other. Fluids use density constraints to try and keep constant local density. If they collided, you'd get granular (sand) simulation instead. From the manual:

Quote:Density constraints

Each density constraint tries to keep the amount of mass in the neighborhood around a particle constant. This will push out particles getting too close (as that would increase the mass) and pull in particles going away (which results in surface tension effects). Used to simulate fluids. High iteration counts will make the fluid more incompressible, so it will behave less like jelly.

2.- Diffusion works by averaging diffusion data between neighboring particles. There's 4 diffusion channels: x,y,z and w. You can use each one to average one "property" of the fluid, which one is up to you. Could be color, viscosity, vorticity, or any other.

For instance, the "Raclette" sample scene maps "x" to viscosity, and "y" to surface tension.

To mix two colors, you can use a single diffusion channel and lerp (linearly interpolate) between the two colors based on the value of the channel. To mix many colors (3,4,5...), the easiest way is to use the x,y,z diffusion channels to store color r,g,b, and use them directly. This way you can have as many colors as you want.
Reply


Messages In This Thread
RE: Solver.OnParticleCollision not work + mix 3 color - by josemendez - 18-06-2020, 09:27 AM