Chapter 3: Working with Surface Shaders
In this chapter, we will explore the topic of Surface Shaders in greater detail than in the previous chapter. We will start by building a very simple matte material and end with holographic projections.
In this chapter, we will cover the following recipes:
- Implementing diffuse shading
- Accessing and modifying packed arrays
- Creating a shader with normal mapping
- Creating a Holographic Shader
Surface Shaders were introduced in Chapter 2, Creating Your First Shader, as one of the types of shader that can be used in Unity. This chapter will show you what these are and how they work. Generally speaking, two essential steps need to be done when creating any Surface Shader:
- First, you have to specify certain physical properties of the material that you want to describe, such as its diffuse color, smoothness, and transparency. These properties are initialized in a function called the surface function and are stored...