Abstract

This chapter presents one shader that uses a local light, another that uses a directional one. Since the only difference is in how the light direction vector is calculated, it is assumed that once one has decided what type of light one wants for a shader, one is able to cut and paste to get the correct vector for that light type. A variety of diffuse shaders and a variety of specular ones can be mixed and matched. One can create and use these in any way he/she wants. Once it is understood how a Lambertian diffuse term behaves, one will know those situations when he/she wants that effect, and he/she can take the snippet of code that allows him/her to do Lambertian. If one wants some specular, one can choose between Phong, Blinn-Phong, Schilck, Cook-Torrance, etc. In this way one recognizes the individual traits of each piece of code and what it takes to compute it. There are many instances where one reuses the same instructions; for example, local lights vs. infinite lights make him/her go through the same calculations for both the specular term and the diffuse term.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.