The general Architecture of the engine is as follows: it has a Fluid Simulator class, which you need to properly initialize before use, and deintialize before you switch out of the scene or close the game, and Fluid GPU Resrouce class, where you need to do the same. Once you have the initialization behind you, you can build a pipeline, where you call the different steps of the fluid simulation, on various fields such as velocity, dye, temperature etc.
- You need to declare your Fluid Simulator class as a public member, through these you can set all the control parameters as well as (Make sure this is set) all the references to the various compute shaders in the project
- Initialization, do this somewhere like begin play/ Start
- Pipeline Building, you can configure this to your need, for example I am calling Project several times at the cost of performance, but you can call it only once. Also beside this dye you can use several dye textures etc, or none, or another field.
- The GPU resources need to be released so make sure you call these
- The Tick function sets all the relevant parameters (such as mouse position etc) in the update. Call this in your update or as regular as you want your simulation updated