As our final example of a custom combine mode, we will look at a very different type of visual effect.
If you look again at Figure 4-1 you will notice that "noise" is one of the input sources for the a coefficient of (a - b) * c + d. If you take that noise and multiply it by the shade color and use that as the source for a output by the Combiner, you can get an image like the static you might see on TV at the end of the broadcast day.
List 4-3 | |
|
Using this combine mode, random black noise covers the surfaces of the primitive colored with single shade colors. The noise value does not have a very large dynamic range, so the shade color is either output as-is or it becomes 0 (black).
Figure 4-5 Screen shots of sample program gfx4.c, with __NOISE__ ON