Optimize the terrain rendering.