{"id":15137985,"url":"https://github.com/kurtkuehnert/terrain_renderer","last_synced_at":"2025-07-13T01:05:15.527Z","repository":{"id":41289746,"uuid":"447149759","full_name":"kurtkuehnert/terrain_renderer","owner":"kurtkuehnert","description":"A large-scale real-world terrain renderer written in Rust using the Bevy game engine.","archived":false,"fork":false,"pushed_at":"2023-04-26T11:17:26.000Z","size":81439,"stargazers_count":195,"open_issues_count":5,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-10T23:14:37.910Z","etag":null,"topics":["bachelor-thesis","bevy","graphics","rust","terrain-rendering"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurtkuehnert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-12T09:16:27.000Z","updated_at":"2025-04-08T22:32:12.000Z","dependencies_parsed_at":"2025-01-03T08:12:34.504Z","dependency_job_id":"7bef9d0c-008a-41d6-9ff5-1b44082c9b9f","html_url":"https://github.com/kurtkuehnert/terrain_renderer","commit_stats":{"total_commits":341,"total_committers":4,"mean_commits":85.25,"dds":"0.21700879765395897","last_synced_commit":"ccde127767bba3ddd88f528f5c37c0589c4c5b18"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtkuehnert%2Fterrain_renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtkuehnert%2Fterrain_renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtkuehnert%2Fterrain_renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtkuehnert%2Fterrain_renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurtkuehnert","download_url":"https://codeload.github.com/kurtkuehnert/terrain_renderer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492770,"owners_count":21916974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bachelor-thesis","bevy","graphics","rust","terrain-rendering"],"created_at":"2024-09-26T07:04:07.251Z","updated_at":"2025-05-10T23:14:45.875Z","avatar_url":"https://github.com/kurtkuehnert.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terrain Renderer\n![Screenshot 2022-10-24 at 15 44 30](https://user-images.githubusercontent.com/51823519/197553641-7e73dfce-24ca-48d9-861a-1012290f0c04.png)\n\nA large-scale real-world terrain renderer written in Rust using the Bevy game engine.\n\nThis project is developed by [Kurt Kühnert](https://github.com/kurtkuehnert) and contains the reference implementation of my bachelor thesis.\nThis terrain renderer focuses on visualizing large-scale terrains in a seamless, continuous, and efficient manner. \nThe source code was developed as the open-source plugin **[bevy_terrain](https://github.com/kurtkuehnert/bevy_terrain)** for the Bevy game engine.\n\nAdditionally, this repository contains the full version of my **[Bachelor Thesis](https://github.com/kurtkuehnert/terrain_renderer/blob/main/Thesis.pdf)** describing the novel terrain rendering method in great detail. A [citable version](https://monarch.qucosa.de/landing-page/?tx_dlf[id]=https%3A%2F%2Fmonarch.qucosa.de%2Fapi%2Fqucosa%253A82570%2Fmets) is also available.\n\nThis [Video](https://youtu.be/ZRMt1GV50nI) showcases the capabilities and features of this terrain renderer.\n\nThe terrain data is taken from the [Geoportal Sachsen (GeoSN, dl-de/by-2-0)](https://geoportal.sachsen.de/) and the [Federal Office of Topography (©swisstopo)](https://www.swisstopo.admin.ch/en/home.html).\n\n## Abstract\n\nReal-time rendering of large-scale terrains is a difficult problem and remains an active field of research.\nThe massive scale of these landscapes, where the ratio between the size of the terrain and its resolution is spanning multiple orders of magnitude, requires an efficient level of detail strategy.\nIt is crucial that the geometry, as well as the terrain data, are represented seamlessly at varying distances while maintaining a constant visual quality. \nThis thesis investigates common techniques and previous solutions to problems associated with the rendering of height field terrains and discusses their benefits and drawbacks.\nSubsequently, two solutions to the stated problems are presented, which build and expand upon the state-of-the-art rendering methods.\nA seamless and efficient mesh representation is achieved by the novel Uniform Distance-Dependent Level of Detail (UDLOD) triangulation method.\nThis fully GPU-based algorithm subdivides a quadtree covering the terrain into small tiles, which can be culled in parallel, and are morphed seamlessly in the vertex shader, resulting in a densely and temporally consistent triangulated mesh. \nThe proposed Chunked Clipmap combines the strengths of both quadtrees and clipmaps to enable efficient out-of-core paging of terrain data.\nThis data structure allows for constant time view-dependent access, graceful degradation if data is unavailable, and supports trilinear and anisotropic filtering.\nTogether these, otherwise independent, techniques enable the rendering of large-scale real-world terrains, which is demonstrated on a dataset encompassing the entire Free State of Saxony at a resolution of one meter, in real-time.\n\n## Screenshots\n\n![Screenshot 2022-10-24 at 15 49 42](https://user-images.githubusercontent.com/51823519/197553596-313ae184-c04d-4663-a11d-b623ffadff91.png)\n![Screenshot 2022-11-18 at 11 05 05](https://user-images.githubusercontent.com/51823519/202845032-0537e929-b13c-410b-8072-4c5b5df9830d.png)\n![Screenshot 2022-11-18 at 11 03 32](https://user-images.githubusercontent.com/51823519/202845038-1b0573c5-70f8-4b69-bf39-17d6c63cead5.png)\n![Screenshot 2022-10-24 at 15 49 09](https://user-images.githubusercontent.com/51823519/197553628-dba7321c-8a1e-4b98-96ab-81716d98f765.png)\n![Screenshot 2022-10-24 at 15 46 34](https://user-images.githubusercontent.com/51823519/197553638-8e3ec4ea-0114-4f84-8813-ddc46a12e3b0.png)\n![Screenshot 2022-11-18 at 11 02 24](https://user-images.githubusercontent.com/51823519/202845040-2ad51635-0e6a-4595-a753-f4aa80c50565.png)\n![saxony_data](https://user-images.githubusercontent.com/51823519/201691234-553c6e7c-d184-4124-b6f9-81936a2e8bc2.png)\n\n\n## Instructions\n\n### Release\nThe precompiled binaries for Windows, Linux(Debian), and MacOS are supplied on the right.\nSimply download and install the latest version.\n\n### From Source\n\nIf a released version is not available for your OS, or you want to experiment with the code, please compile the project from source.\n\nClone this project:\n```\ngit clone https://github.com/kurtkuehnert/terrain_renderer\n```\n\n**Note:** make sure your rust version is up to date (`rustup update stable`)\n\nNow compile the terrain renderer, like so:\n```\ncargo build --release \n```\n\n### Configuration\nBefore you can run the terrain renderer you first have to set up the config file and download the terrain data.\nSimply modify the `config.toml` file found at the root of the repository or bundled with your release.\n\nHere you have to specify in which directory the data for the terrains should be stored.\nTherefore edit the `terrain_dir` field.\nThe `terrain` field selects which of the different terrain configurations to use.\nEach of them will be stored in a subdirectory with the same name.\n\nBy default, there are four terrains available: Hartenstein, Hartenstein_large, Saxony, and Uri. \nAdditional parameters control the quality and appearance of the terrain. \nFor more information on the, take a look [here](https://github.com/kurtkuehnert/terrain_renderer/blob/main/crates/terrain_settings/src/lib.rs#L5-L23).\n\n**Note:** The Saxony dataset takes up over 100 GB of diskspace and is compiled from 2 TB of source data. Start by trying the Hartenstein terrain first.\n\nBefore the terrain can be rendered you first have to download its terrain data.\nThe downloader supports downloading data from the Swiss and Saxon datasets.\n\nFor the downloader to work it requires a list urls of the tile data.\nThe lists for the default terrains can be found in the `urls` directory.\nSimply copy the appropriate one into the directory of the terrain. (E.g. `my_terrain_dir/MyTerrain/my_urls.csv`)\nAdditionally, the process of generating such a list for any desired terrain is described below.\n\n#### Saxony\n\nTo download a terrain from the Saxon dataset, provide the tiles by copying their urls from this website: https://www.geodaten.sachsen.de/batch-download-4719.html.\nThere select the region and the municipality and copy the links by clicking on the blue button.\nThen you have to paste all links into a text file (.txt or .csv) and save it inside the subdirectory of the terrain you want to download.\nFinally, configure the `urls_saxony` field for your terrain in the config file.\nMake sure that the `side_length` is larger or equal to the maximum amount of tiles in x or y direction.\n\n**Note:** All DTM and DSM data of the terrain is downloaded automatically as well.\n\n```config.toml\n[[terrains]]\nname = \"Hartenstein\"\nside_length = 4\nurls_saxony = \"urls.txt\"\n```\n\n```\nterrain_dir\n└── Hartenstein\n    └── urls.txt\n```\n\n![Screenshot 2022-11-14 at 16-17-46 Batch Download - Offene Geodaten - sachsen de](https://user-images.githubusercontent.com/51823519/201697383-18c4cf86-c075-4c6a-a3cb-3a38dd99b666.png)\n\n#### Switzerland\nThe process for terrains from the Swiss dataset is similar.\nHere you have to specify the dtm and dop data separately.\nSelect individual tiles or entire regions on the following two web pages.\nhttps://www.swisstopo.admin.ch/en/geodata/height/alti3d.html for the height data (DTM) and https://www.swisstopo.admin.ch/en/geodata/images/ortho/swissimage10.html for the orthophotos (DOP).\nMake sure the parameters match the ones in the screenshot below.\nThen press the blue search button, export all links in the menu below, and download them as a csv file.\nFinally copy both urls files into the terrains directory.\n\n**Note:** Swiss DSM data is not supported.\n\n```config.toml\n[[terrains]]\nname = \"Bern\"\nside_length = 200\nurls_saxony = \"urls.txt\"\n```\n\n```\nterrain_dir\n└── Bern\n    ├── urls_dtm.csv\n    └── urls_dop.csv\n```\n\n![Screenshot 2022-11-16 at 18-55-41 swissALTI3D](https://user-images.githubusercontent.com/51823519/202257636-9df67a16-55d6-4e70-9060-1f9f7beb6c25.png)\n\n\nWith the configuration set up you can now start the download tool.\n\n**Note:** It may take a while until all data has finished downloading.\n```\n./download_tool\nor\ncargo run --release --package download_tool\n```\n\nFinally, you can visualize the data with the terrain renderer.\nMake sure to set the `preprocess` flag in the config to true, the first time you view each terrain so that the terrain data can be imported.\n\n**Note:** It may take a while until all data has been preprocessed.\n```\n./saxony_terrain_renderer\nor\ncargo run --release\n```\n\n## Controls\n\nThese are the controls of the terrain renderer.\nUse them to fly over the terrain, experiment with the quality settings and enter the different debug views.\n\n- `T` - toggle camera movement\n- move the mouse to look around\n- press the arrow keys to move the camera horizontally\n- use `PageUp` and `PageDown` to move the camera vertically \n- use `Home` and `End` to increase/decrease the camera's movement speed\n\n- `V` - toggle DTM/DSM\n- `W` - toggle wireframe view\n- `P` - toggle tile view \n- `L` - toggle lod view\n- `U` - toggle uv view\n- `C` - toggle node view\n- `D` - toggle mesh morph\n- `A` - toggle albedo\n- `B` - toggle base color black / white\n- `S` - toggle lighting\n- `G` - toggle filtering bilinear / trilinear + anisotropic \n- `F` - freeze frustum culling\n- `H` - decrease tile scale\n- `J` - increase tile scale\n- `N` - decrease grid size\n- `E` - increase grid size\n- `I` - decrease view distance\n- `O` - increase view distance\n\n- `Z` - toggle sun rotation\n- `X` - decrease the sun's period duration\n- `Q` - increase the sun's period duration\n\n## License\nSaxony Terrain Renderer is dual-licensed under either\n\n* MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)\n* Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n\nat your option.\n\nThe Thesis.pdf is excluded from both of these and is licensed under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtkuehnert%2Fterrain_renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurtkuehnert%2Fterrain_renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtkuehnert%2Fterrain_renderer/lists"}