Skip to content

fluid engine developed by using Swift and Metal which is fully speeding up by using Metal Compute Shader and Grand Central Dispatch

License

Notifications You must be signed in to change notification settings

yangfengzzz/fluid-engine-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is inspired by fluid-engine-dev which can support bunch of numerical methods like Flip and SPH. This project transfer all C++ code from fluid-engine-dev by using Swift, which is a very elegent language. Swift is a young language which have less third-party code and I found nothing about numerical simulation at all. luckily Swift 5 is ABI stable and Grand Center Dispatch is functioning well which can replace TBB very well.

GPGPU is the other reason to do this transferment. By using Swift, this project can use Metal API by not writing the Objective-C bridge (which is the common way for graphics engines to use GPU in Apple ecosystem.) you can simplely change Renderer like:

Renderer.arch = .GPU

GPU method will launch kernel to replace Grand Center Dispatch to accelerate the simualtion.

This project is still on the development which will add more render features like rayMarching and rasterization. My willingness is to use Metal to replace all Python visuallization code in fluid-engine-dev and display the simulation results on the screens simultaneously.

At last by not least, this project use the drawble object MTKView with SwiftUI. so It is easy to add button and text in GUI which can control the settings of the simualtion.

About

fluid engine developed by using Swift and Metal which is fully speeding up by using Metal Compute Shader and Grand Central Dispatch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published