Hacky ifdefs to choose material type