Dynamic 3D world rendering using Unity3D

I would like to share some progress on my open source project: UtyMap. This is a library which provides highly customizable API for procedural world generation based on real map data, e.g. OpenStreetMap, NaturalEarth. Core logic is written on C++11 and can be used on many platforms as it has no dependency to specific game engine or application framework. Demo application is built using Unity3D and it provides examples* with interactive world creation at different zoom levels, including globe and ground:

  • Globe zoom level example is not available temporary

Full source code is available here: https://github.com/reinterpretcat/utymap
Latest release binaries: https://github.com/reinterpretcat/utymap/releases/tag/ver1.1
Demo app in google play: https://play.google.com/store/apps/details?id=com.utymap.demo

Update from July 2016:
Initial post referred to ActionStreetMap project which is now deprecated and not supported, but full source code is available.

Hello eis_kalt,

I’m a MEng. student at Faculty of Engineering of the University of Porto (FEUP), Portugal. I have to compliment you on your project because it looks really good. I have been working with mobile exergame development with unity and map web services like Google and, now, OSM, to create a framework for mobile exergames on real-world procedural-generated 3D models.

Hope to hear more about this project when it’s finished.
Best of luck,

Thanks!

Project is still in progress. Some of upcoming changes inside ASM framework:

  • Reimplemented logic of processing map data: use custom spatial index inside and no need to use splitter tool.

  • Support import of o5m, pbf and xml formats.

  • Reimplemented logic of interpolating height map for elevation mode: it’s more accurate now (bilinear interpolation is used).

  • Added support of flat map mode: rendering is faster in ~30% and no need in elevation data.

  • Fixed issues with missing elements crossing tile borders: limitation of old map data processing logic.

  • Added simple search for elements with given tag’s key/value pair: you can find the nearest bars, restaurants, other places, features.

  • Smart road processing: build road graph, detect road junctions in order to simplify further AI logic.

  • Async loading by Rx: dynamically load map tile without blocking UI thread.

  • Auto downloading and saving of current elevation file from NASA server (or custom one)

  • Auto downloading of map data for current tile from openstreetmap server (or custom one)

  • Added reverse geocoding support by querying of Nominatium server (or custom one).

Decided to use flat shading as default rendering style:

The latest changes introduce support of fast overview mode which renders simple pseudo 2D map skipping buildins, POI, etc. (see updates above). This can be done in the same 3D scene (see top right button in demo builds) or in separate 2D only mode.

Also offline (one time custom index construction action is required) and online (by quiring of OSM server) modes are supported.

Next demo app version will contain simple editor which allows you to add (remove?) buildings, barriers, trees (and, probably, roads, areas) dynamically into scene (ability to save changes in file also will be possible but won’t be exposed through demo app).

Terrain modification tool is also planned.

I recorded some video preview for editor: https://www.youtube.com/watch?v=cQ_FmhjC12s

quite impressive!!!

Tell us when time is ready to report availability via http://wiki.openstreetmap.org/wiki/WeeklyOSM or the German OSM Wochennotiz Blog.

Still have a lot of work: just added to demo app really simple GUI editor (but it can be easily extended to add/edit/delete objects with different tag values). Now I’m focused on multiplayer feature in framework which will allow to share changes immediately over network (Unity has built-in multiplayer support).
Yeah, and bug fixing (geometry, rendering, etc.)

Now editor supports multiplayer mode:

https://www.youtube.com/watch?v=NTU-0BoJ_5Q

Dynamic mesh modifications:

https://www.youtube.com/watch?v=orVUX0OQDnc

Looks quite impressive! Can’t wait to walk in 3D through my town!

Thanks eis_kalt. Very nice thing!
Best regards,
Marek

The latest changes in demo project demonstrate various aspect of usage:

  • *SimpleMap2D *scene loads 2D map of large area with low detail terrain and allows you to skip the certain objects (e.g. buildings, trees) using MapCSS rules for different zoom levels. You can also pan/zoom map.
  • *SimpleMap3D *scene loads one tile with all details (full detail terrain, buildings, trees) and adjusted tiles with low level of details. You can walk and interact with environment: modify facade of building, make craters. Tiles will be loaded/unloaded automatically.
  • GpsTracking scene demonstrates how to work with Location Services (e.g. GPS). Nmea file is used as GPS signal source to simulate movement.
  • *GuiEditor *scene demonstrates several features: map editor (create new map object such as buildings, barriers, trees; adjust terrain height), current address resolution (detects where you are), dynamic switch between 2D/3D maps (2D map shows larger area). You may find video which shows this scene in action above.

Next version will support custom textures for map objects, e.g.:

Version with textures is published!

Working on rewriting core logic using C++ to make it completely independent from Unity3D and increase performance. Also support of multiply zoom levels are planned (e.g. render Earth as globe on zoom level one and buildings/all details in 3D on highest level).

Running on mobile devices is still target.

Just first raw results showing chosen direction - rendered globe at zoom level 1:

No texturing yet, color gradient logic is slightly broken, but I was able to use coastline data (from natural earth shapefiles) and mesh generation is quite fast.

Just added future ability to specify color/gradient for each country:

It will be just one country specific rule in mapcss, e.g.:

area|z1[sr_geounit=Germany] {
color: gradient(yellow);
}

…and it is so easy to apply texture to generated mesh keeping assigned country colors (+ borders) :