A Metal-based shader animation project that creates a wave-like effect using Metal Shading Language (MSL).
- ✅ Metal-based GPU rendering for smooth performance.
- 🎨 Customizable animation speed when initializing the view.
- 📱 Optimized for iOS using
MTKView
and UIKit. - 🔄 Real-time animation using
draw(_:)
method. - 🌊 Shader-powered wave effect, inspired by this animation.
GIF 1 | GIF 2 | GIF 3 |
---|---|---|
![]() |
![]() |
![]() |
0.1x Speed | 0.5x Speed | 1x Speed |
Clone the repository:
git clone https://github.com/mertozseven/WavesMetal.git
cd WavesMetal
Add MetalView
to your HomeViewController
:
final class HomeViewController: UIViewController {
lazy var metalView = MetalView(frame: view.frame, animationSpeed: 0.5) // Adjust speed
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(metalView)
}
}
You can adjust the wave speed by modifying the initializer:
let metalView = MetalView(frame: view.bounds, animationSpeed: 2.0) // Faster animation
- Swift 5+
- Metal API (iOS 14+)
- Xcode 14+
MIT License. Feel free to use, modify, and share!
✨ Built with ❤️ by Mert Ozseven