Factorize all first pass materials.