Terrain engine upgrade #5
Terrain engine upgrade is incessant work. I am decided to stop experiments and freezing out the current texturing method. I have updated biomes and materials preset editors, added a real-time preview of the editing texture, created a default presets for all types of planets.
This is the biomes preset editor. Textures on the palette at the top are satellite samples of a large parts of terrain. They can be changed by clicking on a cell - a texture choosing window will appear. Each texture further can be tweaked by changing its color, scale, rotation and blending weight. At the bottom is a palette with soil materials which are allowed for the current preset (i.e. for the current planet).
Soil material are close-up textures like rocks and grass. Clicking "Add" brings up a similar texture-selection window, but this time with a soil material previews:
The soil material is not a simple texture, is a shader-based mixture of two textures which looks good at all scales. This is achieved by combination of a "detail" and "modulation" textures, with a technique to remove a repetition pattern. This was described in this blog post, I just added texture mirroring/rotation on each step. The material selection window shows the result of such mixing. The "Edit" button opens the material editor, where you can change the individual textures and tweak their scale, rotation and blending weight.
Rotation is currently have just 2 values: "enabled" and "disabled". If enabled, it allows flipping/mirroring of the texture in a adjacent spatial zones, which is used to remove a repetition pattern. This increase variation without needs of increasing texture resolution or using additional textures. The same is used for a satellite samples textures. You may want to disable random rotation on some textures, such as a sand dunes, otherwise it will look odd.
The square preview at the bottom of the soil editor is the result of mixing of the detail and modulation textures. It gives idea of how it will look on the planet surface. The preview can be zoomed and dragged my mouse.
Other large job is preparing the library of a sample and material textures. I already have 50+ of them, some are great, some are not. I am decided to switch to PBR material textures right now, to remove a double-work in future. So after release of beta, modders should find or create PBR textures for their planets addons. This is mandatory now: soil textures must have albedo, displacement and roughness maps; ambient occlusion and metallness map will be added also. And in the release they probably will be in a compressed DDS format, which also will be a mandatory.
The PBR rendering looks promising. There are some issues that must be solved: blending with a global planet texture, which now also must be PBR; fix artefacts at a different materials transitions; improve performance (30 FPS is not good). To achieve the latter two, I planning to implement some caching instead of a real-time rendering. Engine will pre-render tiles of a blended materials into additional terrain octree nodes or a special clipmap texture. The clipmap probably is a better choice, because it will allow implementation of the parallax occlusion mapping, which will make boulders in texture 3-dimensional. So many work to do!
I like how smooth the specular highlight looks with PBR shading, so all screenshots were taken at dawn.
Discuss this post on the forum.