WWDC23 SALE: Save 50% on all my Swift books and bundles! >>

ShaderKit adds special effects to SpriteKit in seconds

Use this new library of fragment shaders to add some excitement to your next project.

Paul Hudson       @twostraws

I just released a new open-source project called ShaderKit, which delivers 20 different fragment shader effects for use in SpriteKit games.

Fragment shaders are commonly used to provide effects such as water ripples, spinning black holes, flashing lights, embossing, noise, gradients, and more. They run directly on the GPU, which makes them a blazingly fast way to add special effects to games.

The problem is, most SpriteKit developers don’t use them – partly because writing shaders is a unique skill in its own right, but partly also because shaders are written in GLSL rather than Swift.

I built ShaderKit to solve that problem: it’s an open-source library of fragment shaders for SpriteKit that you can drop in to any game. All shaders come with example code so you can see how to use them, plus sandbox apps for both iOS and macOS so you can see how they look.

Here’s a brief video to whet your appetite:

Even better, each of the shaders is comprehensively documented: you get an explanation of how the algorithm works, plus line-by-line comments explaining what each line means in English. All being well this should mean even relative beginners can dive in and try shaders for themselves.

The great thing about shaders is that you can add them to any game without changing your logic – you just drop the shader code into your program and attach it to whatever node you want. So, the next time you want a water effect over your background, a black hole sucking players to their doom, or an infrared view to simulate being the Predator, give ShaderKit a try.

Link: ShaderKit.

Save 50% in my WWDC23 sale.

SAVE 50% To celebrate WWDC23, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.