Search Unity

TerraLand 2 – High Quality Photo-Realistic Terrains from Real-World GIS Data

Discussion in 'Assets and Asset Store' started by TerraUnity, Jan 5, 2016.

  1. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @KevinCain You are welcome ;)

    All mapping applications use square tiling for their mosaic manipulations, that is because this is the best way to define areas and use/delete needed tiles in the area. As we define area of interest by giving Top, Left, Bottom & Right coordinates, any offsetting in these coords in order to define rotation will lead to stretching and resampling of the original data output from server. Because the nature of satellite imagery and also heightmap capturing systems are based on square tiles. In addition giving rotation features in Area Selection for your purpose is an overdue of the whole system and something very customized which is not needed so much to be considered as a general purpose implementation.


    The reason that you won't find any references regarding your question is that the final performance on your system is based on many many factors. Talking about terrains, just to name a few of these factors are:
    • terrain tiles count - each tile will have its own drawcall(s)
    • heightmap resolution
    • pixel error quality (LOD & Tessellation factor of terrain surface) - edgier surfaces are harder to render on GPU
    • texture count painted on terrain(s)
    • textures resolutions
    • textures compression and importer settings
    • shader complexity and features (calculations accuracy, PBR, DX11 features, procedural texturing, POM)
    • does terrain shader have different map types (e.g. normalmap) in it?
    • rendering parameters to define dynamic detail and resolution in different distances
    • do terrains have tree or grass in them?
    • tree and grass density and their animations if available
    • lightmapping & light probes
    • reflection probes
    • shadow casting - if enabled, engine's defined shadow distance & resolution on terrains

    And guess what! These are only some of the upfront factors on top of my head only for terrains regardless of the other assets siting in your scene or current machine configuration the game is running. Maybe I'll add more items in the list if I get back to this post again :)

    And please note that, before rendering heightmap-based terrains, the CPU needs to loop through the 2D array of data in its heightmap to extract heights from it, calculate LOD & Tessellation based on camera distance all in realtime and finally pass it to the GPU to render. Also CPU needs to do realtime physics calculations on millions of generated polygons on terrain surface.

    So terrains are mostly CPU intensive than GPU at first, and then of course if the terrain shader is getting more complex, the GPU rendering will also be close to its bottleneck.

    So the word "large" in your question is too general and can't get its exact answer. If this question was asked in stackoverflow it will definitely get a "too-broad" tag :D

    As I cannot give any exact directions to the question, the best option is to do error and trials for such purposes and do your own benchmarks in different terrain settings, so that you may find some pre-calculations for your target platform.
     
  2. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Having worked a bit with TerraLand, a new quick question follows, with a few notes on the above discussion after.

    How can I place objects by lat/long position so they match TerraLand's generated terrain? I have a sequence of lat/long points that I'd like to plot in their correct places in relation to the TerraLand mesh.

    I have set the bounding box in TerraLand by lat/long, but the world space in Unity doesn't have a simple scaling relationship to the lat/long bounding box. Is there a scaling factor with a transform offset? What is the easiest way to convert between lat/long and a TerraLand terrain's Unity coordinates?

    ---

    Back to the above, thanks for your responses. Naturally I understand that terrain rendering varies -- and that's actually my question. The answer "do error and trials" can be given for any question -- now that's what I call 'too broad'. ;-)

    What I was looking for, and haven't got, are some concrete benchmarks from users' actual experiences. For instance:

    "A scene with (64) 4K tiles, each with 4K textures but no trees/grass, that runs on an i7 CPU with X GPU, Y RAM", et cetera. In that way we new users would have a general idea of what people can accomplish on various systems.

    You get the idea; not an exhaustive list but a few references so that each user doesn't have to start from scratch with "trial and error". I have no idea whether most users are working with (4) textures or 400. I'm sure it would be helpful to users to know what kinds of things are possible going in, in the way you show streaming terrains.

    You wrote "giving rotation features in Area Selection for your purpose is an overdue of the whole system"; I don't know what you mean to say, it sounds like you consider it an overdue (but minor) feature?

    Thanks again!
     
    Last edited: Nov 14, 2017
  3. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    To plot lat/long points on the terrains TerraLand generates, I could compute angular coordinates if there was a way to determine the total sphere diameter that the TerraLand terrain lies on.

    It looks like TerraLand sets 1m = 1 Unity grid unit, so I could convert the earth's diameter that way (idealized as a sphere that's ‎6.3781×10^6 m).

    However, since TerraLand seems to center the terrains it creates at the origin (can you confirm that?), I'd also need to know how to factor that as an arbitrary offset from the true 'world space' position returned my computing angular coordinates as above.

    If a helper function for coordinating TerraLand terrains to lat/long points already exists I'd prefer not to reinvent the wheel...

    Has anyone done something like this?
     
    Last edited: Nov 14, 2017
  4. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    This post is exactly what you are looking for:
    https://forum.unity.com/threads/ter...eal-world-gis-data.377858/page-6#post-3084315

    Download the provided sample package in this post and check it for yourself:
    terraunity.com/freedownload/TerraLand_LatLon2UnityWorldSpace.unitypackage


    trial and error is general by its nature and works in every case ;) I didn't see any benchmarks specifically for Unity terrains but I think there are more general experiments out there shared. But believe me, the best thing you can do is to play with the settings and have your own tests. As you mentioned 64 tiles each 4K I can see that a bit of general knowledge about performance is needed here. A scene with 64 terrain tiles each with 4k res heightmap ends up with 32768 pixels of heightmap resolution for the whole surface which may bring NASA computers on their knees for real-time rendering :)

    Just to give you an idea, there is a maximum limit of 4k resolution in heightmaps for your terrains in Unity, however with TerraLand you can go beyond and set 8192 pixels for heightmaps in terrains. Also you can have multiple tiles each with 4k or 8k resolution in the scene but in our practices we found that the best is to limit the resolution of whole surface equal or below the 4k in total split in 4x4 (16) or 8x8 (64) terrain chunks.

    But again, if there are any benchmark reports the way you requested we will all benefit form that and gives many users general ideas regarding performance.

    Also, there is a good way of measuring performance and quality for terrains as you hinted; just go and download our WorldExplorer from here for free:
    http://terraunity.com/worldexplorer/

    In the main settings of the menu, change the sliders and values on each run and submit the results. The number of total terrain tiles and elevation/imagery resolution settings in there are put in a practical manner for a reasonable FPS in gameplay, so you can simply start with minimum settings all the way up to the max values to see which suits best for you.

    About the rotation feature selection, I made a typo in writing "overdue" instead of "overdo" :D so that explains everything.
     
  5. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Just as the above post, look here for the solution without needing to reinvent the wheel:
    https://forum.unity.com/threads/ter...eal-world-gis-data.377858/page-6#post-3084315
     
  6. ONeills_Bude

    ONeills_Bude

    Joined:
    Dec 25, 2016
    Posts:
    1
    I can not get it to work.

    1)
    I imported the TerraLand 2.1 from Asset Store and than i imported the TerraLand-2.1.2 Update from http://terraunity.com/my-account/ and I still get the errors.

    2)
    I imported TerraLand-RuntimeAPI_v1.0 from and than TerraLand-2 and the TerraLand-2.1.2 Update from http://terraunity.com/my-account/ and I still get the errors.

    i have Unity 5.6.0f3 and 2017.2.0f3 and the TerraLand does not work.

    Do you have a CLEAR Tutorial how to install a working TerraLand on 5.6 or 2017 without any errors?

    The last error is the
    ArgumentNullException: Argument cannot be null.
    Parameter name: obj

    and is counting.
    With the 2.1.2 update and 5.6 or 2017
     
    Last edited: Nov 15, 2017
  7. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Thanks, @TerraUnity,

    My question was about plotting (many) points, while the link you gave was for positioning a single gameObject -- but I get the idea!

    I adapted your approach to read and write an ASCII file with many points, then plot them with spheres; it's attached in the hope someone finds it useful.

    Your approach, which I copied, assumes monotonic lat and long increments and a flat earth; so unless I'm missing something: it would fall out of register over very large regions since the lat coverage for one minute shifts away from the equator, and over long distances the curvature of the earth becomes important.
     

    Attached Files:

    TerraUnity likes this.
  8. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Just use the TerraLand-2.1.2 package from our website's account in a fresh empty project. This is a complete package and not an update patch so you don't need to have the AssetStore version at all.

    The current version of Runtime API package will not work in Unity 5.6 and later.

    However, we have just updated all TerraLand components and demos including the Runtime API in a single universal package which is compatible with Unity 5.4 & later up to the latest 2017 version. The package has been submitted on AssetStore last night and is under review by UAS; refer to the next post for more info on the recent update.
     
  9. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    We have just updated TerraLand core plugin, Runtime API and Tournament packages and submission for the AssetStore was made last night and it is under review for approval.

    The new updated packages in your account on our website will be updated in a few hours.

    Here are the changes and improvements made for this major update:

    TerraLand 2.2
    • Unity 2017.x & 5.6.x compatibility in a universal package
    • Initial TerraLand Runtime version included
    • Updated WorldExplorer demo for Runtime features
    • All reported bugs in the Runtime API has been addressed and resolved
    • No misaligned tiles anymore
    • No stitching problems
    • Faster data feed into terrains
    • Updated Tournament scene with minor improvements
    • Arbitrary coordinates insertion in COORDINATES tab of the "Area Size" section in TerraLand Downloader now works properly. Reference
    • Removed automatic config files placement on system due to issues on Macs and systems with unauthorized file permissions. When you press accept in project launcher window, a ReadMe file will be opened to setup TerraLand's Downloader manually through instrcutions
    • Lots of minor bug fixes in TerraLand core plugin
     
    antoripa and Bartolomeus755 like this.
  10. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729

    You are welcome @KevinCain thanks for sharing the implementation.

    I guess the projection of ESRI's returned data files are based on a flat surface and not a spherical one so you won't face the mentioned issue. But that's still a guess and will investigate more on this subject. However in most cases the working area is not that big so the curvature is nonexistent! Will share the exact projection parameters when I have more info.

    Using our previously provided formula, did you encounter inaccuracies and errors for very large areas which there is curvature close to equators on Earth's surface?!
     
  11. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    To your question, @TerraUnity, I haven't yet needed a large area, but since your approach assumes that each unit (one minute, for instance) of lat and long is equal, it will break down over areas large enough to see that isn't true.

    For now though, let me be clear that the precision is good for my small scenes, covering ~40km^2,

    Thanks again!
     
  12. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,158
    @TerraUnity , On my account latest is still ver. 2.1.2
     
  13. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Since the formula takes linear values of Top, Left, Bottom & Right coordinates of the area and then translates the World Space position of a desired point within the coordinates' range, it is always precise and accurate. No matter how large the area is or close to the poles or not, the returned terrain surface from TerraLand is a flat square/rectangle surface with exact boundaries. Check it with a large area close to the poles and see the results.
     
  14. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @antoripa

    The latest 2.2 packages are now live in your account on our website.


    TerraLand – TerraLand 2.2 Full contains the core plugin, Runtime API (includes WorldExplorer demo) and the Tournament project.

    TerraLand – TerraLand 2.2 Core is the editor plugin of TerraLand containing the "Downlaoder", "Terrain" & "MapsMaker" components

    TerraLand – TerraLand 2.2 Runtime package contains the WorldExplorer demo source which uses TerraLand's Runtime API to experience dynamic streaming of ESRI's elevation and imagery data in a 3D environment.

    TerraLand – TerraLand 2.2 Tournament is the Tournament project source codes with updated scripts.


    All packages are universal packs to support Unity 5.4 up to the latest 2017 versions.
     
    antoripa likes this.
  15. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,158
    yeah .thanks a lot ..
     
    TerraUnity likes this.
  16. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    TerraWorld is under its vast development stages to be released in mid 2018. Among many never-seen-before features, tessellated terrains will play a big role in the visuals of generated environments in the TerraWorld's ecosystem.

    The tessellation usually used for high frequency details on small surfaces (e.g. pebbles) but in TerraWorld they can be as big as boulders and large areas of terrain surface.

    But as you know tessellated terrains and meshes only run on GPU just for the sake of more detailed visuals, thus generated displaced vertices won't contribute to the PhysX which is CPU based. Here is our solution for dynamic realtime DX11 tessellation physics for the generated environment around the player:



    With this system in place, any physics related objects in the scene will react to the tessellated surfaces and they won't fall through these elements.
     
    Last edited: May 26, 2018
    Aubrey-Falconer and antoripa like this.
  17. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Version 2.2 is now live on AssetStore: https://www.assetstore.unity3d.com/...=package_updated#!/content/8306/release-notes

    TerraLand is also selected to be featured in UAS's Mega Sale starting from November 27th to December 8th for 30% off.

    This is the first time ever that TerraLand is on sale, so don't miss this opportunity and grab the discounted package on the sales arrival. With 2.2 being released recently, TerraLand was never such feature-rich and exciting for your projects.


    Here are some upcoming features planned for the next release:

    Runtime API has been already improved significantly since 2.2 to perform heights generation & stitching operations smoothly on bigger heightmap resolutions (2048 & 4096) for the area as queuing is improved and there are less lags and hiccups working with these large chunks of data. Wish that terraindata.SetHeights operation in Unity's terrain system was thread-safe since 2011.

    We are adding a new long-awaited feature which you are all going to love that. Offline data loading and Cache.

    With Caching feature in TerraLand Runtime, you can save elevation/imagery as you go, so the next time you enter the same location, existing data in the cache will be loaded offline from your hard drive and the remained areas will be downloaded from online ESRI servers. This feature does not only remove the need for internet in pre-downloaded areas and makes the generation time faster in a lower bandwidth file transferring, but the cached data can be saved after being processed in runtime; the main processes on data are smoothing and stitching which change heightmap data during runtime and later the Shadow Removal option on the obtained satellite images. So that also saves a lot of processing power in runtime while loading data from cache.

    A more exciting feature willing to be added into the core editor plugin is the ability to select very large areas which TerraLand will consequently collect very high resolution elevation/imagery data files and save it in a local geo-server in order to be used later by the Runtime API and stream data from that local server. The defined area can be from hundreds to thousands of kilometers to cover a whole city or possibly a country area so that TerraLand collects elevation/imagery data from the specified area in chunks and save them for later streaming.

    No need to mention that by having the Offline Data Loading feature in Runtime API, you are not limited to only obtained data by the TerraLand's editor plugin or previously cached data in Runtime, but you can setup your own local geo-server containing your own custom elevation/imagery data and let the Runtime API dynamically stream that data for you during the runtime gameplay.

    More info will be released as we pass some major development stages but your suggestions are always welcomed and we also do reply to any questions regarding these new features.​
     
    Last edited: Nov 21, 2017
  18. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Only 2 days left for arrival of the AssetStore's Mega Sale program; TerraLand 2.2 will be off for 30% from November 27th to December 8th.

    Get the discounted package on arrival from HERE & other packages from HERE.
     
  19. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,332
    Your website still doesn't work from Vietnam as it gives a timeout.
     
  20. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @Elecman Seems like there was a universal server issue for all the users trying to open our website! It is resolved now but let me know if you still experience old problem of Vietnamese IPs! :) Have already reported the issue to the hosting team but as I couldn't reproduce the issue from our IPs I'm not sure if it is resolved or not!
     
  21. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Just another tease guys, we are on the 1st day of AssetStore's Mega Sale program. TerraLand is off for 30% so you can grab it for $41.30 instead of $59 if you haven't already ;)


     
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,332
    Same problem:
     
  23. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Through our conversation with the hosting provider, they have stated that IP ranges of China & Vietnam are blocked on our servers due to a lot of cyber-attacks and hacking stuff! Because these countries are hotspots of these activities. In which we were completely clueless about this behavior!

    This sounded too stupid for us which kept us arguing about the matter as we stated that this is not a professional action from you and will greatly affect our business, not to mention that it considers very rude from us against our potential customers from these countries.

    Just some hours ago they have informed us that they have lifted up the limits on these IP ranges and people from those countries are fine to navigate through our website.

    We are so sorry for any inconvenience caused by this behavior in the past, but what is more important to us is you as respective owners of our products.

    @Elecman Please double check to see if it's resolved now ;)
     
  24. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,332
    Thanks, it works now.

    It is really incredible how ignorant a hosting provider can be. Just because they don't want to deal with security, they effectively block out a large pool of potential customers. There are 1.4 billion people in China, and 93 million people in Vietnam. And not even telling you about the blockage when you inquired. Incredible, really incredible. I would find another provider and name and shame the old one.
     
    TerraUnity likes this.
  25. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Happy to hear that finally.

    That's exactly the statement I was referring to during our conversation with them and we felt the same as you did. As stated with China having 1.4 billion of population to cover around 20% of the whole Earth population actively working on IT projects, what you did secretly is absolutely total ignorance and we do not care about your weakness and lack of knowledge regarding security affairs as a hosting provider. BTW, they had no idea what our website is about and these are such companies who doesn't care about the audience.

    Our contract with this company is going to be ended soon so will immediately change the provider on that time.
     
    Elecman likes this.
  26. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    66
    Hey @TerraUnity

    We just purchased TerraTrees and are trying to use it in Unity 2017, but receiving the following errors:

     
  27. crimsonmortis

    crimsonmortis

    Joined:
    Feb 21, 2016
    Posts:
    60
    Was looking for information about run time deformation (digging, mining, and building). I am still new to unity so I have been using a voxel engine to allow me to do this. I am ideally looking for support for this that is multiplayer (dedicated master server/client) friendly.

    I will say I am very impressed by what I have seen so far and if this can handle run time/player modification it will be a must have addition to my tool box of assets.
     
  28. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @tgaldi Please refer to this post: https://forum.unity.com/threads/30-...eal-world-gis-data.377858/page-5#post-2863602

    We have already announced several times that TerraTrees & TerraCity have been updated internally with new improvements compatible with latest Unity versions but didn't release publicly. That's because we are making a transition from Terra +3 into a new product soon. Latest TerraTrees & TerraCity products are reserved for the upcoming suite.

    Current Terra +3 costumers will make a free transition to the new product and TerraLand users will get a discount for that. As you are a TerraTrees owner and the package may be unusable for current projects, you can contact us so that we can book you for new product arrival and TerraTrees update so that you can get the latest packages on arrival. I think you already own TerraLand too, so we can setup a free transition to the new upcoming product.
     
  29. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    66
    @TerraUnity Oh great! Yes we already own TerraLand and are looking to purchase TerraCity once it supports georeferenced buildings. Any ETA on Terra3's release?

    Thanks.

    Edit:
    We've also purchased CTS (Complete Terrain Shader). Have you experimented with integration with it? We want to use it to add detail texture blending based on the user/camera's distance from the terrain ( area around user has high detail blended in ).
     
    Last edited: Dec 6, 2017
    TerraUnity likes this.
  30. TOES

    TOES

    Joined:
    Jun 23, 2017
    Posts:
    36
    I get an error when running the World Explorer Main Menu scene and trying to play a location:

    MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage'.
    MovementEffects.Timing.#8p (IEnumerator`1 #Pf, Segment #9i, System.String #Cf, MovementEffects.CoroutineHandle #Kf)

    Stops on everything downloaded 100 %
     
  31. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    35
    @TerraUnity Does TerraLand 2.2 work with Unity 2017's .NET 4.6 scripting runtime?
     
  32. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    First of all thanks for the kind words and sorry for the delay in reply. Runtime Terrain Deformation & Modification whether caused by explosions or player/vehicle interactions with the surface has been already implemented in our development, but these features will be available in our upcoming product which is under development and will be released soon. TerraLand will stay with its core features for GIS terrain generation and also be included in the new product.

    So stay tuned to get the latest announcements on the new product.

    The main issue with terrain manipulation in Unity which causes runtime modifications laggy and impractical is the SetHeights function in terraindata as already stated which will freeze the app on main thread for some time and is not thread-safe. Wish Unity team consider this factor so that we can all experience smooth terrain modifications at runtime.
     
  33. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    In this case, just drop us an email so that we can book you in our list as a Terra +3 user in order to make a free transition. Once you have this new product you already have updated TerraLand, TerraTrees & TerraCity included in that package plus many other new components and yes, the TerraCity will bring geo-referenced buildings into the game.

    I do not own this package, but please note that the upcoming product will include TerraEnhancer and many other shading/rendering assets for realistic rendering of terrain and environment elements in itself so what you are after as distance blending and detail textures are already there as a small part of the many features in our custom shaders. Some old screenshots has been already leaked here in this thread but more info will be there while we are close to the initial version or maybe a Beta release.
     
    John-G likes this.
  34. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    It's weird because Texture2D.LoadImage is an internal function in Unity API and I thought maybe your Unity installation is corrupt until I find these similar issues:

    https://forum.unity.com/threads/unityengine-texture2d-loadimage-is-missing.467202/

    So this post suggests reimporting the dll plugins and let the Unity API Updater does its job:
    https://forum.unity.com/threads/unityengine-texture2d-loadimage-is-missing.467202/#post-3054402


    Also as the LoadImage raised up here, just wanted to make another wish similar to SetHeights that it would be awesome to have these functions asynchronous and thread-safe:
    https://feedback.unity3d.com/suggestions/async-texture2d-dot-loadimage-and-other-texture-operations

    We use LoadImage in TerraLand Runtime to texture generated terrains at runtime and resolutions higher than 1024 will make huge spikes in our tests. Also would be great to access the LoadImage function source so that we can manually set queues in there through coroutines.
     
  35. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Theoretically yes, why wouldn't it work if it is compatible with older versions!

    But there are some code snippets in all scripts in TerraLand including the TerraLandSettings.cs script as the project launcher which revert the runtime API version to 2.0 in OnEnable function so whenever you change it in editor's Player settings, they will revert it back to 2.0 and this causes a loop in re-setting.

    Also we have found a weird bug/change in 4.6 which does not delete temp satellite images when needed and causes an unwanted loop of errors.

    So we will remove the code snippets from all scripts so that the scripting runtime version will be set from only one place by users and also will investigate the previously mentioned issue to finally release a bug-free version of TerraLand in .NET 4.6.
     
  36. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    How could I modify the code to cut of ocean areas? Since the downloaded data doesn't feature bathymetry which I have to add it manualy after generating it separatedly using global mapper and unity terrain generation. Don't know if Terraland feature a terrain blend tool, which - I guess - would fix my workflow.

    Right now I'm using Autodesk Infraworks, but Terraland seems to provide a more straightforward approach.
     
  37. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    TerraLand generate terrains on top of Unity's built-in terrain shader system and does not touch the stock shader code. In order to cut holes in the terrain, we need to modify terrain shader to whether accept transparency or move vertices to somewhere else (self-invented :D) or go the CPU way and modify terrain heights through its heightmap. However in both shader techniques the problem is that terrain collision is still there on modified areas as we only changed rendering through the GPU and this leads to another factor to be cared of (Switching terrain collider on/off whenever we are on transparent areas or not) if necessary; while changing the heightmap removes this limitation and collision follows generated surface.

    As the topic is in a high demand so searching for such implementation on the 1st method will bring many results such as the following ones:

    http://wiki.unity3d.com/index.php/TerrainTransparency
    https://assetstore.unity.com/packages/tools/terrain/terrain-hole-system-8277
    https://answers.unity.com/questions/730380/how-can-i-make-a-hole-in-the-terrain.html
    https://answers.unity.com/questions/704763/does-anyone-know-how-to-implement-these-depth-mask.html
    http://www.blog.radiator.debacle.us/2012/08/how-to-dig-holes-in-unity3d-terrains.html

    If you are interested on how to move terrain vertices way down below so that bathy terrain is on top on those areas, let me know and I'll share the shader code snippet to get going. But note that this is a quick hack of terrain rendering and is more limited than doing the transparency painting on desired areas.

    Regarding modifying heightmap to suit your needs, it would be an easy process too, so first choose which method is enough for you and then give it a try.

    P.S. never heard of Infraworks before, although it's cool but at the end of the day you are not in a game engine and that's what matters.
     
  38. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
  39. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    We are about to release the Offline Streaming feature in TerraLand and the development is mostly done so I think the release will be made in a few days from now.

    Please note that this feature is the last one for now regarding TerraLand; this is due to focusing on our upcoming product which TerraLand is a part of it and secondly marketing failure in comparison to other assets while TerraLand offers way more features but we feel the community is not loyal to all this.


    Following is just a heads up for the latest feature:

    The steps to create a geo-server in TerraLand Downloader is so simple. This server is used for later streaming by Runtime API.

    As before, you define an area in TerraLand Downloader but this time the area can cover a very large region such as a city or a country or possibly the whole Earth, because all needed tiles of obtaining elevation & imagery will be downloaded and saved on your hard drive with desired resolution.

    A section is added to the Downloader component which is specialized for Local Server generating which defines number of total tiles for specified region and each elevation/image tile's resolution.

    The generated geo-server has a very simple structure which contains a "Elevation" folder including heightmap tiles and a folder titled "Imagery" including image tiles.

    The Offline Runtime API connects to this local server and loads and applies needed data on terrains around the player in the scene dynamically as he travels. So users experience a seamless streaming of data and terrain generation just as our previous demo of WorldExplorer but this time without needing an internet connection and in a more managed system.

    Regarding streaming of geo-referenced buildings and vegetation, these features will be a part of our upcoming product which is under development.
     
  40. tgaldi

    tgaldi

    Joined:
    Oct 28, 2015
    Posts:
    66
    Hey @TerraUnity, has the offline streaming been released?
     
  41. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Hey @tgaldi we are about to release it in the following days. The implementation runs pretty smooth and optimized in our tests as the system has a lot of improvements and bug fixes now.

    A sample demo build will be available today in a few hours and will be announced here.
     
    tgaldi and antoripa like this.
  42. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    This time it was a big delay in what I said, but hopefully we are there.

    Download the first demo of our TerraLand Offline Streaming feature from here:
    terraunity.com/freedownload/TerraLand_OfflineStreaming.zip


    TerraLandOfflineStreaming_GrandCanyon.jpg

    Controls:

    Navigation: Arrow Keys/WASD
    Move Up: "E"/Mouse Left Click
    Move Down: "Q"/Mouse Right Click
    Shift: Increase Speed
    Alt: Decrease Speed

    All movements are 3D Mouse simulated.
     
    Last edited: Feb 7, 2018
    Funkeys likes this.
  43. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Ok for the ones who want to try the Offline Streaming demo with their own provided data tiles, it is needed to give some insights about how to set it up and how it works.


    Setup

    Simply put the generated geo-server containing elevation & imagery tiles in the root folder of the build. In order to detect the server path, the local server's folder name always has to be exactly the same as defined in the "RuntimeOffline" script in the scene and "Project Root Path" checkbox must be selected so that TerraLand can detect the data source.

    You can have as many folders as servers in the build's root directory but TerraLand picks up the one with the name defined in the "RuntimeOffline" script in the scene.




    Sever Structure

    The structure of the local server is so simple. It contains 3 main folders of Elevation, Imagery & Info. These sub-folders also need to have the same name as original and any attempts to rename these folders will break the operation.

    Obviously the Elevation folder contains downloaded and generated heightmap tiles and the Imagery folder contains downloaded satellite images as terrain textures.

    As all the information for setting up the server is exposed here and it's configurable from outside TerraLand, you can simply generate your own datasets and geo-servers from your own custom elevation/imagery data files created in any external GIS programs. Currently the heightmap format is limited to .raw files and image format is limited to .jpg.



    How It Works

    TerraLand's Offline Streaming feature is a real-time dynamic system which streams elevation/imagery data on demand. So as the player travels around the world, the system updates surrounding terrains and feed needed tiles from the assigned server and converts them to Unity terrain assets.

    In the provided demo from the previous post, the whole world area which is downloaded and cached is 40km x40km spread into a grid of 32x32 which is total of 1024 data tiles. The active see-able area around player is set to be a grid of 8x8 (64 tiles) which are updating whenever needed. So imagine the active area as a small square which is in another bigger square as the world which the smaller square updates its position in world's bounds.

    As the whole world size is 40km x 40km so the active area will be 10km x 10km (32 / 8 = 4 ===> 40 / 4 = 10).

    Each heightmap tile resolution is 129 and each satellite image tile resolution is 1024. Full resolution coverage is 4096 pixels for the heightmap and 32768 pixels for the aerial imagery.


    Sample Datasets
    UPDATE: There are now sample scenes available in the TerraLand 3 package


    Here are 2 other downloadable datasets usable in the demo entirely generated, cropped & converted in TerraLand:


    Monument Valley (40km x 40km) terraunity.com/freedownload/MonumentValley.zip

    TerraLandOfflineStreaming_MV.jpg



    Zion National Park (40km x 40km) terraunity.com/freedownload/Zion.zip

    TerraLandOfflineStreaming_Z.jpg



    Just unzip them in the root folder of the build (TerraLand Offline Streaming_Data) and run the demo. Keep in mind that you have to backup other servers with the same folder name if exist before rewriting its contents.


    Please note that the provided demo is just a technical overview of how the streaming system operates in the action and no artistic considerations are involved and generated environment is only a base for the world generation. Also the system will evolve in the coming versions and becomes more flexible and detailed in the future.


    The TerraLand's latest version is configured and updated to easily generate local servers for the area of interest usable in TerraLand's Runtime Offline Streaming system and will be available in your terraunity.com/AssetStore accounts in the following days. More info and changes will be announced here upon release.
     
    Last edited: Dec 19, 2018
    Funkeys and Bartolomeus755 like this.
  44. Ribido

    Ribido

    Joined:
    Feb 13, 2018
    Posts:
    1
    Hello,

    Is there a way to drop a geo-referenced object into a terraland runtime scene? Previously you provided an example with a downloaded scene but I'm trying to do this within terraland runtime. I understand that the initial lat/lon is used as the 0,0,0 for the scene and I should just need an offset to apply to my latitude and longitude.

    Thanks!
     
  45. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Good question, as already received several emails regarding the same scenario, here are some information and source code to get exact Lat/Lon coordinates in runtime.

    TerraLand's Runtime system is able to travel in possibly unlimited world sizes and this behavior needs floating point inaccuracies to be handled. For this we use a script on camera which offsets everything in the scene whenever camera gets to a certain distance from the scene origin at 0,0,0. Calculating the current Latitude/Longitude coordinates regardless of the occasional offsets is handled by a Vector3 in the following script.

    Here is the full source code of the "FloatingOriginAdvanced" script in TerraLand Runtime which handles floating origin offsets on camera and contains a Vector3 var called "staticPosition" which returns a static seamless position of the player/camera regardless of any occurred offsets in the world.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using System.Linq;
    4.  
    5. [RequireComponent(typeof(Camera))]
    6. public class FloatingOriginAdvanced : MonoBehaviour
    7. {
    8.     public float distance = 100.0f;
    9.     public bool collectObjectsOnce = true;
    10.     public bool checkPhysics = true;
    11.     public float physicsDistance = 1000.0f;
    12.     public float defaultSleepThreshold = 0.14f;
    13.  
    14.     private Transform cameraTransform;
    15.     private float distanceSqr;
    16.     private float physicsDistanceSqr;
    17.     private Object[] objects;
    18.     private static List<Object> gameObjects;
    19.     private static List<Object> physicsObjects;
    20.  
    21.     public static Vector3 staticPosition;
    22.     public Vector3 worldOffset;
    23.     public bool originChanged = false;
    24.  
    25.  
    26.     void Start ()
    27.     {
    28.         cameraTransform = transform;
    29.         distanceSqr = Mathf.Pow(distance, 2f);
    30.         physicsDistanceSqr = Mathf.Pow(physicsDistance, 2f);
    31.  
    32.         if(collectObjectsOnce)
    33.             CollectObjectsOnce();
    34.  
    35.         staticPosition = transform.position;
    36.     }
    37.  
    38.     void LateUpdate ()
    39.     {
    40.         ManageFloatingOrigin();
    41.     }
    42.  
    43.     public void CollectObjectsOnce ()
    44.     {
    45.         gameObjects = new List<Object>();
    46.         gameObjects = FindObjectsOfType(typeof(Transform)).ToList();
    47.  
    48.         if(checkPhysics)
    49.         {
    50.             physicsObjects = new List<Object>();
    51.             physicsObjects = FindObjectsOfType(typeof(Rigidbody)).ToList();
    52.         }
    53.     }
    54.  
    55.     private void ManageFloatingOrigin ()
    56.     {
    57.         try
    58.         {
    59.             originChanged = false;
    60.             Vector3 cameraPosition = cameraTransform.position;
    61.             staticPosition = cameraTransform.position + worldOffset;
    62.  
    63.             if(cameraPosition.sqrMagnitude > distanceSqr)
    64.             {
    65.                 worldOffset += cameraTransform.position;
    66.                 originChanged = true;
    67.  
    68.                 if(collectObjectsOnce)
    69.                 {
    70.                     foreach(UnityEngine.Object o in gameObjects)
    71.                     {
    72.                         Transform t = (Transform)o;
    73.  
    74.                         if (t.parent == null)
    75.                             t.position -= cameraPosition;
    76.                     }
    77.                 }
    78.                 else
    79.                 {
    80.                     objects = FindObjectsOfType(typeof(Transform));
    81.  
    82.                     foreach(UnityEngine.Object o in objects)
    83.                     {
    84.                         Transform t = (Transform)o;
    85.  
    86.                         if (t.parent == null)
    87.                             t.position -= cameraPosition;
    88.                     }
    89.                 }
    90.  
    91.                 if(checkPhysics && physicsDistance > 0f)
    92.                 {
    93.                     if(collectObjectsOnce)
    94.                     {
    95.                         foreach (UnityEngine.Object o in physicsObjects)
    96.                         {
    97.                             Rigidbody r = (Rigidbody)o;
    98.  
    99.                             if (r.gameObject.transform.position.sqrMagnitude > physicsDistanceSqr)
    100.                                 r.sleepThreshold = float.MaxValue;
    101.                             else
    102.                                 r.sleepThreshold = defaultSleepThreshold;
    103.                         }
    104.                     }
    105.                     else
    106.                     {
    107.                         objects = FindObjectsOfType(typeof(Rigidbody));
    108.  
    109.                         foreach (UnityEngine.Object o in objects)
    110.                         {
    111.                             Rigidbody r = (Rigidbody)o;
    112.  
    113.                             if (r.gameObject.transform.position.sqrMagnitude > physicsDistanceSqr)
    114.                                 r.sleepThreshold = float.MaxValue;
    115.                             else
    116.                                 r.sleepThreshold = defaultSleepThreshold;
    117.                         }
    118.                     }
    119.                 }
    120.             }
    121.         }
    122.         catch{}
    123.     }
    124. }
    125.  
    126.  

    By having the static position from the origin, we can now calculate the current geo-coordinates of the camera position. Following is the class derived from the GameManager script in the WorldExplorer demo which I removed the unnecessary parts which returns current player Lat Lon position in the world.

    Code (CSharp):
    1.  
    2. // As requested here: https://forum.unity.com/threads/terraland-2-high-quality-photo-realistic-terrains-from-real-world-gis-data.377858/page-8#post-3391209
    3. // Here is the script to get Lat/Lon coordinates from camera position in runtime.
    4. // All calculations are based on the assumption that each unit in Unity is euqual to 1 meter in real world space.
    5.  
    6. using UnityEngine;
    7. using System;
    8.  
    9. public class RuntimeLatLon : MonoBehaviour
    10. {
    11.     public GameObject worldGenerator;
    12.     private static Runtime runTime;
    13.  
    14.     private static double earthRadius = 6378137;
    15.  
    16.     private Vector3 realWorldPosition;
    17.     private double initialLat;
    18.     private double initialLon;
    19.     private double playerLat;
    20.     private double playerLon;
    21.  
    22.     private Vector3 worldPosFromCoords;
    23.     public double destinationLat;
    24.     public double destinationLon;
    25.     public float destinationHeight = 3000f;
    26.  
    27.  
    28.     void Awake()
    29.     {
    30.         runTime = worldGenerator.GetComponent<Runtime>();
    31.         SetPlayer();
    32.     }
    33.  
    34.     void Update()
    35.     {
    36.         GetLatLon();
    37.         GetWorldPosition();
    38.     }
    39.  
    40.     public void SetPlayer()
    41.     {
    42.         if (MainMenu.latitude.Equals(""))
    43.         {
    44.             initialLat = double.Parse(runTime.latitudeUser);
    45.             initialLon = double.Parse(runTime.longitudeUser);
    46.         }
    47.         else
    48.         {
    49.             initialLat = double.Parse(Runtime.latitudeMenu);
    50.             initialLon = double.Parse(Runtime.longitudeMenu);
    51.         }
    52.     }
    53.  
    54.     private void GetLatLon()
    55.     {
    56.         realWorldPosition = FloatingOriginAdvanced.staticPosition;
    57.  
    58.         double offsetLat = (realWorldPosition.z / earthRadius) * 180 / Math.PI;
    59.         playerLat = initialLat + offsetLat; // Moving NORTH/SOUTH
    60.  
    61.         double offsetLon = (realWorldPosition.x / (earthRadius * Math.Cos(Math.PI * playerLat / 180))) * 180 / Math.PI;
    62.         playerLon = initialLon + offsetLon; // Moving EAST/WEST
    63.     }
    64.  
    65.     private void GetWorldPosition()
    66.     {
    67.         double destinationOffsetLat = destinationLat - initialLat;
    68.         double destinationOffsetLon = destinationLon - initialLon;
    69.         double worldPosZ = destinationOffsetLat * (Math.PI / 180) * earthRadius;
    70.         double worldPosX = (destinationOffsetLon * (earthRadius * Math.Cos(Math.PI * destinationLat / 180))) * Math.PI / 180;
    71.         worldPosFromCoords = new Vector3((float)worldPosX, destinationHeight, (float)worldPosZ);
    72.     }
    73.  
    74.     void OnGUI()
    75.     {
    76.         GUI.backgroundColor = new UnityEngine.Color(0.3f, 0.3f, 0.3f, 0.3f);
    77.         GUI.Box(new Rect(10, Screen.height - 35, 220, 22), "Lat: " + playerLat.ToString("0.000000") + "   Lon: " + playerLon.ToString("0.000000"));
    78.         GUI.Box(new Rect(250, Screen.height - 35, 420, 22), "Destination Point   X: " + worldPosFromCoords.x.ToString("0.000") + "   Y: " + worldPosFromCoords.y.ToString("0.000") + "   Z: " + worldPosFromCoords.z.ToString("0.000"));
    79.     }
    80. }
    81.  
    82.  

    Hope it helps ;)
     
    Last edited: Feb 14, 2018
  46. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    I have updated the above script "RuntimeLatLon" to also have the reverse engineering of the GetLatLon function where we need to set a destination geo-point (Lat/Lon) to get the returned world position in Unity in order to do desired stuff like moving the player to that certain point.

    Here's the code snippet of the mentioned function:

    Code (CSharp):
    1. private void GetWorldPosition()
    2.     {
    3.         double destinationOffsetLat = destinationLat - initialLat;
    4.         double destinationOffsetLon = destinationLon - initialLon;
    5.         double worldPosZ = destinationOffsetLat * (Math.PI / 180) * earthRadius;
    6.         double worldPosX = (destinationOffsetLon * (earthRadius * Math.Cos(Math.PI * destinationLat / 180))) * Math.PI / 180;
    7.         worldPosFromCoords = new Vector3((float)worldPosX, destinationHeight, (float)worldPosZ);
    8.     }
     
    antoripa and Bartolomeus755 like this.
  47. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    In order to show the flexibility, performance & customization of the Offline Streaming system plus utilizing TerraLand's built-in tools, here is the rendering demo of high resolution 1 meter Lidar data from Alaska.


    Download ALASKA Demo
    http://terraunity.com/freedownload/TerraLandOfflineStreaming_1MeterLidar_Alaska.zip


    Click on each image to see the animation

    TerraLand_Alaska1.jpg

    TerraLand_Alaska2.jpg

    TerraLand_Alaska3.jpg

    TerraLand_Alaska4.jpg



    Demo Details

    Controls:

    Navigation: Arrow Keys/WASD
    Move Up: "E"/Mouse Left Click
    Move Down: "Q"/Mouse Right Click
    Shift: Increase Speed
    Alt: Decrease Speed

    All movements are 3D Mouse simulated.



    Total terrain surface in the demo is around 7x7 kilometers spread and resampled in a 8192 pixel resolution heightmap tiled into a 32x32 grid as 1024 heightmap tiles using "TerraLand Terrain" component. Each elevation tile is 257x257 pixels.

    Active area around the player is a grid of 8x8 as 64 tiles covering approx. 1.7 km2 which is streamed dynamically while traveling.

    No Satellite Images are used in the demo and the colors on terrain surface is procedurally generated using a custom terrain shader which involves a simple hack for texturing.

    The original 1 meter Lidar TIN data is obtained from OpenTopography.


    The purpose of this demo is to show the possibilities of TerraLand tools without even leaving Unity and to show the rendering power and the performance of the high resolution terrain surfaces in huge open world environments created by the Offline Streaming system in Unity.

    The Lidar data is used as raw capturing of the point cloud data on the surface to contain all 3D features such as trees. The existing 3D features on the surface will give players a sense of scale and visual fidelity.

    The existence of raw 3D features on the surface in the demo is similar to a basic version of Google Earth's 3D Imagery technique.
     
    Last edited: Feb 19, 2018
  48. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    63
    TerraLand is not on Asset Store anymore, for buying?
     
  49. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    You can buy TerraLand as before from our website here: http://terraunity.com/product/terraland/

    TerraLand is deprecated in AssetStore in a temporary situation but may be back in the following days. However, this was intended as we are moving to TerraLand 3 with streaming features in place. More info will be revealed here soon.
     
  50. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729



    Our WIP Terrain Shader, ShadowMapper, Erosion system & more in TerraWorld:
    TerraWorld_TerrainShader-ShadowMapper-Erosion.jpg
     
    junaid109 and Funkeys like this.