Raytiles is a 3D geospatial engine 🌎 for raylib. Designed to stream and render the real world in real time. It lets you visualize any location on Earth directly inside your raylib applications.
Built for indie developers and professionals alike, Raytiles is a perfect fit for UAV simulations, flight-planning software, lightweight GIS analysis, presentations, digital sand tables, and any other geospatial visualization (check out the examples below!).
It provides precise, ground-truth altitude data, essential for accurate collision detection and spawning mechanics in games, as well as for topographical analysis in GIS workflows.
Originally developed to power a flight simulator, Raytiles was extracted into a lightweight, standalone library so it can be embedded seamlessly into any raylib project.
🙋 Have a question or want to contribute
- Streaming and rendering ANY location on Earth!
- Adaptive LOD (level-of-detail)
- Lights and Shadows via normal maps
- Ground-truth altitude/height queries for collision and spawning
- Configurable & providers agnostic
- C++ API & C wrapper API
- Background tile downloading (HTTP + persistent on-disk cache)
- Cross-platform builds for Windows, Linux, and macOS
- Open source and permissively licensed (MIT)
See sandbox/demo.cpp for a full runnable example with input handling.
The following example video shows part of the Greek islands, rendered with Mapbox tiles at zoom levels 11 to 14:
example.mov
This example demonstrates lights and shadows:
shadows.mov
Why not use 3D Tiles? (Cesium, Google Earth, etc.)
3D Tiles is a powerful format for streaming and rendering large 3D geospatial datasets, but it comes with significant complexity and overhead.
- It is designed for walk-through resolution and visual fidelity, not for flight simulation, which is Raytiles' primary target.
- Google 3D Tiles require an access token and offer only limited free usage, which can be a barrier for indie developers and small projects.
- Google does not allow caching 3D Tiles data, so every time you want to render a location you have to re-fetch from Google's servers, leading to latency and increased bandwidth usage.
- The 3D Tiles glTF format stores coordinates in double precision, which does not fit raylib's float-based rendering pipeline. The data must be decoded on the CPU and re-uploaded to the GPU every frame, hurting performance.
- Cesium 3D Tiles is even more complex: unlike Google, it does not provide ready-made models, only mesh data. The rest of the pipeline is essentially what Raytiles already does.
This project actually started out using 3D Tiles, and a 3D Tiles renderer implementation lives in the legacy/
directory,
but it was eventually dropped in favor of a simpler, lightweight approach better suited to Raytiles' needs.
Example of the 3D Tiles renderer in action using Google 3D Tiles (with debug data and grid):
Made with ❤️ for the raylib community. If you find this library useful, please consider starring the repo and sharing it with your friends! Contributions and feedback are always welcome. Happy coding!

