September 2018
Intermediate to advanced
472 pages
15h 36m
English
Programmable shaders give us tremendous power and flexibility. A good place to start is to learn how to implement a simple, common reflection model known as the Phong reflection model. It is a good basis for building upon.
In this chapter, we'll look at the basic techniques for implementing the Phong model. We'll modify it in a few simple ways, including two-sided rendering and flat shading. Along the way, we'll also see some examples of other GLSL features such as functions, subroutines, and the discard keyword.
Read now
Unlock full access