andreipitis / FluidDynamicsMetal

A fluid dynamics implementation using Metal for iOS and OSX.
MIT License
170 stars 23 forks source link
fluid-dynamics fluid-simulation ios metal osx swift

FluidDynamicsMetal

A fluid dynamics implementation using Metal for iOS and OSX.

fluiddynamics

Usage

There are two targets in this project, simply select the scheme of the one you wish to see and build it:

1. FluidDynamicsMetaliOS

Interaction for the iOS version is done through touch events, simply touch the screen and swipe in order to interact with the fluid.

Interacting with the OSX version is similar, you use the mouse to interact with the fluid, the space bar to pause the simulation and the S key to change the surface.

Changing parameters

Right now there is no settings view to select and configure the various parameters of the simulation, so if you wish to change some of the values and see how it affects the result, you're going to have to change the code for the shaders.

Understanding the simulation

If you wish to understand how all of this works, take a look here or here. These are some of the sources I used when creating the simulation.