P-152: Virtual World Concept Update 82: Chunked Levels of Detail Using Quad Trees Part 49: Possible Proof of Concept
I believe I have finally achieved proof of concept with the spherical terrain using CLOD! After 82 posts, including 49 specific to CLOD, I think I am finally there (or almost, at least).
At the below video shows, I have successfully implemented a system whereby the terrain will dynamically change detail levels as the camera gets closer and closer to the world, and switch back again as it moves away.
The change is actually far more seamless than I thought! I was concerned that there would be problems at the edges, where the different levels of detail meet (for example, when the terrain close to the camera is rendering at a higher detail level than the terrain far from the camera), however this does not appear to be a major issue.
There is a visible border between the detail levels, which is to be expected, since I haven’t added any edge stitching yet, but in general the transition is very smooth.
Most importantly, the frame rate seems to be very consistent. I have not done full benchmarks at high resolution yet, but from the low resolution tests that I have done so far, the framerate does not seem to drop very much as the new tiers are paged in. This is all very encouraging.
There is still a lot of work to be done however. Firstly, at the moment, the transition is controlled by an If/Else statement with fixed distance variables, i.e, if the player is less than 5000 units away, display the lowest tier, once they are within 4000 units, transition to the next tier, etc etc. Obviously, this will not work for the final version of the terrain since I will not know exactly how many tiers they will be (the number of tiers will depend on the max resolution of that particular terrain) and in addition, I don’t want to hard code the distance values, these should be dynamic.
I also need to find a way to scale the terrain to realistic planet sizes. This will require finding a way to dynamically generate and add points to the quad tree, since generating enough points to render and entire planet cannot be done all at once. I will probably use my current code until the player gets close to the planet, and then begin generating points dynamically and adding just the points close to the player to the quad tree. This should allow far greater detail without having to load all points into the quad tree at once in the beginning of the simulation.
I also have to texture the terrain, and make sure that the terrain rendering and collision work at realistic sizes (this will involve dealing with 32-bit precision issues). I will also have to make sure the terrain works in multiplayer.