Chapter 8: Fragment Shaders and Grab Passes
So far, we have relied on Surface Shaders. They have been designed to simplify the way shader coding works, providing meaningful tools for artists. If we want to push our knowledge of shaders further, we need to venture into the territory of Vertex and Fragment Shaders.
Compared to Surface Shaders, Vertex and Fragment Shaders come with little to no information about the physical properties that determine how light reflects on surfaces. What they lack in expressivity, they compensate for with power. Vertex and Fragment Shaders are not limited by physical constraints and are perfect for non-photorealistic effects. This chapter will focus on a technique called the grab pass, which allows these shaders to simulate deformations.
In this chapter, we will cover the following recipes:
- Understanding Vertex and Fragment Shaders
- Using grab passes to draw behind objects
- Implementing a Glass Shader
- Implementing a Water Shader...