Fixed bug when changing depthTest and depthWrite