Book Image

Unity 5.x Shaders and Effects Cookbook

By : Alan Zucconi
Book Image

Unity 5.x Shaders and Effects Cookbook

By: Alan Zucconi

Overview of this book

Since their introduction to Unity, Shaders have been notoriously difficult to understand and implement in games: complex mathematics have always stood in the way of creating your own Shaders and attaining that level of realism you crave. With Shaders, you can transform your game into a highly polished, refined product with Unity’s post-processing effects. Unity Shaders and Effects Cookbook is the first of its kind to bring you the secrets of creating Shaders for Unity3D—guiding you through the process of understanding vectors, how lighting is constructed with them, and also how textures are used to create complex effects without the heavy math. We’ll start with essential lighting and finishing up by creating stunning screen Effects just like those in high quality 3D and mobile games. You’ll discover techniques including normal mapping, image-based lighting, and how to animate your models inside a Shader. We’ll explore the secrets behind some of the most powerful techniques, such as physically based rendering! With Unity Shaders and Effects Cookbook, what seems like a dark art today will be second nature by tomorrow.
Table of Contents (16 chapters)
Unity 5.x Shaders and Effects Cookbook
About the Authors

Creating a night vision screen effect

Our next screen effect is definitely a more popular one. The night vision screen effect is seen in Call of Duty Modern Warfare, Halo, and just about any first-person shooter out in the market today. It is the effect of brightening the whole image using that very distinct lime green color.

In order to achieve our night vision effect, we need to break down our effect using Photoshop. It is a simple process of finding some reference images online and composing a layered image to see what kind of blending modes you will need or in which order we will need to combine our layers. The following image shows the result of performing just this process in Photoshop:

Let's begin to break down our rough Photoshop composite image into its component parts so that we can better understand the assets we will have to gather. In the next recipe, we will cover the process of doing this.

Getting ready

Let's begin this screen effect by again breaking down our effect into its...