Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x Shaders and Effects Cookbook

You're reading from   Unity 5.x Shaders and Effects Cookbook Master the art of Shader programming to bring life to your Unity projects

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781785285240
Length 240 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Alan Zucconi Alan Zucconi
Author Profile Icon Alan Zucconi
Alan Zucconi
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Creating Your First Shader 2. Surface Shaders and Texture Mapping FREE CHAPTER 3. Understanding Lighting Models 4. Physically Based Rendering in Unity 5 5. Vertex Functions 6. Fragment Shaders and Grab Passes 7. Mobile Shader Adjustment 8. Screen Effects with Unity Render Textures 9. Gameplay and Screen Effects 10. Advanced Shading Techniques Index

Using the Overlay Blend mode with screen effects


For our final recipe, we are going to take a look at another type of blend mode, the Overlay Blend mode. This blending actually makes use of some conditional statements that determine the final color of each pixel in each channel. So, the process of using this type of blend mode needs a bit more coding to work. Let's take a look at how this is done in the next few recipes.

Getting ready

For this last Screen Effect, we will need to set up our two scripts as we have in the previous recipes in this chapter. For this recipe, we will be using the same scene we have been using, so we don't have to create a new one:

  1. Create a new script file called Overlay_ImageEffect and shader file called Overlay_Effect.

  2. Copy the code from the previous C# script file to our new script file.

  3. Copy the code from the previous shader file to our new shader file.

  4. Assign the Overlay_ImageEffect script to the main camera and Overlay_Effect to the script component in the Inspector...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image