fix rendering of materials with indices of 256 and above