Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

EasyRoads3D v3 - the upcoming new road system

Discussion in 'Works In Progress' started by raoul, Feb 19, 2014.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi Grendelbiter,

    Heavy tree detail density will take longer but 15 minutes sounds very long. You can switch off tree and detail removal separately to see if it is one of the two that causes most delay.

    Is this a single river object? How long is it? And what are your terrain settings? Especially the detail resolution settings.

    Thanks,
    Raoul
     
  2. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    576
    We have a shader that works with EasyRoads and provides wet patches. See here for more details.
     
    raoul likes this.
  3. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    @sstrong,
    Seems nice, but from my understanding that demands a whole new package to be used instead.
    What I only want is a shader that supports that, not a new whole system.

    Hopefully @raoul will enlighten us
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Have you meanwhile seen the new transparency shader in the 8.7 beta? It is used on the dirt track blended with the asphalt road. This example is more to show that it does receive shadows. It was quickly added upon request. No normal map is assigned to this example so yes, it does look dull. Is this what you meant with "...liveless mud"? Can you try that with a normal map, play with the lighting, metallic smoothness settings (higher values for wet look) and imagine to also see reflection and being able to control this with texture maps. Is that what you are looking for?

    Thanks,
    Raoul
     
  5. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    576
    Our wet road effect and screen space reflection complements EasyRoads3D. We really like ER3, which is why we did this integration work. We haven't yet tried out Raoul's dirt/asphalt blending but it certainly could help with tracks that contain multiple surface types.
    @raoul We think you still have the best asset in the store... keep up the good work.
     
  6. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114

    @raoul,

    But road's metalic smoothness is just a slider. There is no texture that one may connect and in a way mask/limit reflections in certain areas. As is now, adjusting metallic smoothness applies to the whole mesh, making wet areas of the road impossible to define, as the whole mesh becomes reflective.
    Am I missing something here or there is still a way as is to define specific metallic areas and not the whole mesh ?
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi Stephen,

    Thank you very much, you were here from the very start of the beta releases and have been very helpful. Glad to hear you still like it.

    Thanks,
    Raoul
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi tri-stratos,

    On the previous page you started this topic asking for a transparency specular shader. I mentioned the new transparency shader with metallic smoothness options currently controlled through a slider. I also mentioned that this will be expanded with texture map options for metallic and smoothness.

    From your last post it seems that indeed this new transparency shader can do what you want. As mentioned yesterday adding these texture map options is simple. It will be available in the next update.

    Thanks,
    Raoul
     
  9. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    77
    It is a single River object, the wait time is when I add it fresh to the Terrain, so it has no length yet.
    Terrain settings are:

    Heightmap Res: 1024
    Controlmap Res: 1024
    Detailmap Res: 1024
    Detail Res per Patch: 16
    Basemap Res: 1024
    Terrain real Width: 2048
    Terrain real Height: 427
    Pixel Error: 5

    There are 16 different Tree types and 4 Details
     
  10. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    45

    Ok, so I know I am bugging you, but after a day+ attempting to get terrain and ERv3 to work I give up. How SPECIFCALLY do I use this code. (found it in RuntimeScript.cs, but it is not being called) Do I have my own script get all references to the road object and then set the SnapToTerrain? Or.... ?

    btw: I got Road & Traffic AI (https://assetstore.unity.com/packages/templates/systems/road-traffic-system-21626) working with your asset and shared some code to do so on that asset's forum as other developers were asking about using that asset with yours.
     
  11. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114

    @raoul,
    Cool. Please keep us posted!
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Thank you for the terrain info!

    But this actually seems to happen when adding the road object to the hierarchy, not when building the terrain?

    In that case it must be related to backing up the terrain. In v3 this is optional, there will be a notification if a new terrain is found and you will be asked if you want to backup the terrain. Is this indeed what this is related to?

    I will check a terrain similar to yours with dense vegetation. In any case, the backup is optional. We actually usually do this by duplicating them in the project folder.

    Thanks,
    Raoul
     
    Grendelbiter likes this.
  13. davidwandar

    davidwandar

    Joined:
    Aug 28, 2017
    Posts:
    4
    Something like "Follow Terrain Contours" is what I am looking for in the API. The markers themselves maybe doesn't have to snap i suppose. I will have a look out for this when it releases.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi JamesWjRose,

    What exactly did you try?

    Here is a code snippet I just tested:

    Code (csharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. using System.Collections;
    4.  
    5. [MenuItem( "EasyRoads3D/Snap road to terrain" )]
    6.     public static void  SnapRoad ()
    7.     {
    8.         ERRoadNetwork roadNetwork = new ERRoadNetwork();
    9.         ERRoad road = EREditor.GetSelectedRoad();
    10.         //    road.SnapToTerrain(true, 0.5f);
    11.         road.SnapToTerrain(true);
    12.     }
    The first image is default behaviour, the terrain adjusting to the road. The second is what the road looks like after snapping it to the terrain.
    snapToTerrain.jpg

    I checked the traffic AI posts. If you need anything in that area let me know.

    Thanks,
    Raoul
     
    Last edited: Nov 9, 2017
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    @tri-stratos, fingers crossed but hopefully the new demo project with the adjusted shader will be submitted by the end of this week.

    Thanks,
    Raoul
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957

    Hi davidwandar,

    I will make a note of that. I now see that "Follow Terrain Contours" is not an option yet in General Settings > Road Types. That will be added as well so you can set up road types with specific "Follow Terrain Comtours" settings and simply pass the road type when ceating a new road through the scripting API.

    Thanks,
    Raoul
     
  17. davidwandar

    davidwandar

    Joined:
    Aug 28, 2017
    Posts:
    4
    Sounds great :)
     
  18. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    45
    EDIT: I didn't even notice the code you posted is a MenuItem. This is why I should not reply before the caffeine kicks in. I'll try it and get back to you.

    As for the Traffic AI, no help needed. I just wanted you to know that I made the code changes so it can help sell your asset as well. I have created a Github repository for this code: https://github.com/Blissgig/Easy-Roads-3D-with-Road-and-Traffic-AI



    ///- Previous post info -- Not valid anymore cause, well, I wasn't awake yet//
    I haven't tried anything yet because I didn't know what I should try (infinite possibilities)

    The code looks fine, but you are stating a NEW road network. Since I have an existing network my thought, my assumption is that I should FIND that object and iterate through it's roads and set them as SnapToTerrain.... right?
     
    Last edited: Nov 9, 2017
    hopeful likes this.
  19. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    45
    Raoul,

    re: snap to terrain

    I ran your code and on this line: ERRoad road = EREditor.GetSelectedRoad(); "road" comes back as null, no matter what section of road I select. It does not matter if I select the road in Scene or within the Hierarchy. Feel free to point and laugh at whatever dumb thing I am doing.

    I will continue to look into it, I just wanted to get back to you asap
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Thank you for that. I am not familiar with Traffic AI but it looks very useful.

    This will only create a new road network object in the hierarchy if no road network object exists yet. Otherwise it will create a reference to an already exisiting road network in the sscene.

    Have you tried this with the main road network object selected and the specific road selected in the scene by selecting one of the blue markers? That is what I did this morning when testing this.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  21. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    45
    "Select the blue dot" <- This was the answer. Simply selecting the road but not the dot had the "road" object come back as null

    Thank you very much.
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    There are other ways to do this, but in the code example the below line is used:

    ERRoad road = EREditor.GetSelectedRoad();

    This will get a reference to the selected road with the main road network selected which is generally is the case when working on the road network. And in this situation, selecting a road is done by clicking one of the blue marker handles.

    Thanks,
    Raoul
     
  23. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    45
    Thanks Raul, I did get the point, however I wanted you to be aware that we HAVE to click the blue dot as opposed to JUST the road to get the desired result. It's not very intuitive and you might want to update the code to work if the road is selected.... if that's possible. I mention this as I have studied UI/UX for 25 years and thought you might want/need the info.

    In any case, again thank you very much for your time and your asset.

    Have a wonderful weekend
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi JamesWjRose,

    What I wanted to emphasize is that for that API code to work, the main road network must be selected first (as if you are working on the road network) and then a blue marker to select the actual road. That is how you select a road when working with the road network object selected.

    How did you select a road without selecting a blue marker first? What I assumed was that you selected the road object in the hierarchy. In that case the code I provided will indeed return null, but you could do soemthing like:

    ERRoad road = roadNetwork.GetRoadByName( Selection.activeGameObject.name)

    But I thought that in your case, having newly created roads or selected roads to snap to the terrain (the road is already selected), this would be the easiest solution.

    With this type of API code you can extend the editor functionality with your own functions while using the same road network workflow in Scene View.

    Have a great weekend too :)

    Raoul
     
    Last edited: Nov 10, 2017
    JamesWjRose likes this.
  25. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    128
    Hi,

    I am having trouble with removing markers ( with R key ). It just weirdly sometimes work and sometimes does not work, Sometime I have to click like 10 times to remove it a single marker.

    Is this optimisation issue or a bug.

    Regards

    Screen Shot 2017-11-11 at 09.56.52.png
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi MoribitoMT,

    Does this happen in specific situations?

    Sometimes Shift + R indeed doesn't seem to work. Reselecting the marker once should fix that.

    A reason for keyboard shortcuts in general not working can be that the scene view window doesn't have focus.

    But looking at the screenshot, there are no other markers visible apart from the selected marker. Is perhaps something else going on here? Is thisroad object fully functional? Do you get error messages?

    Thanks,
    Raoul
     
    MoribitoMT likes this.
  27. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    128
    Hi,

    There is no error message or warnings. It works, but not all the time. It is weird to explain, sometimes it works at once, sometimes I need to do same keyboard delete action 10 times ( then it works ). It feels like a focus problem, I however focus is there, I specially sometimes select marker move around to make sure marker is focused %100, still same problem occurs.

    Regards.
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    This uses Unity's Event.curent and checks it against KeyCode.R. As far as I am aware of the only condition for this to work is that the scene view window has focus. So I am not sure how this part can be improved.

    When you reselect it, do you first deselect it or simply click on the marker again? And do you have similar issues with other keyboard shortcuts, http://unityterraintools.com/EasyRoads3D/v3/html/shortcuts.html ?

    Thanks,
    Raoul
     
    MoribitoMT likes this.
  29. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    128
    Well,

    I need to investigate further, If I found anything I will let you know here.

    Regards.
     
    raoul likes this.
  30. ashot_gh

    ashot_gh

    Joined:
    Nov 13, 2017
    Posts:
    5
    Hi,

    Is the sore version compatible with Real World Terrain?
    We've tried the free version and seems it's not compatible.

    Also there is a note: only supported EasyRoads 3D v3. EasyRoads 3D v2.x is not supported in Real World terrain documentation.

    Just wanted to make sure that we can integrate before buying.
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi ashot_gh,

    It depends on what you mean with "supported".

    Although you can use EasyRoads3D on any mesh, it is optimized to work with the unity terrain object and flatten the terrain according the road network.

    So one way or an other, it will always work together with terrain tools that use the Unity terrain object.

    But if I am not wrong, Real World Terrain includes further support related to auto generating road tracks for EasyRoads3D and this is what indeed does not work for v2 and does work for v3. But I would contact the Real World Terrain developer to verify that.

    In any case, v3 includes direct import of OSM and KML road data as well.

    Thanks,
    Raoul
     
  32. ashot_gh

    ashot_gh

    Joined:
    Nov 13, 2017
    Posts:
    5
    Hi @raoul

    Thanks for the feedback,

    with "support" I mean we've tried v2 - free version and we cold not place the markers to draw the road on terrain generated using Real World Terrain while when we tried on an empty terrain it worked.

    So this is the main question that I'd like to be sure before buying

    Thanks,
    Ashot
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    What does your Real World "Terrain" look like? Is it a single terrain object or multiple tiles?

    Because the free version does not support multiple terrain objects directly, it uses Terrain.activeTerrain. When the terrain tile you want to place a marker on is not the active terrain indeed no marker will be added. The full version does support multiple terrains, both v2 and v3.

    In that case and for your reassurance, you could try a Real World Terrain setup with only one Unity terrain object using the free version. The free version is still v2 and cannot be compared with v3 but this part works the same.

    Thanks,
    Raoul
     
  34. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    @raoul,

    When building project, the road has a very ugly artifact (check attached image)
    The crazy part is that in unity everything looks fine!
    Is this a known issue ?

    It has to be said that after build I get 4 errors:
    1) Broken text PPtr in file(Assets/EasyRoads3D/Resources/dynamic prefabs/Default X Crossing.prefab). Local file identifier (118426) doesn't exist!
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    2) Broken text PPtr in file(Assets/EasyRoads3D/Resources/dynamic prefabs/Default X Crossing.prefab). Local file identifier (118426) doesn't exist!
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    3) Error building Player: 2 errors
    4) UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()


    that gives no clue as to what the problem is
    (btw the scene contains a simple road - NO x crossing of any kind!!)

    Are the errors related ?
    Why that ugly seam appears, when texture is fine, and within viewport and game mode in unity it looks just fine. It is when built that is messed up.
    Any idea ?
     

    Attached Files:

    Last edited: Nov 14, 2017
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi tri-stratos,

    The errors/warnings are unrelated. They should no longer appear in the next update.

    How long is this road object? And does this happen after a while, not near the start?

    Based on what you write it sounds like floating point inaccuracies on the UVs that can appear further away on longer roads depending on your device, graphics card. V2 had an optimization for this. This is not yet added to v3 because in v3 this is less likely to happen. Crossings will automatically split roads in separate objects.

    Can you try inserting an I Connector on the marker before where this happens?

    Please let me know if this doesn't solve the issue.

    Thanks,
    Raoul
     
  36. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    raoul,

    What do you mean I connector ? Only T,X and 4 exists. Please specify in detail.

    But then again, I want no road split. I just want a single road path. And the road is almost 3.6 Km. It would just be a nightmare to add to all those individual markers anything additional. The road starts fine more some meters and then all the rest is messed up as far as this tiling error is concerned. And the mess is ONLY in build! Both scene and Game view works just fine!!

    Any more drastic fix for this ?
    ie a script update OR anything i may alter in script myself or so ?.
    I need it urgently!
     
    Last edited: Nov 15, 2017 at 11:15 AM
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi tri-stratos,

    You don';t have to do this on all markers. This situation would come back repeatedly in this thread if that would be the case and this v2 fix would already be implemented if this is a critical issue.

    After which distance does this start to happen?

    I Connectors work differently from the prefabs you mention because by default no mesh is involved.

    Can you select the marker before this happens and in the Inspector move downwards in the marker section, you will see a button "Insert I Connector" just below "Split Road at Selected Marker".

    The reason I asked this is primarily to double check whether that indeed solves the issue so you may even want to do this in a duplicated scene or project. If that is the case then one way or another the UVs on the mesh must be reset and restart near 0 whether you use EasyRoads3D or an imported model. The easiest way to achieve this at the moment with this tool is to insert an I Connector.

    3.6 km for a single road object is reasonably long. Using I Connectors also gives you the option to do other optimizations such as occlusion culling, LOD Groups.

    Thanks,
    Raoul
     
  38. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    raoul,

    This happens just few meters after start (~50-100m). So the messed up part is huge within 3.6km.

    Inserting I connectors does produce more problems!
    What I mean other than it takes ages to reprocess the whole terrain just for one I connector added,
    - it brakes the road and it distorts it off terrain completely, messing up the roads continuity completely!
    - trashes all the detail work I've done into defining details over the previous mess, as a new one has to be rebuilt from scratch and there for, everything has to be reimplemented...(tell me that is a nightmare)

    PLEASE
    i just need a simple fix to this UV error that happens only on unity build (I mean UNITY building NOT easyroad building here and YES, in scene and game works fine!!!) instead of having to do a massive fix of new issues by additing new unnecessary stuff.

    PLEASE
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi tri-stratos,

    You clearly mention that this happens in a Unity build.

    EasyRoads3D uses ordinary unity gameobjects with a meshfilter attached. This is something Unity, your device / graphics card related, not directly EasyRoads3D related. The only situation I am aware of is the floating point inaccuracies which is resolved by using an I Connector.

    What issues do you have with the I Connector? Which beta version are you using? Can you show clear screenshots, ideally with the road network in Edit mode and the white surfaces visible?

    Please make sure to use the latest 8.7 build when using I Connectors. Although I am not 100% certain what exactly goes wrong, what you describe seems like something that can happen in the 8.6.1 build. But this should never destroy anything terrain related that is undoable.

    If this isn't resolved by using an I Connector then it I need more info because in the 7 years we are working with this we are not aware of other causes then these floating point inacurracies. What you could do is export to .obj and reimport back into Unity, optionally first imported and exported in your modelling app. Does the same thing happen? In that case a bug report must be send to Unity. We can do that if you provide us with the assets and your full specs.

    Thanks,
    Raoul
     
    Last edited: Nov 15, 2017 at 12:56 PM
  40. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    raoul,

    OK, here is what I did and it worked.
    A bit annoying for sure, but still a workaround that works in scene/game and built.

    - I manually exported the road network to obj
    - Disabled the original road
    - Simply reimporting into unity (without first importing it to a 3d app)
    - Scaled it X to -1 (Why on earth an exported network road mesh is exported mirrored !?)
    - Reassigned the material (Scene and Game view fine by now)
    - Built it ->> FINALLY it works here as well

    As said, a rather annoying step, and I wish this could be addressed somehow, so that is not needed to lose time in such a fundamental need.
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Glad to hear you got that working

    As mentioned before, there is no history of this other then what is already mentioned.

    When in EasyRoads3D Build mode, can you press ."Store mesh Assets in Assets Folder". This will create a new folder in /EasyRoads3D/Scene Meshes/ named after the currently open scene. A mesh asset of the road will be saved in that folder. Could you send this mesh asset and the exported .obj in a unitypackage to me? That way we can compare the two. Either something else is done to the mesh during the import or Unity does something similar as what is done in v2 and what is also done when inserting an I Connector.

    And the I Connector issue? Do you have more feedback on that, is this indeed related to an earlier beta? can you otherwise provide screenshots?

    Thanks,
    Raoul
     
  42. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    23
    Hello again, Raoul. My tasks have been all over the place, but now I'm back on roads.

    As part of our workflow in generating terrains we turn each terrain tile and everything on it into an asset bundle for faster loading. We want to do the EasyRoads terrain modifications before creating the asset bundles to minimize the amount of work that has to be done when the terrains are loaded by our end users. Since each tile needs to be self-containing we must cut the roads along the terrain edges. I've thought of two options for doing this:

    1. Build the RoadNetwork and then just cut the roads right off at the edges.

    The upside is that it would probably be easy to do with some mesh cutting asset and it would probably look good as the UV-coordinates should match with the section on the neighbouring terrain. The cut will also be straight along the terrain edge, but that isn't too important.

    The downside is that this would only cut the mesh and EasyRoads would probably still see it as still having the same nodes as before and thus when loading the bordering tile there would be two roads with the same nodes overlapping each other. We don't currently have the need for AI-pathing, but I can see such a thing might come up in the future and it would be nice to be prepared for that already.

    2. Build the RoadNetwork. Revert to edit mode without reverting the terrain (or else the terrain modification may not reach all the way to the border, depending on the angle at which the road attacks the border). Place a node on the border between the last node inside the terrain and the first node outside it. Remove all the nodes outside the terrain. And finally, build the RoadNetwork again, but this time without affecting the terrain (maybe? presumably there wouldn't be a change anyway, so the road won't cut through the terrain).

    The upside of this would be that it would probably be easy to connect them for AI-pathing as there is no overlap in the nodes.

    The downside would be that since the meshes are now made from two separate roads their UV-coordinates might not match. The cut won't be straight along the terrain edge, rather it will be perpendicular to the direction of the road, but that shouldn't be an issue.

    I would prefer the second option, but that would require the functionality to build the RoadNetwork without affecting the terrain and the same with reverting it. Unless you have insight into a different way to do it, of course.
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi NordstroemSAAB,

    Since you mention that a clear cut exactly on the terrain tile edge is not too important, have you tried the I Connector option (further below in the Marker section in the Inspector)? This can be used to connect two road segments. UV coordinates are clamped to 1 so no seams should be visible.

    You could experiment with placing I Connectors exactly on the terrain edges. Please do this using the latest 8.7 beta because in 8.6.1 this can potentially have wrong results when flattening the terrain according the road shape.

    Other then that:

    Option 1: In theory this will preserve all road network functionality in case you want to make changes in a later stage.

    Option 2: Should you want to make changes in a later stage, the old road shape will be visible in the terrain. So this will require up to date backups of the terrain. And unless perfect straight segments on the edges are used, the two road sections will not connect nicely after splitting them in separate objects. You can test this by using the "Split Road at Selected Marker" button just above the "Insert I Connector" button.

    Thanks,
    Raoul
     
  44. mikko_to

    mikko_to

    Joined:
    Oct 14, 2013
    Posts:
    15
    Hi raoul!

    Out of interest and without any testing with that new dirt-blending-to-asphalt shader, how are materials handled in that scenario? I assume a lot of vehicle models use materials to determine the transitions between surface conditions (grip and so forth), so does that work similarly in your example as well?

    Anyhow, that looks absolutely great!
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Hi Mikko,

    This is another thing you can do with the I Connector mentioned in the above post. By default an I Connector does not include a mesh but you can set it up as a transition between two roads, either by blending the involved road textures or by using a transition texture.

    At the moment the tool does not include anything physics related or what you describe, there are other packages for that. But usually this transition takes place over a very short distance in a fraction of a second. And there are always ways to get more info if more precision is required, by reading mesh data and/or using collision triggers.

    Glad to hear you like it :)

    Raoul
     
  46. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    23
    I'll try the IConnector thing you suggested, but in the end I'm going to need to do that with the API as I need it to be automated.

    Also, I don't have to worry about making changes to the terrain at a later stage. We regenerate it from scratch every time we add something new and the generated terrain is never changed after that. For now I only need the resulting road mesh. Making sure that the EasyRoads3D component will still work on the road is just me future-proofing our software for potential need for AI-pathing, though that need is probably far off as it hasn't even been discussed.
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    The I Connector is relatively new, it is indeed not yet possible to use this with the scripting API. Adding it is not complicated, this can be done if it is urgent.

    So, if it is possible with your setup, you can give it a try by manually adding roads and this I Connector. Just to see if that will work for you. With this approach for sure all will be good if you need AI in the future.

    Thanks,
    Raoul
     
  48. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114

    @raoul,
    Check files attached.
    I have also included a screen that shows that when IConnector is added, the road is simply splitted in two
     

    Attached Files:

  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,957
    Thank you very much, I will have a look at it.

    Yes, by splitting the road the UVs start back at 0. It was suggested as a quick test.

    Thanks agan,
    Raoul
     
  50. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    114
    @raoul
    Hopefully the splitting with Iconnector isn't needed, because having to do that and fix afterwards in every node is a nightmare

    I really hope you spot and fix the issue according to rest files