optimization idea: would it be possible to use an AAAA8 compressed DDS texture for those detail normal masks (rgb empty, only Alpha with 8 bit) and instead of checking the color values, check for pixel brightness? given that you have 8 different "submaterials" (different detailmaps) you would simply use 0, 32, 64, 96, 128,…