2D Shader Development: Illumination & Shadows

Hidden People Club
3 ratings

Our games need to look unique. There's nothing we can do to fight that. Good artists are great at creating amazing characters and environments but programmers can open a whole new world of possibilities and customization by leveraging the power of shaders.

NOTE: The Gumroad version of the book includes PDF, ePub and MOBI versions for you to download.

About Illumination & Shadows

This book is the second on a series of 4 books and covers four illumination techniques, from static lights to fully dynamic lights. You'll learn about how to leverage blending modes to create the illusion of lights and shadows, how to create a simple and cheap way of adding some depth to your game with localized ambient light, then you'll learn how to add rim lights to assets with a full-screen effect and finally you'll learn how to create a normal map for a character to be used with any existing lighting model like Unity's own.

About the series

In the past few years, while working on Nubarron, I got really frustrated about the lack of information on how to design shader effects in 2D. Most of the books and tutorials are about 3D, and one may think that transferring that knowledge to 2D is easy. Well.. not really.

I found out that there is a sub-set of basic techniques that are pretty useful in 2D, and don't require you to learn a lot of the 3D stuff, specially lighting models, the first thing that every shader tutorial/book talks about.

The series is aimed at independent game developers that want to make their own 2D games visually unique. You’ll need some understanding on programming. If you can code your own logic in C# scripts inside Unity you’re good to go.

If you haven’t coded a game in the past it’s likely that these books are not for you. I suggest you take an introductory Unity course first, work on some prototypes until you’re comfortable with programming and then read the books.

The series will help you differentiate your games from others that use nothing but built-in shaders, make use of the GPU to generate movement and effects on static sprites, generate full-screen effects and learn techniques to do illumination on 2D scenes.

Contents of the book

  • Static Illumination: Using Additive blend to light things up, Refreshing how to implement Additive, Using Multiply blend to create shadows, Refreshing how to implement Multiply, Limits of static illumination.
  • Kinda Dynamic Local Ambient Lights: Creating our own 2D Light Sources, Ambient, Directional, Point, Creating the Lights prefabs, Object coloring, A note on Culling, Full code for the shader, Ambient Lights, Using the TextureWithAmbientLight shader in our character, Controlling the gradient shape with _Threshold and _Smoothness, Point Lights, Using the TextureWithPointLight shader in our character, Adding Point light logic, Interpolating between lights.
  • Screen-Space Automatic Rim Lights: Rendering Alpha Only, Scene Setup, Rendering to a RenderTexture, Rendering only the Alpha channel, Calculating Normals, Blurring the image, Generating the Normal map
  • Dynamic Lights using Normal Mapping: Asset Requirement, Math derivation, Generating the Normal Map in a Shader, Using Unity’s native lights.
  • Appendices: Vector Rotation, Normal Mapping, Coordinate Systems, Lambertian Diffuse Shading, Convolution.
3 ratings


(3 ratings)
5 stars
4 stars
3 stars
2 stars
1 star
Powered by


2D Shader Development: Illumination & Shadows

Enter your info to complete your purchase


or pay with
You'll be charged US$12.