split mesh into subparts for each material and shading