add support for z-buffer using maskBits