Added material index option.