GitPedia

Water

Simple calculation to render cheap water effects.

From KrisYu·Updated June 11, 2026·View on GitHub·

1. how to use Metal draw compute shader, or known as 'kernal function'. 2. share code between iOS/OSX, both targets are built in the same project. The project is written primarily in Swift, first published in 2017. Key topics include: compute-shader, ios, kernel-functions, metal, osx.

Water

Simple calculation to render cheap water effects.

Swift 3.0 License MIT

This simple project demonstrates :

  1. how to use Metal draw compute shader, or known as 'kernal function'.
  2. share code between iOS/OSX, both targets are built in the same project.

Demo - Mac

Mac

Demo - iPhone

iPhone

Build and Run

Choose to run OSX or iOS version.

Notice: iOS simulator doesnot support Metal framework, you have to run it on a real A7 iPhone.

Thanks

This is an experiment with Apple Swift/Metal shading language. Bascially I just port this WebGL shadertoy to Metal.

  • Special thanks to Victor Korsun for letting me use his shader code
  • http://metalkit.org for all the nice tutorials

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from KrisYu/Water via the GitHub API.Last fetched: 6/26/2026