Skip to content

OpenGL Terrain Renderer with data from Web Map Tile Services.

Notifications You must be signed in to change notification settings

gue-ni/TerrainRenderer

Repository files navigation

Terrain Renderer

cmake workflow badge

A simple OpenGL Terrain Renderer. Orthophoto data is provided by basemap.at, elevation data is from geoland.at. This data is limited to Austria and as such only Austria is rendered.

Features

  • Real-world elevation and orthofoto data
  • Multithreaded terrain tile loading
  • Quadtree level-of-detail
  • Frustum Culling
  • Realistic Atmosphere with Rayleigh scattering

Build Instructions

This project depends on SDL2, GLM, GLEW and libcpr. You should be able to build by following the steps in the cmake.yml.

git clone --recursive https://github.com/gue-ni/TerrainRenderer.git
cmake -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build --config Release --parallel

Digital Elevation Model

There are countless providers of satellite image tiles, but for the digital elevation model we have to provide the data ourself. Download ogd-10m-at.zip from data.gv.at.

Unzip the files and process the data with gdal_translate and gdal2tiles.py:

# convert from float32 to uint8 and scale values to [0, 255]
gdal_translate -ot Byte -scale 0 3795 0 255 dhm_at_lamb_10m_2018.tif grayscale-byte-fullsize.tif

# create tiles
gdal2tiles.py --resume --processes=2 --zoom=6-16 --tilesize=128 grayscale-byte-fullsize.tif tiles