Previously the Terrain was rendered in a nested loop, rendering X Triangle Strips, where X is the length of the terrain. Now when the terrain is created/loaded 1 Triangle Strip is created and loaded into a Vertex Array. At render time I simply ask OpenGL to render this Vertex Array. Sample source for Vertex Arrays can be found at here
Sadly this did not give me the frame rate increase I was hoping for. I will have to investigate if there is a reason for this, and I will also implement Vertex Buffer Objects. Despite the disappointing results the code is now allot more readable, allot more maintainable and the Terrain Object is API independent. I will easily be able reuse the Object as-is when I code my DirectX version of Decade. (if only things were ever that easy)
Many areas of the engine are still in development
- CLOD Terrain Renders
- Terrain Texture Generation
- Terrain Lighting
- Applying Vertex and Index Buffers to Mesh Renders
Looking good! You're making good progress.
ReplyDeleteCan't wait to see a game made with this...