Free Sample
+ Collection

Unity Shaders and Effects Cookbook

Kenny Lammers

Shaders promote gaming realism but are not always easy to implement. This book seeks to change that with a cookbook approach to teaching you how to create stunning Shaders using your knowledge of Unity3D.
RRP $29.99
RRP $49.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849695084
Paperback268 pages

About This Book

  • Learn the secrets of creating AAA quality Shaders without having to write long algorithms
  • Add realism to your game with stunning Screen Effects
  • Understand the structure of Surface Shaders through easy to understand step-by-step examples

Who This Book Is For

Unity Effects and Shader Cookbook is written for developers wanting to create your first Shaders in Unity3D, or who wish to take their game to a whole new level with effects. No previous Shader writing experience is necessary to use this book, though a solid understanding of Unity is required.

Table of Contents

Chapter 1: Diffuse Shading
Creating a basic Surface Shader
Adding properties to a Surface Shader
Using properties in a Surface Shader
Creating a custom diffuse lighting model
Creating a Half Lambert lighting model
Creating a ramp texture to control diffuse shading
Creating a faked BRDF using a 2D ramp texture
Chapter 2: Using Textures for Effects
Scrolling textures by modifying UV values
Animating sprite sheets
Packing and blending textures
Normal mapping
Creating procedural textures in the Unity editor
Photoshop levels effect
Chapter 3: Making Your Game Shine with Specular
Utilizing Unity3D's built-in Specular type
Creating a Phong Specular type
Creating a BlinnPhong Specular type
Masking Specular with textures
Metallic versus soft Specular
Creating an Anisotropic Specular type
Chapter 4: Reflecting Your World
Creating Cubemaps in Unity3D
Simple Cubemap reflection in Unity3D
Masking reflections in Unity3D
Normal maps and reflections in Unity3D
Fresnel reflections in Unity3D
Creating a simple dynamic Cubemap system
Chapter 5: Lighting Models
The Lit Sphere lighting model
The diffuse convolution lighting model
Creating a vehicle paint lighting model
Skin shader
Cloth shading
Chapter 6: Transparency
Creating transparency with alpha
Transparent cutoff shader
Depth sorting with render queues
GUI and transparency
Chapter 7: Vertex Magic
Accessing a vertex color in a Surface Shader
Animating vertices in a Surface Shader
Using vertex color for terrains
Chapter 8: Mobile Shader Adjustment
What is a cheap Shader?
Profiling your Shaders
Modifying your Shaders for mobile
Chapter 9: Making Your Shader World Modular with CgIncludes
CgInclude files that are built into Unity
Creating a CgInclude file to store lighting models
Building Shaders with #define directives
Chapter 10: Screen Effects with Unity Render Textures
Setting up the screen effects script system
Brightness, saturation, and contrast with screen effects
Basic Photoshop-like blend modes with screen effects
The Overlay blend mode with screen effects
Chapter 11: Gameplay and Screen Effects
Creating an old movie screen effect
Creating a night vision screen effect

What You Will Learn

  • Use textures to create complex lighting without the need for complex and performance-heavy lighting rigs
  • Master the art of using math to construct shiny objects as well as soft objects
  • See what it takes to create more complex surfaces like skin and cloth
  • Take a look at why a Shader is expensive and what works well for mobile platforms as opposed to PC platforms
  • Enter the world of creating post effects and make your game look visually stunning
  • Understand what goes into the structure of Shaders and why lighting works the way it does
  • Build your Shader knowledge by understanding how Diffuse and Specular work and understand how to use them in creative ways

In Detail

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. 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.

Starting with essential lighting and finishing up by creating stunning Screen Effects alike those in high quality 3D and mobile games. Discover techniques including Normal mapping, Image based lighting, and how to animate your models inside of a Shader. Explore the secrets behind some of the most powerful Shaders including skin and hair! With "Unity Shaders and Effects Cookbook" what seems like a dark art today will be second nature by tomorrow.


Read More

Recommended for You

Learning Unity 2D Game Development by Example
$ 26.99
Unity 4.x Game Development by Example: Beginner's Guide
$ 26.99
Mastering Unity 4 Scripting [Video]
$ 25.50
Getting Started with Unity 4 Scripting [Video]
$ 25.50