Book Image

Unity 5 for Android Essentials

By : Valera Cogut
Book Image

Unity 5 for Android Essentials

By: Valera Cogut

Overview of this book

Table of Contents (14 chapters)
Unity 5 for Android Essentials
About the Author
About the Reviewers

Physically-based shaders

Unity makes it very easy to use ready shaders or write your own shaders using the Cg language or the surface shaders framework. Surface shaders are written in Cg, but they do a large amount of work that you do not have to write every time when you create a new shader. The surface shader language uses a component-based approach, or in other words a more abstract approach that facilitates writing complex shaders using a sophisticated lighting model. While using the surface shaders framework, graphics programmers do not have to keep reprocessed texture coordinates and matrix transformations. In this chapter, we will describe the different techniques and methods of writing performance-friendly shaders in great detail with nice visual quality effects used in a variety of games and applications developed throughout the world.

First, let's start with the basic principles and concepts of a shaders. A shader is a pre-compiled program for one of the number of stages of the...