Unity 5.x Shaders and Effects Cookbook

Master the art of Shader programming to bring life to your Unity projects

Unity 5.x Shaders and Effects Cookbook

Alan Zucconi, Kenneth Lammers

3 customer reviews
Master the art of Shader programming to bring life to your Unity projects
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785285240
Paperback240 pages

Book Description

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

Chapter 1: Creating Your First Shader
Introduction
Creating a basic Standard Shader
Migrating Legacy Shaders from Unity 4 to Unity 5
Adding properties to a shader
Using properties in a Surface Shader
Chapter 2: Surface Shaders and Texture Mapping
Introduction
Diffuse shading
Using packed arrays
Adding a texture to a shader
Scrolling textures by modifying UV values
Normal mapping
Creating a transparent material
Creating a Holographic Shader
Packing and blending textures
Creating a circle around your terrain
Chapter 3: Understanding Lighting Models
Introduction
Creating a custom diffuse lighting model
Creating a Toon Shader
Creating a Phong Specular type
Creating a BlinnPhong Specular type
Creating an Anisotropic Specular type
Chapter 4: Physically Based Rendering in Unity 5
Introduction
Understanding the metallic setup
Adding transparency to PBR
Creating mirrors and reflective surfaces
Baking lights in your scene
Chapter 5: Vertex Functions
Introduction
Accessing a vertex color in a Surface Shader
Animating vertices in a Surface Shader
Extruding your models
Implementing a snow shader
Implementing a volumetric explosion
Chapter 6: Fragment Shaders and Grab Passes
Introduction
Understanding Vertex and Fragment Shaders
Using grab pass
Implementing a Glass Shader
Implementing a Water Shader for 2D games
Chapter 7: Mobile Shader Adjustment
Introduction
What is a cheap shader?
Profiling your shaders
Modifying our shaders for mobile
Chapter 8: Screen Effects with Unity Render Textures
Introduction
Setting up the screen effects script system
Using brightness, saturation, and contrast with screen effects
Using basic Photoshop-like Blend modes with screen effects
Using the Overlay Blend mode with screen effects
Chapter 9: Gameplay and Screen Effects
Introduction
Creating an old movie screen effect
Creating a night vision screen effect
Chapter 10: Advanced Shading Techniques
Introduction
Using CgInclude files that are built into Unity
Making your shader world modular with CgInclude
Implementing a Fur Shader
Implementing heatmaps with arrays

What You Will Learn

  • Understand physically based rendering to fit the aesthetic of your game
  • Enter the world of post-processing effects to make your game look visually stunning
  • Add life to your materials, complementing Shader programming with interactive scripts
  • Design efficient Shaders for mobile platforms without sacrificing their realism
  • Use state-of-the-art techniques such as volumetric explosions and fur shading
  • Build your knowledge by understanding how Shader models have evolved and how you can create your own
  • Discover what goes into the structure of Shaders and why lighting works the way it does
  • Master the math and algorithms behind the most used lighting models

Authors

Table of Contents

Chapter 1: Creating Your First Shader
Introduction
Creating a basic Standard Shader
Migrating Legacy Shaders from Unity 4 to Unity 5
Adding properties to a shader
Using properties in a Surface Shader
Chapter 2: Surface Shaders and Texture Mapping
Introduction
Diffuse shading
Using packed arrays
Adding a texture to a shader
Scrolling textures by modifying UV values
Normal mapping
Creating a transparent material
Creating a Holographic Shader
Packing and blending textures
Creating a circle around your terrain
Chapter 3: Understanding Lighting Models
Introduction
Creating a custom diffuse lighting model
Creating a Toon Shader
Creating a Phong Specular type
Creating a BlinnPhong Specular type
Creating an Anisotropic Specular type
Chapter 4: Physically Based Rendering in Unity 5
Introduction
Understanding the metallic setup
Adding transparency to PBR
Creating mirrors and reflective surfaces
Baking lights in your scene
Chapter 5: Vertex Functions
Introduction
Accessing a vertex color in a Surface Shader
Animating vertices in a Surface Shader
Extruding your models
Implementing a snow shader
Implementing a volumetric explosion
Chapter 6: Fragment Shaders and Grab Passes
Introduction
Understanding Vertex and Fragment Shaders
Using grab pass
Implementing a Glass Shader
Implementing a Water Shader for 2D games
Chapter 7: Mobile Shader Adjustment
Introduction
What is a cheap shader?
Profiling your shaders
Modifying our shaders for mobile
Chapter 8: Screen Effects with Unity Render Textures
Introduction
Setting up the screen effects script system
Using brightness, saturation, and contrast with screen effects
Using basic Photoshop-like Blend modes with screen effects
Using the Overlay Blend mode with screen effects
Chapter 9: Gameplay and Screen Effects
Introduction
Creating an old movie screen effect
Creating a night vision screen effect
Chapter 10: Advanced Shading Techniques
Introduction
Using CgInclude files that are built into Unity
Making your shader world modular with CgInclude
Implementing a Fur Shader
Implementing heatmaps with arrays

Book Details

ISBN 139781785285240
Paperback240 pages
Read More
From 3 reviews

Read More Reviews