What is setMaterialIndex doing?