4.7 Coloring with Noise

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

  /*
   *  Shade color (single color) multiplied by noise is output from the Combiner 
   *    color = (NOISE - 0) * SHADE + 0 = NOISE * SHADE
   *  Only the a coefficient of (a - b) * c + d gets noise as the source
   */
  gDPSetCombineLERP(glistp++, NOISE,    0, SHADE,     0,
                                  0,    0,     0, SHADE,
                              NOISE,    0, SHADE,     0,
                                  0,    0,     0, SHADE);

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