Sort objects by z-depth before rendering