OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

Announcement

A fix has been applied to the login system for the forums - if you have trouble logging in please contact support@openstreetmap.org with both your forum username and your OpenStreetMap username so we can make sure your accounts are properly linked.

#1 2014-11-23 21:40:34

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

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:

4c10f3ee-8db9-11e6-8877-b652aa846734.png

* 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/utyma … tag/ver1.1
Demo app in google play: https://play.google.com/store/apps/deta … tymap.demo

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

Last edited by eis_kalt (2016-10-08 23:55:42)

Offline

#2 2015-01-02 16:45:13

Pedro André Oliveira
Member
Registered: 2015-01-02
Posts: 1

Re: Dynamic 3D world rendering using Unity3D

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,

Offline

#3 2015-02-02 23:26:28

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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).

Last edited by eis_kalt (2015-02-02 23:31:33)

Offline

#4 2015-03-20 21:34:01

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Decided to use flat shading as default rendering style:

scene_color_only_moscow1.png

Last edited by eis_kalt (2015-09-30 23:43:08)

Offline

#5 2015-06-14 22:53:13

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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.

Offline

#6 2015-06-25 09:02:12

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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.

Offline

#7 2015-06-28 13:34:01

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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

Last edited by eis_kalt (2015-06-28 13:34:37)

Offline

#8 2015-06-30 16:47:45

stephan75
Member
Registered: 2008-05-28
Posts: 2,645

Re: Dynamic 3D world rendering using Unity3D

quite impressive!!!

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

Offline

#9 2015-06-30 21:54:19

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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.)

Offline

#10 2015-07-02 20:10:13

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Now editor supports multiplayer mode:

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

Offline

#11 2015-08-12 22:02:08

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Dynamic mesh modifications:

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

Offline

#12 2015-08-13 07:31:16

R0bst3r
Member
Registered: 2015-04-23
Posts: 318

Re: Dynamic 3D world rendering using Unity3D

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


Wenn jeder Neuling überall auf der Welt jeden Mist hinzufügen und löschen darf, sollten Fehlerbehebungen als solche auch toleriert werden.

Offline

#13 2015-08-13 10:03:55

marek kleciak
Member
Registered: 2010-10-11
Posts: 8,286

Re: Dynamic 3D world rendering using Unity3D

Thanks eis_kalt. Very nice thing!
Best regards,
Marek

Offline

#14 2015-09-15 13:42:57

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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.

Offline

#15 2015-09-20 20:50:35

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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

opzf9z.png

Last edited by eis_kalt (2015-09-29 23:08:46)

Offline

#16 2015-09-30 23:43:55

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Version with textures is published!

Offline

#17 2016-01-24 23:52:21

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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.

Offline

#18 2016-02-03 21:48:40

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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

first_globe_result.png

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.

Last edited by eis_kalt (2016-02-03 21:50:34)

Offline

#19 2016-02-08 23:00:01

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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

first_globe_result2.png

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

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

Last edited by eis_kalt (2016-02-09 20:00:19)

Offline

#20 2016-02-09 19:59:20

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

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

first_globe_result3.png

Last edited by eis_kalt (2016-02-14 10:07:42)

Offline

#21 2016-02-10 17:21:41

stephan75
Member
Registered: 2008-05-28
Posts: 2,645

Re: Dynamic 3D world rendering using Unity3D

Not bad!

But do you plan to release any software package or web service that can be accessed by normal users? In an easy way?

When this moment will come, will there be a release announcement or blog posting by you?

Offline

#22 2016-02-10 18:00:56

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Current plan is start from releasing this as FREE unity asset for desktop and mobile platforms (e.g. Android) when all major features are implemented and it is stable (cannot estimate so far the concrete date, but for sure I need several months). I'm already aware about making it easy to use and considering this as a MUST requirement.

Nice thing, that core part has no dependency on Unity at all as I'm writing it using C++11 without any Unity or platform specific API. You call something like loadTile with quadkey, desired mapcss style + callbacks which are called to return you back generated mesh or raw data (node/way/relation for given region if you want to process it from your code). Then is up to specific engine to build "game object" from this data.

Theoretically it can be reused in some other 3D gaming engine or visualization software.

I will keep posting here and at Unity forum.

Offline

#23 2016-02-14 19:11:53

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

Another feature: offsetting polygons:

first_globe_result4.png
first_globe_result5.png

Here, some countries are moved up and water is moved down. All parameters are dynamically configurable via mapcss, e.g.:

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

Last edited by eis_kalt (2016-02-14 19:51:11)

Offline

#24 2016-02-18 23:46:00

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

It's not difficult to process some places:

first_globe_result6.png

Here, text and sphere for each place are created on unity3d side from geodata provided by the library. Of course, visual representation can be improved: text from opposite side of globe should not be visible, but this is just example.

Last edited by eis_kalt (2016-02-18 23:47:20)

Offline

#25 2016-03-13 21:09:44

eis_kalt
Member
Registered: 2014-11-23
Posts: 42

Re: Dynamic 3D world rendering using Unity3D

I made old implementation open source.

Offline

Board footer

Powered by FluxBB