Biome presets and textures
SpaceEngine uses a set of "presets" to define how procedural planets of different types are looking at which small-scale textures they are used. The system is split in two subsystems: the terrain sample textures, which are mid-scale textures like forests and sand dunes, and surface soil materials, which are very fine-scale features like pebbles and sand grains. The mid-scale sample textures are associated with biome presets. You can add a new biome preset in SE using the planet editor: select a planet which you want to use as a template, open the planet editor (Shift-F2), scroll down to Biomes and Palette presets, and press the Create new button.
Choose a file name for your new preset, for example, my_addon_terra_1.cfg, and press Save. Save the biome preset script to the addons folder with the follwing path format:
addons\addon_name\textures\terrain\samples\terra_may_addon.cfg
Choose a default preset for your new preset. The default preset is used to fill in parameters which are missing from the current preset (preset scripts are saved as a "diff" with the default preset, this ease editing them in the text editor). Save the file, and configure needed parameters, such as a planet class, preset weight (probablilty of applying it to procedural planets in SE), class and temperature of a host star (planet appearance and vegetation color may depend on it). Adjust clouds and ocean palette, and proceduaral color variation using the palettes below.
For your new biome you may use existing mid-scale terrain sample textures, or add your own. To add a new sample texture, first you must create these texture files (dimensions must be 512*512):
addons\addon_name\textures\terrain\samples\Name_COL.png - RGB color
addons\addon_name\textures\terrain\samples\Name_DISP.png - 8-bit grayscale displacement (elevation) map
addons\addon_name\textures\terrain\samples\Name_ROUGH.png - 8-bit grayscale roughness
In the biome preset editor, scroll down to the palette with biome textures, choose the one you want to modify, click a texture preview, and choose your newly added texture from the browser which will pop up.
If you don't see your new texture in the browser, then there must be some error. Inspect the system/se.log file for details. Note that displacement map is used only for blending with other sample textures, it does not modify actual terrain shape. This is a feature which I plan to implement in the future: it will allow to add a real mountain samples to SE procedural terrain!
There are two layers of terrain sample textures: large and small scale. You can modity scaling parameter, weight and amout of tiling-removal algorithm (random rotation) by sliders below the palette, once you click the texture to select it. Adjust biome colors by clicking the color bars in the palette: those are define how the planet will look from space. On the actual terrain in the game, large and small scale textures will be automatically re-colored to the color specified for the biome.
Biomes from Bottom to Ice are corresponding to gradually increasing altitude of the planet terrain. The Lava biome is a place-holder, lava is not properly implemented in SE yet (0.990). Steppe, Forest and Grass are biomes for life (plants), and their suffixes means type of life forms:
OrgU - organic unicellular
OrgM - organic multicellular
ExoU - exotic unicellular
ExoM - exotic multicellular
You can update (reload) the planet at any time by pressing a button at the top of the editor. And don't forget to press the Save button time to time!
Soil materials
The soil materials are PBR-ready (physically-based rendering) textures for fine surface featires (pebbles, sand, grass) and use two-scale level of detail and tiling-removal algorithm. They are generated as a finest levels of terrain quadtree, and SE can use up to 64 unique materials per planet. The palette at the bottom of the biome preset editor shows the list of soil materials used by current planet (by current biome preset, actually). You modify the list by using Add and Remove buttons above the palette, by choosing existing materials from the library. Or you can add your own soil material.
To add a new soil material, you should add these files (dimensions must be 1024*1024):
addons\addon_name\textures\terrain\materials\Name_COL.dds - RGB albedo in BC1/DXT1 format
addons\addon_name\textures\terrain\materials\Name_NORM.dds - normals in BC5/LATC2 format
addons\addon_name\textures\terrain\materials\Name_RHAO.dds - R=roughness, G=heightmap, B=AO in BC1/DXT1 format
To ease creation of these DDS files, use the following bat scripts. You need to install ImageMagic and NVidia texture tools. If needed, modify paths to installed tools at the beginning of each bat, and paths to folders with source and destination textures.
To create a new soil matarial in the editor, choose any of the existing ones, press the Edit button, and the soil meterail editor will pop up. Press the Clone button, enter the name of the new material and choose the script file where it will be saved. You may want to create a new script, as you are making an addon, not modifying the default game files. You may save as many materials to your script as you want; many biome presets may share materials from this script, as biome and soil material libraries are independant. The path to the script in your addons folder must have the following format:
addons\addon_name\textures\terrain\materials\library_name.pml
Adjust the color and slope for this soil material: it will be applied by engine automatically to any part of the terrain what is close edough by color and slope to values you had choose. After that, you can replace textures in the cloned material with your newly added ones, by pressing the texture preview and choosing your textures from the browser. If you don't see your textures there, check the log file for possible errors.
Adjust scale, color and other parameters. Typically, the "Detail" layer is the base texture (for example, pebbles or sand waves), and "Modul" is a fine details (scratches, cracks, sand grains) blended into the main texture. The Rotation parameter for tiling-removal algorithm currently can only be choosed between 0 (disabled) and 1 (enabled). You may want to disable it for materails such as a wavy sand dunes, otherwise it may give an odd result. The real-time preview of the resulting combined material is located at the very bottom of the editor: zoom it with the mouse wheel, pan with the left button and chnage lighting angle with the right button. Note that preview does not implement a tiling-removal algirothm which is used on actual terrain, you must reload the planet to see how it work by using a button at the top of the editor. And don't forget to press the Save button time to time!