Add support for multi-sampling. Initial implementation of output format.