O'Reilly logo

Getting Started with SpriteKit by Jorge Jordán

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding shaders to our game

A shader or an instance of the SKShader class is an object that represents an Open Graphics Library Embedded Systems (OpenGL ES) or (GLES). It is a fragment shader, which is an algorithm that modifies the drawing behavior of the node that it is applied to.

Note

Open Graphics Library (OpenGL) is an application programing interface that utilizes the Graphics Processing Unit (GPU) to render graphic elements.

You can use the effect shown in the following screenshot by applying shaders:

Adding shaders to our game

In order to apply a shader to a node, we need to create a SKShader instance from a fragment shader algorithm and assign it to the shader property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required