Announcement

Collapse
No announcement yet.

[PLUGIN] OpenStreetMap importer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] OpenStreetMap importer

    Hey all -- here is a plugin I wrote in my free time to import OpenStreetMap roads and buildings into UE4.

    Click image for larger version

Name:	UE4OSMRaleigh.jpg
Views:	1
Size:	260.3 KB
ID:	1204855

    You can export OSM data from OpenStreetMap.org, drag and drop it into Content Browser to save it as an asset. There's also a very simple Street Map Component that you can use to render cities.

    Here is my Tweet about it.

    Here is the link to the GitHub source and documentation.

    Happy New Year!


    --Mike
    Attached Files

    #2
    Happy new year, Mike! Awesome to have a clean OSM integration by an UE4 engine developer. If you see a way to integrate a trending repository like https://github.com/reinterpretcat/utymap/ into your approach I am happy to do work on it! He is using heightmap data and has more rules to produce the geometry in an encapsulated C++11 core library.

    I did a quick hack to load a mesh from his implementation into Unreal Engine, but keep struggling with a cleaner approach. The issue is to bind C++ class function to a C API. My efforts are located here: https://github.com/reinterpretcat/utymap/issues/110

    Comment


      #3
      Hello and happy new year, mike!

      nice job there. I am also currently developing nearly the same kind of plugin, like you do. I am doing this for my bachelor thesis and as i saw your post i had to take a deep breath. I hope this doesn´t affect my thesis in any negative way (well i think i should meet with my professor soon ). I also wanted to publish my plugin by using the marketplace when its ready(near march, i hope our both plugins wont conflict with each other). i haven´t looked into your code yet so i cant tell how far you have gone already or how much more you want to achive, but the scale of the generated world is really, really impressive.

      my plugin will also use some heightdata to generate a heightmap and i am deforming the landscape when i spawn roads, houses and rivers procedurally and so on. my focus lies on generating near game-ready levels so that in the near future i have playable procedural generated maps for my game i am working on.

      long story short, you did great work there, and i can´t wait to see some more progress

      -- Jerome

      Comment


        #4
        Happy new year mike!
        Thanks for your plugin.

        It has been featured on a popular german IT website:
        http://www.golem.de/news/hobbyprojek...01-125330.html

        Keep up the good work!

        Comment


          #5
          Originally posted by Phr34z3r View Post
          Hello and happy new year, mike!

          nice job there. I am also currently developing nearly the same kind of plugin, like you do. I am doing this for my bachelor thesis and as i saw your post i had to take a deep breath. I hope this doesn´t affect my thesis in any negative way (well i think i should meet with my professor soon ). I also wanted to publish my plugin by using the marketplace when its ready(near march, i hope our both plugins wont conflict with each other). i haven´t looked into your code yet so i cant tell how far you have gone already or how much more you want to achive, but the scale of the generated world is really, really impressive.

          my plugin will also use some heightdata to generate a heightmap and i am deforming the landscape when i spawn roads, houses and rivers procedurally and so on. my focus lies on generating near game-ready levels so that in the near future i have playable procedural generated maps for my game i am working on.

          long story short, you did great work there, and i can´t wait to see some more progress

          -- Jerome
          Show it off when you are ready. Your plugin sounds really awesome.

          Comment


            #6
            Greetings, does anyone else have trouble applying materials to the OSM mesh generated by the plugin?

            I tried to apply materials to the OSM buildings/roads by drag and drop, but the materials do not show, they just remain grey in color. I have tried all kinds of materials, from the simplest to the complex, they all do not work.

            In the picture the roads are GREEN in color, so there must be a way to apply materials to them.

            Hope to get some advise.
            Last edited by fspar30; 01-05-2017, 07:19 AM.

            Comment


              #7
              Originally posted by fspar30 View Post
              Greetings, does anyone else have trouble applying materials to the OSM mesh generated by the plugin?

              I tried to apply materials to the OSM buildings/roads by drag and drop, but the materials do not show, they just remain grey in color. I have tried all kinds of materials, from the simplest to the complex, they all do not work.

              In the picture the roads are GREEN in color, so there must be a way to apply materials to them.

              Hope to get some advise.
              To get the roads to show up you will need to create a Material that looks like the following.

              Click image for larger version

Name:	Road_Material_Setup.png
Views:	1
Size:	83.1 KB
ID:	1120976

              Comment


                #8
                Reply

                Originally posted by Sam Deiter View Post
                To get the roads to show up you will need to create a Material that looks like the following.

                [ATTACH=CONFIG]123925[/ATTACH]
                I did exactly that, but it still doesn't work. After applying the material the buildings/roads are still grey(pic attached).Click image for larger version

Name:	OSM.jpg
Views:	1
Size:	277.3 KB
ID:	1120985

                Also i tried multiplying vertex color with a green node, it doesn't work either. Click image for larger version

Name:	materialcolor.jpg
Views:	1
Size:	346.4 KB
ID:	1120986

                Comment


                  #9
                  Originally posted by fspar30 View Post
                  I did exactly that, but it still doesn't work. After applying the material the buildings/roads are still gray(pic attached).

                  Also, i tried multiplying vertex color with a green node, it doesn't work either.
                  You will need to apply the Material via the Blueprint Editor by doing the following.

                  1: Open up the Blueprint (BP).
                  2: Then go to Details -> Rendering and press the small white triangle to expose the advanced section.
                  3: Locate the Override Materials option and press the white plus sign to add a new element to the array.
                  4: Doing this will add a new Material input a that you can then assign your Material to0.
                  5: Profit.

                  Click image for larger version

