Use average z for painter's algorithm.