Skip to content

A simple Metal shader project that creates a smooth, animated wave effect using Metal Shading Language (MSL) with customizable animation speed.

License

Notifications You must be signed in to change notification settings

mertozseven/WavesMetal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WavesMetal

A Metal-based shader animation project that creates a wave-like effect using Metal Shading Language (MSL).

Features

  • 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.

Demo

GIF 1 GIF 2 GIF 3
1xspeed 0.5xspeed 0.1xspeed
0.1x Speed 0.5x Speed 1x Speed

Installation

Clone the repository:

git clone https://github.com/mertozseven/WavesMetal.git
cd WavesMetal

Usage

1️⃣ Initialize in Your View Controller

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)
    }
}

2️⃣ Customize Animation Speed

You can adjust the wave speed by modifying the initializer:

let metalView = MetalView(frame: view.bounds, animationSpeed: 2.0) // Faster animation

Dependencies

  • Swift 5+
  • Metal API (iOS 14+)
  • Xcode 14+

License

MIT License. Feel free to use, modify, and share!


✨ Built with ❤️ by Mert Ozseven

About

A simple Metal shader project that creates a smooth, animated wave effect using Metal Shading Language (MSL) with customizable animation speed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published