Godot Map loader – Addon
From itch.io author’s page:
This is still a work in progress, some features need improvement (and help is welcome). Please note that on version 3.1 is not properly working (cannot generate meshes while on editor (tool mode), I’m planning to fix it soon, but there’s no date yet.
The module tries to represent that data as accurate as possible and being as fast as possible, being this way ideal to load dynamically the terrain (imagine flight simulator that can load terrain from anywhere in the world as you go).
Some coordinate you can use to test the script
IGUAZU FALLS lat: -25.695277777778 lon: -54.436666666667
FLORENCE – lat: 43.771388888889 lon: 11.254166666667
COTOPAXI lat: -0.680556, lon: -78.437778
MOUNT FUJI lat: 35.36 lon: 138.73
HIMALAYA lat: 27.988056, lon: 86.925278
As this module is using Mapbox services, you should follow the guidelines mentioned here: How attribution works, if you plan to use the maps publicly. You can see an example in the main scene.
Godot 3.1 is out! And with lots of new features and improvements. Also this addon have some improvements, actually, I’ve started a complete rewrite of this, some of the things I’ve done are:
- reduced the size of the meshes (I directly generate an ArrayMesh, no mo surfacetool)
- hand made normals, that avoid the seams visible when you create multiple tiles
- A rudimentary LOD system.
- At lower zoom levels render earth’s curvature.
- at very low zoom levels a sphere with only texture and normal maps will make it faster to load.
First thing first (after you downloaded the addon files in the “addon” folder, or added it from the Godot Asset Library) you have to activate the addon in the Project Settings page.
Create a scene with directional light, a camera, etc. Then add a TerrainLoader node. And then in the node’s properties set latitude, longitude and zoom level (It’s the Coordinates setting, or Tilecoords if you want to enter directly the tile X/Y/Z). You can load multiple tiles by just changing the coordinates, usually, once entered the first Lat/Lon/Zoom you may want to just change the tile, so that you have contiguous tiles. The “Arrange Tiles” checkbox will enable automatic alignment of the tiles, based on their tile position.
You can enter here the latitude(x), longitude(y), zoom (z)
You can enter also the tile with it’s X/Y and Z(oom) values.