Added automatic mipmapping to improve performance.