Bevy Terrain is a plugin for rendering terrains with the Bevy game engine. This plugin supports planar1 and spherical/ellipsoidal terrains of (almost) any size and resolution.
(Data Source: Federal Office of Topography, ©swisstopo)
Warning: This plugin is still in early development, so expect the API to change and possibly break your existing code.
Bevy Terrain was developed as part of my bachelor thesis and my master thesis on the topic of large-scale terrain rendering. If you would like to help me build an extensive open-source terrain rendering library for the Bevy game engine, feel free to contribute to the project. Also, join the Bevy Terrain Discord server for help, feedback, or to discuss feature ideas.
To try out Bevy Terrain, you first have to preprocess your dataset (GeoTIFF).
Some example datasets are available here.
Use the preprocess CLI or a prepared configuration in the preprocess/examples directory.
Then run the examples/spherical.rs demo with the preprocessed dataset selected.
The default path for the datasets is assets/source_data.
The docs folder contains a
high-level implementation overview,
as well as the development status,
enumerating the features that I am planning on implementing next.
If you would like to contribute to the project, this is a good place to start. Simply pick an issue/feature and discuss
the details with me on Discord or GitHub.
I would also recommend you take a look at
my thesis.
There, I present the basics of terrain rendering (chapter 2), common approaches (chapter 3), and a detailed explanation
of the
method used by bevy_terrain (chapter 4).
These are the debug controls of the plugin. Use them to navigate the terrain, experiment with the quality settings, and enter the different debug views. There are two camera controller options available: a fly camera for navigating using the keyboard and an orbital camera using only the mouse.
T- toggle fly camera movement- Move the mouse to look around
- Press the arrow keys to move the camera horizontally
- Use
PageUpandPageDownto move the camera vertically - Use
HomeandEndto increase/decrease the camera's movement speed
R- toggle orbital camera movement- Hold the left mouse button to pan the camera
- Hold the middle mouse button to rotate the camera
- Hold the right mouse button to zoom the camera
W- toggle wireframe viewL- toggle terrain data LOD viewY- toggle terrain geometry LOD viewQ- toggle tile tree viewP- toggle pixel viewU- toggle UV viewB- toggle normals viewM- toggle morphingK- toggle blendingZ- toggle tile tree LODS- toggle lightingG- toggle texture sampling using gradientsH- toggle high precision coordinatesF- toggle freeze view frustumD- toggle surface approximation debug
N- decrease blend distanceE- increase blend distanceI- decrease morph distanceO- increase morph distanceX- decrease grid sizeJ- increase grid size
When enabling the metal_capture feature, you can trigger a GPU frame capture using the C key.
Recorded captures are stored in the captures directory of the project.
They can be examined and analyzed using Xcode.
The examples use the following demo datasets:
- GEBCO Compilation Group (2023) - GEBCO 2023 Grid
- Unearthed Outdoors - True Marble Global Image Dataset GeoTIFF - Creative Commons Attribution 3.0 United States License
- ©swisstopo - swissALTIRegio
- This work utilizes data made available under the Norwegian Licence for Open Government Data (NLOD), distributed by the Norwegian Offshore Directorate. The data were originally acquired by various entities. For more information on the data, please visit the Norwegian Offshore Directorate's open data page: https://www.sodir.no/en/about-us/open-data/.
Bevy Terrain source code (this excludes the datasets in the assets directory) is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in the work, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Footnotes
-
Currently, the support for planar terrain rendering is broken. ↩