Because the quad-tree structure is used, cracks (cracks) may occur between different levels of blocks ).
As shown in, cracks may occur at points A and B because the two blocks do not share the vertex. At present, there are many methods to solve the crack, mainly divided into the hop point method and the addition method. The hop point method skips some points on the boundary of high-resolution chunks and does not draw them. This ensures the continuity of adjacent chunks. The addition method adds some vertices on the boundary of the chunks at a lower resolution to maintain the continuity of the two chunks. When adding or removing vertices, the whole terrain needs to be traversed and related parts need to be re-divided into triangles. In addition, the independence of parts is lost, which makes it difficult for us to use the cache of parts, this increases the complexity of the problem and affects efficiency.
We adopt a more efficient way to eliminate cracks. Extend a circle of the Four Edges of each block based on the existing vertex. They share the vertex with the boundary of a single block, but the height value is different, this extended circle is called skirts ). After projection, as long as the height value of the vertex is large enough, two blocks of skirts can block the crack. Of course, this method of eliminating cracks will increase the number of triangles to be drawn. However, tests show that for the current graphics processor, the extra increase in the number of triangles will not result in a reduction in performance.
Rendering program:
What is the http://www.gamedev.net/community/forums/topic.asp for discussion about terrain levels and skirt? Topic_id = 376154
Http://blog.csdn.net/baozi3026/archive/2010/07/27/5770108.aspx