Use your business data to your advantage with the help of Syncfusion’s new data science offerings. Discover how a custom big data solution can provide your company with valuable predictions about key market trends.

Unity Shaders and Effects Cookbook

Cookbook

Kenny LammersJune 2013

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.

$29.99

$49.99

RRP $29.99

RRP $49.99

eBook

Print + eBook

Want this title & more?

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

Introduction

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

Introduction

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

Introduction

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

Introduction

The Lit Sphere lighting model

The diffuse convolution lighting model

Creating a vehicle paint lighting model

Skin shader

Cloth shading

Chapter 6: Transparency

Introduction

Creating transparency with alpha

Transparent cutoff shader

Depth sorting with render queues

GUI and transparency

Chapter 7: Vertex Magic

Introduction

Accessing a vertex color in a Surface Shader

Animating vertices in a Surface Shader

Using vertex color for terrains

Chapter 8: Mobile Shader Adjustment

Introduction

What is a cheap Shader?

Profiling your Shaders

Modifying your Shaders for mobile

Chapter 9: Making Your Shader World Modular with CgIncludes

Introduction

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

Introduction

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

Introduction

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.

Authors

Kenny Lammers

Kenny Lammers has been working in the games industry for 13 years now. He has worked for companies such as Microsoft, Activision, and the late Surreal Software. He currently runs two companies; the first is Creative TD, where he does Unity3D consulting / asset creation for companies such as IGT, Microsoft, Janus Research, and Allegorithmic, and the second company he owns and operates, with his business partner Noah Kaarbo, is Ozone Interactive. Ozone specializes in creating interactive applications and high-quality design with a focus on Untiy3D, for companies such as Amazon, E-line Media, Microsoft, and Sucker Punch games. His games industry experience has given him the opportunity to create characters using Zbrush and Maya, to write real-time Shaders and post effects, and to program full games in Unity3D using C#. He is currently working on a few games and developing toolsets within Unity to expedite the game creation process.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.