Selinux24/Skirmish

TERRAIN DRAWING QUADTREE

Selinux24 opened this issue · 1 comments

From a model generated using Blender and node partitioned, generate N distinct resolution models:

  • High: N triangles
  • Medium: N/2 triangles
  • Low: N/4 triangles
  • Ultra low: N/8 triangles

Article:

Since you now have split up the mesh, you can perform LOD and culling techniques on it to skip rendering hidden chunks.

View distance is where you start. You would only render chunks within a given distance, for example the view distance of your camera. The lower the view distance, the more performance you get since fewer chunks of the terrain must be drawn.

Frustum culling is a common technique to only render meshes that intersect with the camera's view frustum. This will most likely give you the largest performance gain.

Experiment with the chunk size and view distance to get best results. Chunk size is a tradeoff between accurate culling versus easy computation. To further optimize, you could take a look at these more advanced optimizations.

Occlusion culling can be done by rendering the meshes on the CPU at very low resolution. This allows you to early detect meshes hidden behind other ones. They don't must be sent to the GPU, so you save a lot of vertex shader executions which otherwise would have been performed before rejecting the triangles.

Level of detail means that you calculate lower resolution meshes of your chunks. Based on distance to camera, you choose one of the meshes to draw. That allows you to reduce the number of vertices since chunks far away don't need so much detail. This approach plays well with octrees because you could merge multiple cubes into one low resolution mesh when being far away from the camera. However, it is non trivial to seamlessly merge the edges between two chunks of a different resolution.

be1ac74 - Done!