This is proof of concept for my OpenGL OSM framework. The project is on early stages of development (first commit dated Dec 12, 2010) and development focus is project architecture, not user-visible things, so the render is not yet as detailed as it can be and not as fast. However, it already kinda works.
Current features:
- Basic OSM xml loader
- Basic geometry generator (renders buildings, barriers and roads in 3D, other polygons as lines at ground level)
- Spherical mercator projection
- First-person OSM viewer (uses GLUT) - sample screenshots to the left
- Command-line ortho tile renderer (uses GLX and pbuffers) - sample rendering is where you've probably came from
- Extensible framework for building (other) 3D geodata visualization apps
Features planned for near future:
- Basic material support
- Geometry generation for landuse/natural polygons
- Multipolygon support
- Track data support
- Shadows, maybe more eyecandy
- Tiled geometry
- Multithreaded tile renderer
Features planned for not-so-near future:
- Support for multiple datasources (at least postgres in addition to .osm dumps) to be able to work as full-fledged tile renderer
- More extensible geometry generator (maybe in scripting language like python), CSG support (at least basic)
- Proper (billboard) POI, street name rendering
- Spherical earth renderer (a-la g*le earth)
- Feature-rich Qt viewer application (a-la g*le earth)
- Same as above, mobile version (Maemo)
- Proper third dimension support - multilevel intersections (level=*), tunnels, 3D terrain from SRTM
Note: I don't have much disk space for tiles at my web hosting, so for now only Moscow is available here. In addition to it, I can only squeze in a few very small areas. However, if you can't wait to see your city rendered with OpenGL, and can host tiles, that'll be quite useful for the time being - feel free to mail me. For instance, Moscow (32x40km, 300MB .osm dump), takes ~1GB and ~1 hour to render + 20 minutes for optipng after which it takes 450MB (actually much more more depending on filesystem block size - 650MB on my ufs2 volume and 1G on my hosters' ext3).
Performance: whole Moscow (32x40km, 300MB dump, 200k ways, 8.2k 3D buildings, 75k highways) renders at 134FPS on GeForce 9800 GT in FPS mode. As more geometry detail is introduced, performance will decrease, but when tiling is introduced it will increase tenfold in FPS mode (as we won't render ALL objects each frame). From tiler point of view, it takes roughly the same time to render one tile, 256 tiles or 1024 tiles in one go, so in batch mode rendering time will be negligible (especially when tiling is introduced) compared to png writing/compression which will be the real bottleneck. Png saving should be multithreaded and finely tuned (as in optipng). Fast color reduction should also be implemented in the tiler.
The code is available from GitHub under AGPLv3.
Written in C++, libraries/tools/technologies used: expat, OpenGL, GLUT, GLX, libpng, cmake. Tested on FreeBSD and Linux.
Dmitry `AMDmi3' Marakasov
EMail: amdmi3@amdmi3.ru
Jabber/XMPP: amdmi3@jabber.ru
Last updated 2011-10-06.