Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Is there any information or tools available for the simulation of fluids such as water in ECS?

Discussion in 'Physics for ECS' started by yifanchu183, Aug 27, 2022.

  1. yifanchu183

    yifanchu183

    Joined:
    Jul 4, 2019
    Posts:
    41
    I need some help to implement fluid simulation and to be able to interact with other entities in DOTS physics.Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics

    It's certainly doable in DOTS Physics, the Unity version has source so you'd be able to probably get something going that's performant. Havok would perform faster if using primitives, but for the best performance you'd want to code SPH from scratch in DOTS.

    The real problem isn't the behaviour but trying to get it at a decent performance by spatially dividing up the work, and good luck with that!

    In any case, once it's working you can render the particles to a buffer, blur it, generate a normal map and so on - that's the general way fluids are done with physics.

    You didn't indicate how much realism you needed, the depth, and so on. All these factors will change how much work you'd need, so I gave a pretty basic response.