While working on another project I had a epiphany regarding my graphics terrain.
The terrain model correctly maps out the diamond pattern to the specified density of quads (split into triangles). As I was rendering using an index buffer, I could actually render lower levels of detail. It would require having multiple index buffers and so come at a more considerable memory cost, but would require negligible additional computation at run time but instead would make the quadtree based LOD system run even more smoothly as I could simply set the level of detail to render a terrain patch much easier and still use static terrain vertices.
I had an idea in my head about how I could do it, it would be maybe a ten minute job to add in the functionality for multiple index buffers.
The terrain model correctly maps out the diamond pattern to the specified density of quads (split into triangles). As I was rendering using an index buffer, I could actually render lower levels of detail. It would require having multiple index buffers and so come at a more considerable memory cost, but would require negligible additional computation at run time but instead would make the quadtree based LOD system run even more smoothly as I could simply set the level of detail to render a terrain patch much easier and still use static terrain vertices.
I had an idea in my head about how I could do it, it would be maybe a ten minute job to add in the functionality for multiple index buffers.
It actually ended up being about an 10 hour job.
It wasn't quite as simple as I had anticipated to implement it. I knew roughly the method but the implementation was a little more difficult to get my head around.
To simplify the problem, I changed the terrain so that the density of quads was now always set to a power of two (and adjusts the specified values if this is not the case). This meant that I did not have to worry about an odd number of columns needing to be split.
I eventually managed to implement the method and was relieved to see it performing as I had hoped. The method is a simple one, it simply quarters the amount of indices for each level. This means that I can keep the vertices static and the lower detail will simply be a result of this as opposed to any further calculation being required.
I could spend more time and delve into more complex terrain compression, by generating the height-mapped vertices and then from that, calculate what indices and triangles I need. However, it's not necessary for this project and will take up way too much time. In fact, once I've added in quadtrees, I'll already be well on my way to a similar level of difficulty that I encountered with my entire honours project.
I'm pleased that I managed to get the LOD in and should no focus on making sure the normals are generated correctly.
I uploaded a video that demonstrates my terrain in action, showing how the level of details render as well as how the mesh looks under different set ups.
It wasn't quite as simple as I had anticipated to implement it. I knew roughly the method but the implementation was a little more difficult to get my head around.
To simplify the problem, I changed the terrain so that the density of quads was now always set to a power of two (and adjusts the specified values if this is not the case). This meant that I did not have to worry about an odd number of columns needing to be split.
I eventually managed to implement the method and was relieved to see it performing as I had hoped. The method is a simple one, it simply quarters the amount of indices for each level. This means that I can keep the vertices static and the lower detail will simply be a result of this as opposed to any further calculation being required.
I could spend more time and delve into more complex terrain compression, by generating the height-mapped vertices and then from that, calculate what indices and triangles I need. However, it's not necessary for this project and will take up way too much time. In fact, once I've added in quadtrees, I'll already be well on my way to a similar level of difficulty that I encountered with my entire honours project.
I'm pleased that I managed to get the LOD in and should no focus on making sure the normals are generated correctly.
I uploaded a video that demonstrates my terrain in action, showing how the level of details render as well as how the mesh looks under different set ups.