Converted singlepass shaders to multipass shaders.

This increases performance by reducing the amount of redundant computations.