improved memory usage by replacing commonly allocated temporary Matrix and byte arrays in Effects code with static buffers
reordered terrain and terrainRenderer functions