SHADER BUFFET
I’m not going to take the usual route that you see in these shader collections. Instead, I’m going to do it building-blocks style, that is, I’ll give you, say, a variety of diffuse shaders and a variety of specular ones. You get to mix and match. I want to impart the fact that you can create and use these in any way you want; there’s no right or wrong way. Once you understand how a Lambertian diffuse term behaves, you’ll know those situations when you want that effect, and you can take the snippet of code that allows you to do Lambertian. If you want some specular, you can choose between Phong, Blinn–Phong, Schilck, Cook–Torrance, etc.
This way, you’ll recognize the individual traits of each piece of code and what it ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access