9. Making a Shader Physically Based
Claudia Doppioslash1
(1)Liverpool, Merseyside, UK
Among the many things you learned in the last chapter, there are the three rules your implemented BRDFs need to follow In order to be considered physically based. One way to put this knowledge into practice is to review the custom Phong surface shader, to find whether it breaks those rules. The shader followed the original formulation of Phong, which is fairly old, so it’s quite likely.
Analyzing Phong
Listing
9-1 shows the
custom Phong lighting functions
. Let’s check for positivity, reciprocity, and energy conservation.