Name:	Add_Material.png
Views:	1
Size:	317.1 KB
ID:	1120993

                  You should now see the roads and buildings with the correct coloring. Please let me know if you have any other questions or issues.

                  Cheers-

                  Sam

                  Comment


                    #10
                    Originally posted by Sam Deiter View Post
                    You will need to apply the Material via the Blueprint Editor by doing the following.

                    1: Open up the Blueprint (BP).
                    2: Then go to Details -> Rendering and press the small white triangle to expose the advanced section.
                    3: Locate the Override Materials option and press the white plus sign to add a new element to the array.
                    4: Doing this will add a new Material input a that you can then assign your Material to0.
                    5: Profit.

                    [ATTACH=CONFIG]123955[/ATTACH]

                    You should now see the roads and buildings with the correct coloring. Please let me know if you have any other questions or issues.

                    Cheers-

                    Sam
                    Thanks Sam, it works!

                    2 more questions: Adding the material input would apply material to entire mesh. How do i apply a material only to a certain part of the mesh, for example, just the roads?

                    Also, there is an orange color hue to the entire mesh when selected, but even when not selected, the orange color hue still persist. Sometimes it disappears and the buildings would look normal again. But most of the time the orange hue stays, i cannot figure out how to turn it on/off.
                    Last edited by fspar30; 01-06-2017, 12:59 PM.

                    Comment


                      #11
                      Originally posted by fspar30 View Post
                      Thanks Sam, it works!

                      2 more questions: How do i apply a material only to a certain part of the mesh, for example, just the roads?

                      Also, there is an orange color hue to the entire mesh when selected, but even when not selected, the orange color hue still persist. Sometimes it disappears and the buildings would look normal again. But most of the time the orange hue stays, i cannot figure out how to turn it on/off.
                      I do not think that you can because the meshes have no UV Mapping and the color you are seeing is derived from the color stored in the objects vertices. I did not write this so I am only going of what I read in the help file.

                      As for the orange hue, I am not sure what that could be from. Can you post a screen shot of it so I can see what it looks like?

                      Comment


                        #12
                        But looking at the picture on the plugin website:
                        Click image for larger version

Name:	UE4OSMManhattan.png
Views:	1
Size:	679.6 KB
ID:	1121030

                        It seems that roads can be isolated and applied a green material, because only the roads are green in color. The buildings are grey and they seem to have a different material than the roads.

                        As for the orange hue problem, sometimes when i restart unreal the orange hue is gone, like below:
                        Click image for larger version

Name:	greengood.jpg
Views:	1
Size:	278.4 KB
ID:	1121031

                        But most of the time after changing materials or performing other actions, the orange hue remains and just won't go away, like below:
                        Click image for larger version

Name:	orangehue.jpg
Views:	1
Size:	274.8 KB
ID:	1121032

                        Comment


                          #13
                          Are you sure that the green roads in the picture aren't just NavMesh? I may be completely mistaken but I thought when NavMesh is visible, it is green.
                          Marketplace Asset (Released): FPS Battle Royale Template with Gamesparks

                          Twitter: Spyke_Dev | Discord

                          Comment


                            #14
                            Originally posted by ToxinGaming View Post
                            Are you sure that the green roads in the picture aren't just NavMesh? I may be completely mistaken but I thought when NavMesh is visible, it is green.
                            You are right; Nav mesh do show up as green, but it is not a Nav Mesh as this plugin does not have support for Nav Meshes at this time.


                            The green color for the roads is coming from the vertex color that is stored in the Street Map asset. That is why you have to use the Vertex Color node in your Material. If not then you will not be able to see anything. The same goes for the buildings; they get their color from the color that is stored in the vertices of the building meshes. In case you glossed over it or missed it, the help file tells you what is not supported at this time.

                            Generated mesh data is currently very simple and lacks collision information, navigation mesh support and has no texture coordinates. This is just designed to serve as an example. For more rendering flexibility and faster performance, the importer could be changed to generate actual Static Mesh assets for map geometry.

                            Originally posted by fspar30 View Post
                            But looking at the picture on the plugin website:

                            It seems that roads can be isolated and applied a green material because only the roads are green. The buildings are gray, and they appear to have a different material than the roads.
                            At this time you can not issolate the roads like like you want to at this point in time. However using the following Material setup I was able to get the streets of DC to show up green while the buildings show up gray. Try setting your Material up like in the attached image and see if that works for you. As for the orange selection, that looks like it is what happens when you select something inside of a BP. I have not seen that happen on my end, so I do not have a way to fix it at this time. Should I figure something out I will be sure to let you know?

                            Click image for larger version

Name:	SV_00.png
Views:	1
Size:	645.4 KB
ID:	1121034

                            Comment


                              #15
                              Great job Mike, this seems an awesome plugin!

                              Although, as a complete noob with this, im slightly lost.

                              I have got the plugin loaded and can see the StreeMap classes in my content browser, i then imported my osm file.

                              But i'm not sure what i do next, to actually get the map loaded? Apologies if its really obvious!!

                              Comment

                              Working...
                              X