Dynamic quadtree-based LOD for tessellated-cube sphere mesh
@toerror Yep, each patch has an approx bounding sphere, and I subdivide if distanceToBoundingSphereCenter/boundingSphereRadius is less than some treshold
@lisyarus Fair. I've used a bunch of different techniques.. Problem with axis aligned bounds is it distorts so you get more subdivision on certain tiles, and when you get in close it can suffer other issues when mountains etc become significant.
My current approach is to convert the observer's coords into the tangent space of the tile and check against a capsule enclosing it up to the highest / lowest altitudes.
@lisyarus Neat. Are you already using some projection to reduce distortion, get a more even subdivision?
@thomastc Nope, just the projected cube
@lisyarus Before I chickened out and flattened my world into a cylinder, I was using the tangent projection from the S2 library:
https://s2geometry.io/devguide/s2cell_hierarchy#coordinate-systems
It's just a handful of extra lines of code involving one tan() call, but it reduces the difference in area between the smallest and largest cells from a factor of 5.20 to a mere 1.41.
The code and excellent documentation is here:
https://github.com/google/s2geometry/blob/10b2e37/src/s2/s2coords.h#L226
@thomastc Good to know, thanks!
I think if I cared about that, I'd start with the icosahedron. It's a bit of a pain to keep track of triangle subdivisions, though >_>
@lisyarus What rule for subdivision? Just distance based?