Browse Source

Explain terrain LOD index data generation mechanism. Closes #324.

Lasse Öörni 11 years ago
parent
commit
3309f2af6c
1 changed files with 11 additions and 0 deletions
  1. 11 0
      Source/Engine/Graphics/Terrain.cpp

+ 11 - 0
Source/Engine/Graphics/Terrain.cpp

@@ -753,6 +753,17 @@ void Terrain::CreateIndexData()
     drawRanges_.Clear();
     unsigned row = patchSize_ + 1;
 
+    /* Build index data for each LOD level. Each LOD level except the lowest can stitch to the next lower LOD from the edges:
+       north, south, west, east, or any combination of them, requiring 16 different versions of each LOD level's index data
+    
+       Normal edge:     Stitched edge:
+       +----+----+      +---------+
+       |\   |\   |      |\       /|
+       | \  | \  |      | \     / |
+       |  \ |  \ |      |  \   /  |
+       |   \|   \|      |   \ /   |
+       +----+----+      +----+----+
+    */
     for (unsigned i = 0; i < numLodLevels_; ++i)
     {
         unsigned combinations = (i < numLodLevels_ - 1) ? 16 : 1;