material: add truncate function;