Trees & Buildings
intermediate conceptsWorld Map Globe Ultra Edition · Core Concepts
Near the camera, the globe draws buildings from open building data and trees where a land cover map has forests. Both are downloaded for the places that the camera comes near and kept in disk caches, so you do not need to prepare anything. The options are in the Buildings Settings and Trees Settings sections of the globe. See Globe Settings for the full list.
Buildings
With Show Buildings on, the buildings are drawn up to Distance (m) from the camera, 8 km by default, and they rise from the ground as the camera comes near. Each building has the shape and the height of the data. A building whose data has no height takes Default Height (m).
- The walls have windows fitted to each wall. They are not the real facades.
- On a slope, a building stands on the highest ground of its outline, so no window of its lowest floor is under the terrain. On the lower side, its walls go down to the ground.
- Roofs are flat, except where the data gives a roof shape: then the roof has two slopes, as in gabled roofs, or four slopes, as in hipped, mansard and pyramidal roofs. The data has roof shapes only in some regions.
- With Textured Roofs, the roofs show the satellite image under them. Because satellite images show tall buildings from one side, the roof of a tall building can show part of its facade.
- With Textured Facades, each building takes a wall material with its own color (plaster, brick, stone or concrete), or the material and the color of the data when it has them. Tall buildings can have a glass wall that reflects the sky.
- With the textures off, the walls and the roofs take Wall Color and Roof Color, in a lighter or darker tone for each building.
Source of the Buildings
- Download, the default, downloads the buildings while the camera flies, from the default buildings server or from your own server with Custom.
- Areas Only draws only the buildings of the Offline Areas and downloads nothing.
When the server publishes a new release of the data, the disk cache of the buildings is emptied, unless Release names a fixed release. The source options are read when the component is enabled, or when you call ReloadBuildings().
Offline Areas
To ship places that need no connection:
- Press Download Buildings... in the Buildings Settings section. The window opens with the place of the camera of the globe.
- Write an Area Name, the Latitude and the Longitude of the center, and the Radius (Km), from 0.5 to 50 km. Use Camera Position takes the place of the camera again. The window tells you when the area is too large.
- Press Download and choose where to save the file inside the project.
The file is added to the list Offline Areas. Where an offline area has buildings, nothing is downloaded. After a change of the list from a script, call ReloadBuildings().
Credits and License
While the buildings are shown, the Attribution property of the globe includes the credit of the building data, and your application must show it. The buildings files and the disk cache contain a database under an open database license: if you distribute them, you must offer them under the same license.
Scripting
| Member | Description |
|---|---|
void ReloadBuildings() | Loads the buildings files again and applies the source options. Call it after a change of the list of areas. |
int DrawnBuildingChunks | Groups of buildings drawn in the last frame. |
int PendingBuildingTiles | Tiles of buildings that are still loading. |
long DownloadedBuildingBytes | Bytes of buildings downloaded since the component was enabled. |
string BuildingsRelease | Release of the data in use, or null when it is not known. |
Trees
With Show Trees on, the globe draws trees up to Distance (m) from the camera, 1 km by default, in the places where the land cover map has trees. The trees grow from the ground as the camera comes near. Density is the share of these places that take a tree.
- The map has a pixel every 10 meters, so a tree is placed near a real tree, not exactly on it.
- The map does not give the species of the trees, so each tree takes a kind by its place: conifers on high ground and at high latitudes, some palms in warm low places, and trees with a round crown in the other places. Each kind has trees of different sizes.
- Each tree takes the color of the satellite image under it. Where the imagery of a place cannot be loaded, the trees of that place take the Crown Color of their material.
- With Sun Shadows, the trees cast shadows of the Sun on the ground, on the buildings and on other trees, and they receive the shadows of the buildings and of the mountains. It needs Sun Shadows of the atmosphere.
Placement
With Precise Tree Placement off, the default, a tree is left out where the satellite image under it is not green, so that no tree stands on a road or a roof. A tree in a dark shadow can be left out for this reason, and in dry places, where the satellite image of the trees is olive or brown, many trees can be left out.
With Precise Tree Placement on, a tree is left out only where it stands on a road, on a railway or inside a building. Trees stand on footpaths, tracks, streets for people on foot, and over tunnels. The satellite image gives only the color of each tree.
- The roads and the buildings near the camera are downloaded and kept in a disk cache. When Show Buildings downloads the buildings, the trees use the same buildings and download only the roads. The trees use the server, the release and the cache limit of the Buildings Settings.
- Where the roads or the buildings cannot be downloaded, the trees of that place use the test of the green image.
- Each kind of road has its own width, or the width of the data when it has one. The trees also keep a distance from the roads and the railways, so the crowns of the default trees do not hang over them. A crown can still touch a wall.
Your Own Trees
Each kind of tree has its own prefab: Tree Prefab for the trees with a round crown, Conifer Prefab and Palm Prefab. An empty field uses the default tree of its kind. When Tree Prefab is set, an empty Conifer Prefab or Palm Prefab takes the model of Tree Prefab, so a model in Tree Prefab alone is used for every tree.
- Make a prefab with one mesh whose origin is the foot of the tree, in meters.
- Give its materials the shader World Political Map/Planetary Trees. A material of another shader gives only its texture and its color.
- Assign the prefab to Tree Prefab, Conifer Prefab or Palm Prefab. The change is applied when the component is enabled, or when you call
ReloadTrees().
The default trees are in Resources/Trees: PlanetaryTree with a round crown, PlanetaryTreeConifer and PlanetaryTreePalm, each one with its own material. You can duplicate a prefab and its material and change them. The materials have these properties:
| Property | Default | Description |
|---|---|---|
| Texture | Leaves | Texture of the leaves. |
| Texture Gain | 2 | Strength of the texture. |
| Crown Color | Dark green, a different one for each default tree | Color of the crown. |
| Trunk Color | Dark brown | Color of the trunk. |
| Satellite Image Tint | 1 | How much the crown takes the color of the satellite image under the tree, from 0 to 1. |
| Alpha Cutoff | 0 | For textures with transparent leaves, from 0 to 1. |
Credits
While the trees are shown, the Attribution property of the globe includes the credit of the land cover map, and also the credit of the roads and buildings while Precise Tree Placement is on. Your application must show this text.
Scripting
| Member | Description |
|---|---|
void ReloadTrees() | Loads the tree prefabs again. Call it after a change of a prefab or of its materials. |
int DrawnTrees, DrawnTreeChunks | Trees and groups of trees drawn in the last frame. |
int PendingTreeBlocks | Blocks of the land cover map, and tiles of roads and buildings for Precise Tree Placement, that are still loading. |
long DownloadedTreeBytes | Bytes that the trees downloaded since the component was enabled. |
Device Support
Buildings need a device with buffers in the vertex shader, and trees also need GPU instancing and indirect draws. The desktop graphics APIs have them. On a device without them, buildings or trees are not drawn and the Console shows a message.
Suggest an improvement
Help us improve this documentation page.