thread rewriting depth buffer used for generation of mesh, clean