Unity 5.x Shaders and Effects Cookbook
eBook - ePub

Unity 5.x Shaders and Effects Cookbook

  1. 240 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Unity 5.x Shaders and Effects Cookbook

About this book

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

About This Book

  • This book will help you master the technique of physically based shading in Unity 5 to add realism to your game quickly through precise recipes
  • From an eminent author, this book offers you the fine technicalities of professional post-processing effects for stunning results
  • This book will help you master Shader programming through easy-to-follow examples to create stunning visual effects that can be used in 3D games and high quality graphics.

Who This Book Is For

Unity Effects and Shader Cookbook is written for developers who want to create their first Shaders in Unity 5 or wish to take their game to a whole new level by adding professional post-processing effects. A solid understanding of Unity is required.

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

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

Style and approach

The recipes in this book contain step-by-step instructions, complemented by screenshots and code, and real-world examples.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Unity 5.x Shaders and Effects Cookbook


Table of Contents

Unity 5.x Shaders and Effects Cookbook
Credits
About the Authors
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Creating Your First Shader
Introduction
Creating a basic Standard Shader
Getting ready
How to do it…
How it works…
See also
Migrating Legacy Shaders from Unity 4 to Unity 5
Getting ready
How to do it...
Upgrading automatically
Using Standard Shaders
Migrating custom shaders
How it works...
See also
Adding properties to a shader
Getting ready
How to do it…
How it works…
See also
Using properties in a Surface Shader
How to do it…
How it works…
There's more…
See also
2. Surface Shaders and Texture Mapping
Introduction
Diffuse shading
Getting ready
How to do it...
How it works...
Using packed arrays
How to do it...
Packed matrices
See also
Adding a texture to a shader
Getting ready
How to do it...
How it works…
There's more...
See also
Scrolling textures by modifying UV values
Getting ready
How to do it…
How it works…
Normal mapping
Getting ready
How to do it…
How it works…
There's more…
Creating a transparent material
Getting ready
How to do it…
How it works…
Creating a Holographic Shader
Getting ready
How to do it…
How it works…
There's more…
See also
Packing and blending textures
Getting ready
How to do it…
How it works…
Creating a circle around your terrain
Getting ready
How to do it…
Moving the circle
How it works…
3. Understanding Lighting Models
Introduction
Creating a custom diffuse lighting model
Getting ready
How to do it…
How it works…
Creating a Toon Shader
Getting ready
How to do it…
How it works…
There's more…
Creating a Phong Specular type
Getting ready
How to do it…
How it works…
Creating a BlinnPhong Specular type
Getting ready
How to do it…
How it works…
See also
Creating an Anisotropic Specular type
Getting ready
How to do it…
How it works…
4. Physically Based Rendering in Unity 5
Introduction
Understanding the metallic setup
Getting ready
How to do it…
How it works…
See also
Adding transparency to PBR
Getting ready
How to do it…
Semi-transparent materials
Fading objects
Solid geometries with holes
See also
Creating mirrors and reflective surfaces
Getting ready
How to do it…
How it works…
See also
Baking lights in your scene
Getting ready
How to do it…
Configuring the static geometry
Configuring the light probes
Baking the lights
How it works…
See also
5. Vertex Functions
Introduction
Accessing a vertex color in a Surface Shader
Getting ready
How to do it…
How it works…
There's more…
Animating vertices in a Surface Shader
Getting ready
How to do it…
How it works…
Extruding your models
Getting ready
How to do it…
How it works…
There's more…
Adding extrusion maps
Implementing a snow shader
Getting ready
How to do it…
How it works…
Coloring the surface
Altering the geometry
See also
Implementing a volumetric explosion
Getting ready
How to do it…
How it works…
There's more…
See also
6. Fragment Shaders and Grab Passes
Introduction
Understanding Vertex and Fragment Shaders
Getting ready
How to do it…
How it works…
There's more…
Input semantics
Output semantics
See also
Using grab pass
Getting ready
How to do it…
How it works…
There's more…
Implementing a Glass Shader
Getting ready
How to do it…
How it works…
There's more…
Implementing a Water Shader for 2D games
Getting ready
How to do it…
How it works…
7. Mobile Shader Adjustment
Introduction
What is a cheap shader?
Getting ready
How to do it…
How it works…
Profiling your shaders
Getting ready
How to do it…
How it works…
There's more…
Modifying our shaders for mobile
Getting ready
How to do it…
How it works…
8. Screen Effects with Unity Render Textures
Introduction
Setting up the screen effects script system
Getting ready
How to do it…
How it works…
There's more…
Using brightness, saturation, and contrast with screen effects
Getting ready
How to do it…
How it works…
Using basic Photoshop-like Blend modes with screen effects
Getting ready
How to do it…
How it works…
There's more…
Using the Overlay Blend mode with screen effects
Getting ready
How to do it…
How it works…
9. Gameplay and Screen Effects
Introduction
Creating an old movie screen effect
Getting ready
How to do it…
How it works…
See also
Creating a night vision screen effect
Getting ready
How to do it…
How it works…
There's more...
10. Advanced Shading Techniques
Introduction
Using CgInclude files that are built into Unity
Getting ready
How to do it…
How it works…
Making your shader world modular with CgInclude
Getting ready
How to do it…
How it works…
Implementing a Fur Shader
Getting ready
How to do it…
How it works…
There's more…
Implementing heatmaps with arrays
Getting ready
How to do it…
How it works…
Index

Unity 5.x Shaders and Effects Cookbook

Copyr...

Table of contents

  1. Unity 5.x Shaders and Effects Cookbook

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Unity 5.x Shaders and Effects Cookbook by Alan Zucconi, Kenneth Lammers in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Graphics. We have over one million books available in our catalogue for you to explore.