Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Solver.OnParticleCollision not work + mix 3 color
#4
All per-particle data arrays (position, velocity, color, userData, etc) store a value for each particle. So userData[i] is the data for particle i, not any of its neighbors.

During the simulation, each particle averages its userData with the neighboring particles via density constraints, that's how diffusion is implemented.

So all you need to do is set the desired color of each fluid type in the diffusion data (userData) or the blueprint, then at runtime iterate over all particles and set color[i] = userData[i] at the end of every frame. That's all there is to it. Let me know if you need help writing the code for this.
Reply


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