New Core Image Procedural Noise Generators for Filterpedia
In image processing a noise potentially annoys. But in some cases it embellishes. This short article describes some interesting applications of purposeful distortion.
Join the DZone community and get the full member experience.Join For Free
One of the great advantages of Core Image Kernel Language being such a close relative of GLSL is that I can scour through sites such as Shadertoy and GLSL Sandbox and copy some of the amazing work produced by their contributors pretty much verbatim to create new Core Image filters.
Two such examples my CausticNoise (based on this Shadertoy project) and VoronoiNoise (based on this GLSL Sandbox project) filters. Both of these generator filters have now been included in Filterpedia and can be used like any other Core Image filter.
Caustic Noise generates a tileable and animatable noise reminiscent of the caustic patterns you may see at the bottom of a swimming pool. On its own, it creates a nice effect, however, I've chained together with my height field refraction kernel that powers my RefractedTextFilter, to create a CausticRefraction filter:
Since the filter is animatable by its inputTime attribute, it works very nicely with live video. My NemoCam project applies caustic refraction to a live video feed from an iOS device to give a wobbly, underwater effect:
Voronoi noise (also known as Worley or cellular noise) is created by setting the color of each pixel based on its distance to the nearest randomly distributed point. This filter is also animatable (as you can see above) by incrementing its inputSeed attribute.
Using my normal map filter, both of these noise generators make excellent sources for normal maps for SceneKit materials:
Core Image for Swift
If you'd like to learn more about the power of Core Image for generating textures, including how to leverage Metal compute shaders to create other types of noise, may I recommend my book, Core Image for Swift.
Core Image for Swift is available from both Apple's iBooks Store or, as a PDF, from Gumroad. IMHO, the iBooks version is better, especially as it contains video assets which the PDF version doesn't.
Published at DZone with permission of Simon Gladman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.