Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Real world Terrain test

Discussion in 'Works In Progress - Archive' started by SpookyCat, Nov 8, 2012.

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Hi All
    Recently I released a non Unity plugin for 3DS Max that allowed the user to generate with a couple of clicks real world terrain meshes for virtually anywhere on the planet using Nasa SRTM DEM data, the plugin would automatically stream the required data from the internet and generate the mesh to the required detail settings, you can see a video of it in use below. As a little break from providing support for MegaFiers and MegaShapes I decided to add a custom exporter from the plugin to a custom file format and do an editor extension in Unity to read those files and generate terrains from them, so just wanted to show the very first test result for that with a model of Pikes Peak that was built with just a couple of clicks in Max and then a few more clicks to load to it into Unity. Some more info on the system can be found on the website at http://www.west-racing.com/mf/?p=3183 and more info on the Terrain plugin at http://www.west-racing.com/mf/?page_id=2979

    Update:
    The plugin has now been written as an extension to Unity so terrains can be modelled directly inside Ubiyt.
    [video=youtube;YyU54RvPfvM]http://www.youtube.com/watch?feature=player_embedded&v=YyU54RvPfvM
    [video=youtube;RTF2y3Zy0Qk]http://www.youtube.com/watch?v=RTF2y3Zy0Qk

    Pikes Peak in Unity (right click to view larger)
    $unityterrain.jpg
    The Plugin in Use
    [video=youtube;72MusxOxFSs]http://www.youtube.com/watch?v=72MusxOxFSs
    Update:
    I have been doing some custom scripts for Unity to make using the data generated by the plugin very easy. It allows easy importing of the elevation data and will apply the texture if you want it to, you can scroll around the data, zoom in and the texture will move correctly etc, you can also change the terrain detail level. If anyone has any suggestions or features please do let me know. A video of the new system is below.
    [video=youtube;Tee4GfziGG4]http://www.youtube.com/watch?v=Tee4GfziGG4

    We have now also added Mars and Moon elevation data.


    Another update, color data added for Mars.

    Color added for Earth Terrains

    Ocean Floor Elevation Data Added
     
    Last edited: Mar 1, 2013
    Flurgle likes this.
  2. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
  3. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    As Robert Plant once said: "-holly f*cking jesus!"
     
  4. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Had another play with the system, grabs below are from one Terrain exported from the plugin.
    $monuval2.jpg $monuval4.jpg $monuval5.jpg $monuval6.jpg
     
    hergo97 likes this.
  5. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Fantastic! Have you plan to port the entire system in Unity?
    Max
     
  6. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Is there any idea on pricing or will it be provided with the max plugin? (It's not too hard to get a terrain from max to unity along with texture thanks to the colormap shader) The max plugin looks frankly brilliant and i'm hugely compelled to buy it, the unity plugin supplied with it would definitely be added incentive although it's not entirely needed apart from sheer speed i suppose. One thing that stops me buying the plugin however is im still trying to figure out how to generate splatmaps quickly from imported terrain, i do have a few ideas but they involve a lot of faffing around, do you have any suggestions? I'm thinking particulary being able to generate them based on elevation and slope angle with requisite falloff and maps to control it. I know dreamscape can do this in Max but it is a bit of a ballache as you have to use their terrain. Another idea is writing a macro to do it in world machine, but something that doesnt involve rendering heightmaps, importing, generating, exporting, and so on would be welcome
     
  7. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
  8. wolfstien786

    wolfstien786

    Joined:
    Apr 12, 2012
    Posts:
    185
    *Drool........ Drool........*
     
  9. fano_linux

    fano_linux

    Joined:
    Jan 1, 2012
    Posts:
    909
    Just can't beleave it.... :eek:
     
  10. roger0

    roger0

    Joined:
    Feb 3, 2012
    Posts:
    1,208
    Looks like a cool plugin. However would you be able to merge terrains seamlessly in a easy way, like have meteor crater right next to mount Rushmore? Also I think the map textures from google earth are blurry when seen up close, so they could not be used for a FPS game. Does the plugin try to get around this, such as using the google earth textures as a splatmap to place multiple ground textures?
     
  11. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Anything used as a 'colormap' for a terrain looks blurry up close, the texture's mainly relevant if you'll actually be able to see it (distant terrain or from above etc), the splatmap generation is the main issue for me basically, no idea how you might generate a splatmap from the google earth images (maybe averaging out a colour per area and assigning the closest matching texture, not sure, this method wouldnt be that great with only a handful of textures to choose from, but again not sure). Would be interesting seeing a solution as the idea's otherwise great. Also i dont think i'm interested in merging terrains from entirely different areas together but generating tiles of terrains automatically with matching textures would be amazing. In realtime? Hell yes.
     
  12. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    When I was doing it I was thinking that it really isn't much use to the normal FPS game but could be useful for C&C or defense type game I guess. If a little extra work is put in tileable terrains could be exported with multiple high res textures but not sure if there is any kind of demand for that, this really was just an afternoons playing around to see what it would look like, and as has been pointed out getting elevation data into Unity is quite simple, the plugin just makes it easier to generate real world elevation data and add a texture if needed.

    Merging of terrains is an interesting idea and that could be done with a little extra work. And again with some extra work some kind of texture color lookup to vegetation scattering and different splat maps could be added, though there are some nice shaders in the Asset store I noticed that can do a lot of that anyway.

    The Unity scripts if there is demand for it will most likely be included in the terrain plugin, the Plugin could be made a Unity plugin as all the code is in C++ so it could be ported quite easily as a C++ plugin for the editor but it would be PC only to start with.
     
  13. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    All of those musings sound great to me, i cant see there not being a demand for it to be honest - Theres some project/asset (TerraUnity?) ongoing with something similar to this but i think the context is different so no real competing i dont think - I'd certainly see the unity plugin as huge incentive for the terrain max plugin, especially if ongoing support could mean splatmap generation of some kind (That said, could you tell me the assets that can do this generation?). As you've maybe noticed from the response, people are interested, i'm just wondering how you'd go about distributing. If you did a Unity specific plugin i'd probably choose that over the max one, with some of the options you contemplated - splatmap generation and making multiple terrains, if you arranged some pricing where i could get both reasonably then i would try to save my pennies for it,definitely. I daresay if you just bundled it all together you'd have a big seller on your hands. Ive seen people already having a little squee at your max plugin on other forums. Tie unity and max together and get the most from the unity integration and i think you have my money, should i have it in the bank.
     
  14. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I have been doing some custom scripts for Unity to make using the data generated by the plugin very easy. It allows easy importing of the elevation data and will apply the texture if you want it to, you can scroll around the data, zoom in and the texture will move correctly etc, you can also change the terrain detail level. If anyone has any suggestions or features please do let me know. A video of the new system is below.
    [video=youtube;Tee4GfziGG4]http://www.youtube.com/watch?v=Tee4GfziGG4
     
    Last edited: Mar 1, 2013
  15. Jum

    Jum

    Joined:
    Aug 20, 2011
    Posts:
    63
    Does it support Multiple terrains? also does it work with Lars terrain shader? or is there any alternative solution for this?
     
  16. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    As the system just generates Unity terrains it will certainly work with Lars terrain shader and any other terrain systems out there. You can easily generate multiple terrains for example if you wanted to make 2x2 terrains from the data you would just set the zoom value to 0.5 and then adjust the offsets, then make a copy of the terrain object, move to the next offset make a copy etc, if that is a desired feature I can easily add an option to allow automatic generation of terrain tiles from the data.
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    This looks really great. And about as easy to setup as could be expected! :) One thing that was unclear to me is whether the Max plugin imports terrain data automatically, or do you have to have your own specific source for that data?
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    If you check out the other videos you will see that the plugin will automatically stream the DEM data from the internet to build your terrain and will automatically generate the texture to any res for you.
     
  19. roger0

    roger0

    Joined:
    Feb 3, 2012
    Posts:
    1,208
    How large of terrains can you grab? Could you get a terrain of say..... the size of california?
     
  20. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    In theory yes, the only limiting factor would be your system memory and the vertex count you wanted to use for the mesh.
     
  21. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    I would really like to be able to automatically generate terrain tiles for fast and easy creation of big areas.

    Having this plugin directly in unity would be great! will save even more time :)
     
  22. hellraizerhhh

    hellraizerhhh

    Joined:
    May 26, 2010
    Posts:
    619
    This is absolutely sick! So much potential for this. Where do these textures come from? They all look really darn good even when you zoomed in
     
  23. 8 Bit Warlock

    8 Bit Warlock

    Joined:
    Nov 19, 2012
    Posts:
    30
    Very cool!
     
  24. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    Do you download this data on demand or have you rehosted the entire set somewhere?
     
  25. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @hellraizerhhh - The textures are generated by the max plugin via a link to Google Earth.

    @holyjewsus - The max plugin figures out what DEM data is required and will check the local cache, if it doesn't find it then the required data is automatically streamed from the USGS data surface, this allows the user to scroll around the world and model any point without having to manually track down the data and stitch it together. We are looking at also hosting the data on or own servers.
     
  26. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Maya plugin! NAW!! ;)
     
  27. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    If only I could afford to buy Maya as well as Max, I have used Max or 3ds from its very first release so I do tend to focus on that, if the main plugin does well then I will splurge on a copy of Maya and do a port it would not take long as the 3ds max API calls are virtually nill so it would go across easily.
     
  28. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Another vote for a Maya port :) When will this be released?
     
  29. portgalaxy

    portgalaxy

    Joined:
    Dec 9, 2011
    Posts:
    55
    any idea on when this will be for sale? Really want to use this.
     
  30. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Well the Max plugin is already for sale on our website, the Unity scripts will come as part of that in the next update, and the Asset Store version is ready to go it is waiting on some artwork, so very soon now.
     
  31. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    A little confused, do I have to buy the Max plugin to get the Unity scripts? Or will the Unity scripts be released as a separate asset since you mention it will load terragen files?
     
  32. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    The Unity scripts will be included in the next update of the Max plugin, but they will also be on the Asset Store and our website for use with Terragen files.
     
  33. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    We have just released the 3ds max 2013 version of the terrain plugin and included in the full version are the Unity scripts that allow the generated terrain to be imported in Unity along with the texture as well as allowing the importing of Terragen files. More info can be found at out website http://www.west-racing.com/mf
     
  34. Alex_V

    Alex_V

    Joined:
    Jun 25, 2012
    Posts:
    53
    Bloody awesome!
    I was particularly happy to see the Brands Hatch video :)
     
  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Well helping with track modelling was the original reason the plugin was developed so made sense to use that as a subject :)
     
  36. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Any thing you can tell me about my requests above?
    Will you have tiles support?
    Will you make a Unity plugin?
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I am sorry dorpeleg I missed your post. The system could be made into a Unity plugin the only thing in the way really is finding the time to port the code from the C++ to C#, there is quite a lot of code in the plugin so I will need to know that there is a real need for it in Unity as opposed to just being a Max only plugin.
    The terrains generated by the Unity scripts are normal terrains so you can use any of the existing terrain shaders and utils on them to split them up etc, I have not played with tiling terrains yet but it would not be hard to adapt the export from the max plugin to allow for terrain tiling and add the the extra code to the scripts, I will certainly look at doing that.
    We do hope to have the Terrain scripts only available on the asset store soon so even if you do not have the plugin for Max you can make use of Terragen files.
     
  38. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    I would really appreciate a unity plugin since I don't have max installed.
    Tiling will also be great for easy creating of large areas (like whole country) and having the option to load/unload areas that are not currently in use.
     
  39. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Cool tech as always Spooky. Makes me want to make a FPS real-world shooter :)
     
  40. Alex_V

    Alex_V

    Joined:
    Jun 25, 2012
    Posts:
    53
    Indeed :)
    Just to be clear, it does not use the elevation data from Google Earth, right? And also, is there a website where we can preview DEM data for specific regions of the world? I know USA is pretty much covered, but i'm looking for a few regions in Portugal and central Europe (racetrack locations).
     
  41. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Google Earth is not used for the elevation data, that comes from the NASA SRTM DEM dataset, a coverage map can be found on the Terrain page of the website http://www.west-racing.com/mf/?page_id=2979 and certainly covers all central Europe, the resolution of the elevation data in Europe is 90m spot hieghts in the US you have the option for 90m or 30m. We are hoping to add more data sources in the future. You can access the DEM data at http://earthexplorer.usgs.gov/ but you will need some kind of viewer of DEM files you can find some at http://tahoe.usgs.gov/viewers.html

    Which tracks are you looking to model?
     
  42. Alex_V

    Alex_V

    Joined:
    Jun 25, 2012
    Posts:
    53
    Thanks for those links! I was only able to get data from GTOPO30 which is very low resolution, but i got the picture.
    I'm looking for a bunch of Rallycross tracks. I'll PM you since you don't want to hijack your thread ;)
     
  43. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Yeah GTOPO30 is very low resolution as it is 30arc seconds compared to the 3 arcsecs for the SRTM DEM data and 1 arcsec for the US coverage, so roughly 10 and 30 times lower res than the data the terrain plugin uses. If you let me know a location I can do a quick render of the area to show the detail.
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Couldn't find your email address to mail direct so put the quick renders of the area up here for you to look at, the plugin is really meant for modelling slightly larger areas but still it gives the lay of the land and the texture feature does help modelling a lot.
    $motox1.jpg $motox.jpg $motox2.jpg
     
  45. Alex_V

    Alex_V

    Joined:
    Jun 25, 2012
    Posts:
    53
    Oh sorry, completely forgot to add it!

    Thanks for the renders! Indeed it really helps with the track creation and scenery. You just got yourself a future buyer. :)
     
  46. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just a note to say you dont have to just have satellite imagery you can make use of the power of Google Earth and its layers and the massive amount of interesting overlays you can find on the web, for example we had a request from a Tourism company who want to model locations but show different data so a quick 5 minutes and the the plugin did just what they needed, examples below.
    $scottest1.jpg $scottest2.jpg $scottest4.jpg
     
  47. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    Wow, very useful, I would really like to see some kind of example video that shows how you do that.
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Well it is shown in the videos in the first post, the crater one for example, all you need to do is find your overlay sources.
     
  49. dorpeleg

    dorpeleg

    Joined:
    Aug 20, 2011
    Posts:
    250
    could you give an example for sources you know?
    never really triad changing google earth's display.
     
  50. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748