Search Unity

Poor Man's Gas Dispersion / Fluid Dynamics System

Discussion in 'Scripting' started by Nigey, Feb 14, 2018.

  1. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Hi Guys,

    I'm trying to visualise a pseudo realistic gas dispersion / fluid dynamics model. So a few examples would be pressurised gas coming out of a pipe, liquids reaching boiling point and converting to gases from it's surface (like liquid nitrogen at room temperature), ect. I want to be able to show the density of the gas/fluid at any location or time.

    There's plenty of gas dispersion models kicking around on GitHub, so the algorithm itself isn't the hard part. I'm trying to figure out how to visualise it in a way that shows density and flow.

    I'm considering creating several meshes at runtime with custom shaders representing gases/liquids, and modifying the meshes per custom tick as dispersion carries on. Alternately I could create Shuriken particles in script and control the position of each one manually, and create some template particles for different levels of density (as having one particle per point would be INSANE. Gases are recorded in parts per million per kg cubed lol).

    Can anyone see any particular early issues with either of these two methods?

    FYI - I've tried the fluid dynamic systems on the Asset Store and they don't quite fit.

    Thanks!