a Perlin Noise Visualizer for iOS powered by Metal
A Perlin Noise Visulizer powered by 🤘 Metal
.
This is to demonstrate the flexiblility of using noise with simple colors and some basic math to create a number of different visualizations.
I first started out trying to use a CALayer
to render the results, but it was incredibly slow. I quickly realized why and rewrote my implementation using the Metal
framework to do the rendering as a compute shader.
Most of the routines were followed and adapted to the MetalShadingLanguage
from this site.
For the Implementation I used sample code and learned from articles at Metal By Example.
This is your typical white Noise example. flicking on the green and blue switches will switch the colors to blue and you can adjust the zoom slider control to see it in more or less detail
The X and Y sliders will adjust the amount of lines in the vertical and horizontal directions.
The rings slider adjusts how many rings are formed
The pattern here is a lattice or diamond. Tapping on the blue circle with a plus sign on the bottom left corner will produce a menu with sliders allowing you to change the end result manipulating the colors.
This was my first taste of the Metal
framework and I was both intrigued and impressed by the approach and power.