Skip to content

ezappala/bevy_terrain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

522 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy Terrain

GitHub Discord

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.

Examples

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.

Documentation

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).

Debug Controls

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.

Fly Camera

  • T - toggle fly camera movement
  • Move the mouse to look around
  • Press the arrow keys to move the camera horizontally
  • Use PageUp and PageDown to move the camera vertically
  • Use Home and End to increase/decrease the camera's movement speed

Orbital Camera

  • 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

Visualization Toggles

  • W - toggle wireframe view
  • L - toggle terrain data LOD view
  • Y - toggle terrain geometry LOD view
  • Q - toggle tile tree view
  • P - toggle pixel view
  • U - toggle UV view
  • B - toggle normals view
  • M - toggle morphing
  • K - toggle blending
  • Z - toggle tile tree LOD
  • S - toggle lighting
  • G - toggle texture sampling using gradients
  • H - toggle high precision coordinates
  • F - toggle freeze view frustum
  • D - toggle surface approximation debug

Quality Adjustments

  • N - decrease blend distance
  • E - increase blend distance
  • I - decrease morph distance
  • O - increase morph distance
  • X - decrease grid size
  • J - increase grid size

GPU Frame Capture (macOS)

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.

Attribution

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/.

License

Bevy Terrain source code (this excludes the datasets in the assets directory) is dual-licensed under either:

at your option.

Contributions

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

  1. Currently, the support for planar terrain rendering is broken.

About

A terrain rendering plugin for the bevy game engine.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 84.3%
  • WGSL 15.7%