Updated for Depth buffer support