So, the base algorithm is finally working.
https://github.com/BaronVerde/cdlod
Tagging Pyatt , whenever you like.
A 4k heightmap texture comes with it. Ask me if you want a 16k texture, or search SRTM 90m data download, select the region you want, choose ARC ASCII as format, and see my other rep srtm-converter for how to generate .png tiles from the SRTM ASCII data. Also, try noise textures you may have somewhere. Eventually tweak the HEIGHT_FACTOR in settings.h.
Loading of a large heightmaps takes a few seconds, though that's going to change. Please mark the b* and krams directories under src as exclude from compile or you get multiple definition errors. These are just backups from working states.
It is only a single heightmap texture for now, and only flat vertex shading. No cosmetics. If you use an own heightmap, make sure it is 16bit-grayscale png of power-of-2, edit RASTER_MIN and MAX values in src/applications/cdlod/settings.h, and add a .bb text-file next to the heightmap texture. Look into src/renderer/renderer.cpp and change the filename there. Don't add .png. Attention, though there is a vector defined there, only one texture is loaded.
Next steps:
Comb the code. There are quite a few implicit conversions I must get rid off. - done -
Texture compression. - scrubbed, using half floats and uint16_t -
Parametrize and correctly calculate raster-to-world sizes and distances. My poor brain ...
Abstract texture types and bit depths and quite generally heightmap sources.
Build a data structure for heightmaps, and load/unload them asynchronously.
Render relative to eye. That means an own terrain camera.
Then: try to get it into the Godot scene tree.
Then proper texturing, rendering, evtl. cascaded shadow maps that fit the lod levels and ranges, collisions, placing of game objects.
Need a beer.