GT-Craft is a framework for fast-prototyping geospatial-based digital twins in Unity 3D. It uses a streamed satellite map image and elevation data to create a virtual scene in Unity 3D. For more detail, please check our paper. The map streaming and semantic segmentation phases are implemented in this repo.
The current implementation is developed and test on Ubuntu 22.04, Unity 2020.3, and Unity USD SDK 1.0.3.
The sample map data are already included under VirtualSceneGeneration/Assets/MapData
.
If you want to generate the virtual scene for your target area, you need to get mask images of the object semantics and elevation matrix by using this repo.
The new masks and elevation matrix need to be placed under Assets/MapData
.
It loads the map image as texture, and semantic/elevation matrices under Assets/MapData
.
- Terrain creation: Based on the elevation, the terrain is created. As the elevation value is the height from the sea level (sometimes too high or too low in the editor), it is possible to adjust the height offset parameter.
- Object creation by semantic mask images
- Building creation: The building objects are created by
Assets/MapData/building_mask.bin
. Currently, the building objects are textured by the pixel color in the map image, and a primitive cuboid with mesh and collider. - Road creation: The roads are based on the terrain. The masked area of the terrain as roads is annotated with navigation mesh of different costs than the terrain.
- Building creation: The building objects are created by
- When generating the virtual scene based on the geospatial data of the map, it is possible to adjust the map scale to the real-world map size via the
Scale Factor
parameter. If it is 2, the virtual-real ratio is 1:2.
The generated terrain, buildings, and roads are managed as children of MapManager in the scene. As MapManager includes all the generated virtual objects, the USD exporter works with MapManager to export the generated scene in a USD format.
When R key is typed, USD exporter exports the scene objects under MapManager as USD file. It can take some time to record the whole object details.