terrain rendering refactored