Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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 CgInclude files that are built into Unity


Our first step in writing our own CgInclude files is to understand what Unity is already providing us with for shaders. By writing Surface Shaders, there is a lot happening under the hood, which makes the process of writing Surface Shaders so efficient. We can see this code in the included CgInclude files found in your Unity install folder at Editor | Data | CGIncludes. All the files contained within this folder do their part to render our objects with our shaders to the screen. Some of these files take care of shadows and lighting, some take care of helper functions, and some manage platform dependencies. Without them, our shader writing experience would be much more laborious.

You can find a list of information that Unity has provided us with at the following link: http://docs.unity3d.com/Documentation/Components/SL-BuiltinIncludes.html

Let's begin the process of understanding these built-in CgInclude files, using some of the built-in helper...

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 AU $24.99/month. Cancel anytime