I haven’t fully tested my implementation of the optimised algorithm for populating the render list from the quad tree data, however, I am very close to doing this.
I am now roughly in the same position I was in several months ago, where I am ready to test the final step of the spherical terrain Chunked level of detail rendering system. However, I had previously made a number of fundamental errors in the way the terrain code was set up, which I now believe I have fixed.
These errors included using just one quad tree, when I should have used 6 (one for each face of the quad sphere), and rendering the terrain in triangles, instead of rendering each node of the quad tree as a separate, independently rendered, quad. I have fixed these issues and several more, and so I am reasonable confident that I will achieve proof of concept this time.
I came up with my solution to the problem of parsing and subdividing the tiers when I previously tried to implement this with the older code. This same solution should work with the new code as well. I basically need to get the centerpoint of the current node that I am processing, transform it to world space, and then project a vector from that node to the players position.
I can then scale that vector by the blocksize/2, where the blocksize is the length of a quad at that resolution, so if the maximum resolution is 64, the first tier has a blocksize of 64 (just one node), this then splits to form 4 quads, each with a block size of 32, then these split to form 16 quads with a blocksize of 16, etc.
This will give me a vector with an endpoint which is the closest point to the player within the circle centered on the node center, and with a diameter equivalent to the blocksize of that tier. I can then simply get the distance between this endpoint and the players position. If it is within the players view distance, I subdivide the node, if not, I render it as it’s current resolution.
This should solve the problem I was having, when I just grabbed the closest node to the player and subdivided it (which failed if the player was near a node border, since only the closest node, and not the node on the other side of the border, would be subdivided, leaving a noticeable gap). I have posted about these issues more in previous posts.
I am currently in the final stages of testing before I implement this solution fully, so I should know relatively quickly if this will work or not.