How To Create Cool Effects with Custom Shaders in OpenGL ES 2.0 and Cocos2D 2.X

This is a post by iOS Tutorial Team member Krzysztof Zablocki, a passionate iOS developer with years of experience. Shaders may very well be the biggest step forward in computer graphics since the introduction of 3D into games. They allow programmers to create completely new effects and take full control of what’s seen on the […] By .

Leave a rating/review
Save for later
Share
You are currently viewing page 5 of 5 of this article. Click here to view the first page.

Where To Go From Here?

Here is an example project with all of the code from this tutorial.

I hope this tutorial showed you how simple shaders can be. Of course, these are just some of the simplest effects you can create with shaders. If you feel confident about what you’ve learnt here, try creating more advanced effects:

  • Convert the ramp texture into one that will create Toon Shading (you’ll need to decrease the palette of colors).
  • Create a raindrop effect by using the sin(x)/x function (go check it out in Mac Grapher, an app included on your Mac).
  • Play with post-process effects by rendering your scene into a render texture and then using a custom fragment shader to add blur.

Now go and dig some more into shaders and GLSL! I look forward to reading and responding to your comments in the forums.

Krzysztof Zablocki

This is a post by iOS Tutorial Team member Krzysztof Zablocki, a passionate iOS developer with years of experience.