After a LOT of experimentation, I have got fed up with messing about and just made a decision.
The system will use displacement mapping under a quad tree mesh.
So I need to generate a lot of texture maps.
Height mapThe height map is 24 bits per pixel with each channel having the following mapping.
Red | Low byte of height |
Green | High byte of height |
Blue | Sign byte |
This allows a height range of 32767 to -32767 metres. Should be enough
Normal map24 bits per pixel encoding of vertex normal
Type map32 bits per pixel with the following mapping
Red | Texture 0 percentage |
Green | Texture 1 percentage |
Blue | Texture 2 percentage |
Alpha | Texture 3 percentage |
Each terrain region is assigned 4 surface textures based on altitude and slope. Think sand - grass - rock - snow. These are mixed based on the type textures pixel.
All this is auto generated from SRTM data.
At the end of this you have a "bare earth" terrain patch.
This is imported into an editor so each area can be detailed by hand, but will work as is without detailing.
If a detail map is available, the type map is only used for physics. Detail maps are stored by time range. So we can have different terrain details for each time period.
Here are some examples, I still have to split them down to terrain patches.