From LibreTerrain to Godot
Level: intermediate · Time: 30 minutes
You'll add colour and vegetation to a terrain, build it, and import everything into Godot 4 with the LibreTerrain editor plugin.
Before you start: have a terrain to work with. The island from Draw an island or the Highlands example both work. You'll also need a Godot 4.6+ project.
1. Choose a build size the plugin can import
The Godot plugin bakes one vertex per sample and currently caps images at 4,194,304 samples, so use a build resolution of 2,049 or less. Set it in the Build tab.
2. Colour
- On your final terrain node, click → Colour. It arrives in the Colour tab as a portal.
- Add a Colourise with the Terrain preset for a base colour by altitude.
- Bring a Slope mask across and use Colour Layers to paint rock where it's steep.
- For engine texturing, feed your masks into a Splat Map.
INFO
The import helpers skip colour maps and 8-bit PNGs, and tell you so. Export splat maps as PNG 8 and assign them in your own Godot material. Masks exported as EXR or PNG 16 come through as float textures.
3. Vegetation
- Send the terrain (and a water mask, such as Sea's Sea) to the Vegetation tab.
- Add Trees, connect the terrain and water, and pick a Species preset.
- Add Grass and connect Trees' Occupied output to Grass' Occupied input.
- Toggle Plants in the viewport to see placeholder shapes.
4. Mark and build
- Final Height: EXR.
- Masks you want in Godot, such as the Slope or a vegetation Density: EXR.
- Trees' Points: CSV.
Press Build. You get the images and CSV files, plus build.json.
5. Import into Godot
- Copy
import-helpers/godot/addons/libreterrain_import/from the LibreTerrain repository into your project'saddons/folder, and enable LibreTerrain build importer under Project → Project Settings → Plugins. - Choose Project → Tools → Import LibreTerrain build…, select
build.json, and choose a destination such asres://terrain/island.scn. - Open the new scene. The terrain is one
MeshInstance3Dat 1 unit = 1 metre, centred on the origin. - Select the root node and paste a mask's key (for example
["n_0012","out"]) into Preview Mask to see it on the terrain. - Each tree species is a
MultiMeshInstance3Dwith a placeholder cone. Replace its mesh with your tree at nominal size.
Next steps
- The plugin creates no collision. Add a
StaticBody3Dwith a collision shape that suits your game. - See Godot import helper for the details, and Exporting and building for every export option.
