March 2013
Intermediate to advanced
984 pages
26h 18m
English
We’ll next discuss how fragment shaders compute the ambient, diffuse, and speculative amounts for several types of light, including directional lighting, point lighting, and spotlight lighting. These will be complete with a vertex and fragment shader pair built up as we go from simplest to more complex. The later shaders may seem long, but if you start with the simplest and follow the incremental additions, it will be easy to understand.
Note
The comments in each example highlight the change or difference from the previous step, making it easy to look and identify the new concepts.
We’ll start with the simplest lighting—no lighting! By this, we don’t mean everything will be black, but ...
Read now
Unlock full access