fixed rendering bug, improved performance by recycling materials