Search Unity

EasyRoads3D v2 is out – Road, rivers, procedural geometry for Unity

Discussion in 'Assets and Asset Store' started by raoul, Mar 18, 2011.

  1. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Hello raoul, I saw the EasyRoads3D Intersections Preview Video and now i'm interested in when the the Version 3 is coming out?
    We are currently testing the the free version ,so that we can determine if it fits our needs.
    The road Crossing function would defensive make this a "must buy".
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi fffMalzbier, there are many types of intersections so development will be an ongoing process for a while. It depends on what kind of intersections you require? If you only need basic square or rounded crossings / T crossings and you don’t mind the occasional editor glitch/bug then the current beta may already work for you. Code also needs to be optimized so it can be slow when many intersections (like a big city) are involved. So I can’t give an exact date for the first public release and what will be included and I am also working on other features that might be available in v2.
     
    Last edited: Apr 3, 2013
  3. zeeawk

    zeeawk

    Joined:
    Sep 12, 2012
    Posts:
    67
    Does this work on iphone/android ?
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    EasyRoads3D is an editor tool. The end result is an ordinary game object with meshfilter / material attached. So, yes, you can use this for mobile development.

    The decision you have to make is regarding the terrain object. Use a low (for performance) heightmap resolution terrain object on mobile. Or use a higher resolution terrain object for development and when all is ready, export the terrain object and optimize it in a modelling application. This is what most developers do.
     
  5. zeeawk

    zeeawk

    Joined:
    Sep 12, 2012
    Posts:
    67
    Thanks for the information. I have a question about your intersections timeline. From your demo it appears you have been working on intersections for about a year or so. Do you think you will complete this soon or have any guess on completion?

    I'm planing on building several cities with roads between then and in the country side. This tool would definitely come in handy for me but in my cities I would need various intersections.

    Thanks in advance.
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Have you seen my reply to fffMalzbier just above your first post? If you just require standard intersections like in the preview video, this will probably already work for you if you do not mind the occasional editor glitch. For the cities it depends on how many intersections there will be. Building the intersections may get slow if there are many. The option "Enable Crossings" will be useful here, turning this off will let you quickly layout your roads, link markers to create intersections. When done you turn "Ënable Crossings" back on. So this is a way to better deal with a larger number of crossings.

    Or, if you require different types of intersections, you can still use the system as it currently is to layout the roads and deform the terrain accurately also near crossings, then export the road network to .obj and manually adjust the intersections. This will still safe you a lot of time comparing to doing all of this manually.
     
  7. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Is it possible to disable the restoring of the terrain on re-enabling the editing modus at the street objects?

    Editing the terrain and editing the terrain in a mixed order is a F### pain.

    The work around to make all the roads editable and then edit the terrain and then build the roads again in not a option.

    (note: now working with the pro version)
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    You can do that by selecting "Multiple Terrains" in General Settings and uncheck "Restore". Selecting "Multiple Terrains" will also work fine with only 1 terrain in the scene. But, not restoring the terrain will leave the old road shape etc. visible in the terrain when you make the changes to the road object!

    The recommended workflow is, create your terrains, build you roads and when all finished, edit the terrains if necessary.

    If you prefer to not use the restore functionality on the terrain you might want to regularly create backups of the terrain data using backup / restore options in the main EasyRoads3D menu. You can edit backup names in the respective folders outside the Assets folder.
     
  9. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi there, just wondering if there is a tutorial somewhere on how to use sideobjects? I've tried to follow the youtube example, but my own results always end up not appearing or are twisted up.

    Also, are there some example scenes with side objects that I could look at?
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Eyehawk, usually problems with side objects are related to two situations:

    1. Side objects for which geometry should follow the spline shape (like guardrails, walls, fences) are created using the instantiated side object type. This will not work well in curved areas. The Instantiated side object type is intended for single objects that will be instantiated individually along the track (objects like lamp posts, vegetation, road props etc). Use the procedural side object type for guardrails, walls, fences, etc.

    2. Rotated prefabs. This is usually due to the way the model is imported in Unity. Often Unity automatically applies rotation values to game objects in the scene, you can see these rotation values in the Inspector after dropping a game object in the scene. EasyRoads3D will ignore these rotation values. The solution, either rotate the model in your modeling app. Or put the game object as a child in a new prefab and apply rotation (the same rotation values as Unity does) to the child inside the prefab. Drop this new prefab in the game object slot for the specific side object.

    When side objects are not appearing you way want to double check if that side object is actually enabled for the respective markers.

    A demo project is available. It demonstrates the setup of several different types of side objects and all the different options you have regarding using side objects in a scene. A link to the demo project is provided on the purchase confirmation page on our website or after registering your Assetstore purchase (_readme.txt file in the main folder of the imported package).

    Hope this helps!
     
  11. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Great thanks Raoul, I've been able to get the demo project and have made a few sideobjects with the pre-made set. Is there an easy way to export these sideobjects and then re-import them into another project?
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Open the Side Objects Manager from the main EasyRoads3D menu. At the right top you will see Import / Export buttons. Note that this will import / export the side object configuration data. You will also have to import / export the used materials and prefabs etc. through a unitypackage.
     
  13. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    on edit mode road is in xray mode. i can see the road behind my mountain. is it possible to see it normal in edit mode? like this it is not easy for me to edit. i make a road start from bottom of the mountain to the top of it. there are several turns.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi,

    Have a look in General Settings > Surface Material

    The second material will do what you want, you can also set the transparency level for this material which is useful in the case you use a map as the terrain texture. You will cleary see the road on the map so you know how to position markers.
     
  15. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Nice one thanks Raoul! :D
     
  16. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i used both materials diffuse shader and transparent shader. in both way i see it overlay/xray mode. i do not want to see behind the mountain.

    $easyroads_01.jpg
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    That is the road itself that is still visible behind the mountain. I will look at that. Meanwhile, in Edit Mode the following material is used:

    Assets/EasyRoads3D/Resources/roadMaterialEdit

    Try changing the shader on that material.
     
  18. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i can edit road's shader. but after i process road and back to edit mode it is again roadMaterialEdit shader.
     
  19. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    how do you fly camera over road? is there any script in your package?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    It seems you changed the shader on the road game object in the hierarchy? Is that right?

    In that case, try to also change the shader on the roadMaterialEdit material inside the project panel at the path mentioned in my previous post. I just checked myself by applying the shader EasyRoads3D > Diffuse directly to this material in the project panel. The material with the new shader is correctly applied to the road after switching to "Processed" and back to "Edit" mode.
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The main package only includes editor tools. But I have a run time "fly over "package here that I can send to you. It was used on previous demo videos. You can use it as a guideline on how to do this yourself. Contact me by PM or email so I can send it to you.
     
  22. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    it is ok now. it is exactly what i want. thanks.
     
  23. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i PM'ed you. it will be also usable for me to drive a car following center of the road.
     
  24. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    I am trying to use the river editor, and I keep getting a raycast error about the sides of the river? I tired in a "river" i made in the terrian and just making one on the terrain that was flat. both present the same error.

    Any thoughts?
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi VicToMeyeZR,

    Those raycast error messages are not 100% accurate. It is only a warning for you to double check the generated river bank and if the river surface floats above the terrain at some sections. This can happen on lower terrain heightmap resolutions where markers are positioned above the river is diagonally moving over the terrain. This will result in a sawtooth kind of river bank. In that case you can do 3 things:

    1. manually lower the river mesh
    2. increase the river bank height in the Inspector and smoothen the terrain afterwards.
    3. position the markers lower to below the terrain

    Also, in order to be able to create the river shape in the terrain, the terrain height at that point must be above 0 because that is the lowest point of the terrain.

    So if your terrain is flat, at least make it flat at about 10m height. You can do that quickly in the terrain menu.
     
    Last edited: Apr 12, 2013
  26. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    $Untitled.jpg

    I've tried adding two layers. Name them road 1 and road 2, but I still don't see the road texture.
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Shigidy,

    I see "road" and "road2" in the dropdown. road2 is disabled. This is layer 31, right? In that case , can you check that layer as well so objects on that layer are visible too in scene view. I just had a quick look, the road and white surfaces use layer 31.
     
  28. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    hi raoul, i have strange error. after i added a ngui label to my scene(maybe i did something more, i am not sure), game window does not draw road. on scene window everything is ok. on game window i just see side objects. i get following error. i tried to process road several times. where should i check?

    NullReferenceException: Object reference not set to an instance of an object
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
    Boo.Lang.Runtime.RuntimeServices.SetSlice (System.Object target, System.String name, System.Object[] args)
    Boo.Lang.Runtime.DynamicDispatching.SliceDispatcherFactory+<CreateSetter>c__AnonStorey12.<>m__4 (System.Object o, System.Object[] arguments)
    Boo.Lang.Runtime.RuntimeServices.SetSlice (System.Object target, System.String name, System.Object[] args)
    RoadObjectEditorScript.EasyRoadsGUIMenu (Boolean flag, Boolean senderIsMain, .RoadObjectScript nRoadScript) (at Assets/EasyRoads3D/Editor/RoadObjectEditorScript.js:89)
    RoadObjectEditorScript.OnInspectorGUI () (at Assets/EasyRoads3D/Editor/RoadObjectEditorScript.js:55)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/Inspector/InspectorWindow.cs:863)
    UnityEditor.DockArea:OnGUI()
     
  29. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i found problem; culling mask :)

    what is the rule that scene lost process of road? i think each code change and build i have to process road objects. what are the cases i must process them?
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi atmuc,

    What do you mean with culling mask?

    Do you mean the road falls back to Edit Mode after playing the scene or after script changes? Is that what is causing the problem?

    Generally speaking, always keep your road in Edit Mode unless you are finished with it. You do not want the EasyRoads3D editor objects part of your final scene. So, after you are finished creating the roads, do EasyRoads3D Menu > Build EasyRoads3D Object

    This will bake the final road and removes all editor objects. You can also do this manually by dragging the road and side objects to oustide the main EasyRoads3D editor object and then remove this main EasyRoads3D editor object. Before you do all of this, I would recomment to first create a backup of the scene by duplicating it in the project panel.

    If you don't want to bake the road yet at this stage and you want to keep it in "Build Mode" instead of "Edit Mode", just make sure that you do not select the EasyRoads3D object in the hierachy. In that case nothing will happen, it won't switch back to Edit Mode. You could even disable it, including the markers and keep the road itself enabled.

    Let me know if you need more help regarding this or if you meant something else.
     
  31. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Thanks for the help Raoul. Now I just got to figure out side objects. I've imported it from your website, but I'm not sure how to actually see the side object attached to the road. Thanks.
     
  32. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i mean culling mask on camera. ngui uses it's camera system. when i added a ngui component to my scene, ngui added its camera. and something reset EasyRoads layer on camera's culling mask. so i could not see road on the game window. i selected Everthing on culling mask again and it works now.

    i click "process the terrain and create road geometry" button. after i play and stop game and click root RoadObject it restores terrain back. i want to keep this processed terrain until i click the same button again. is this what you mentioned with Build/Edit Mode?
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    In General Settings you should see the side objects currently available in the project. You can can enable / disable side objects per road as you don't always want to use the same side objects on every road.

    Side Objects will only be visible after you clicked the middle tab / Build Mode. If you have not checked "Automatically create side objects" in General Settings the side objects will not be visible yet in Build Mode. Click the "Create Side Objects" button. If you still can't see the side object it means that all markers for this side object are by default disabled, select a marker, select the specific side object from the drop down. The various controls in the Inspector will now affect the selected side object. Check "Active" to activate the selected marker for that side object.

    Let me know if you still can't see the side objects. The demo project could also be helpful here...
     
    Last edited: Apr 16, 2013
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ah, ok, I thought that problem was related to ngui doing something with the layers. But indeed the problem below is something entirely different.

    “Create Road Geometry” stores the road as .obj so you can edit it in a modeling app if you want. It doesn’t really change anything in the scene directly.

    What I meant was, the middle mountain tab is for switching back and forth between Edit and Build Mode while creating the road. But when you are finished creating the road you have to remove all editor objects that you do not want to be part of the final scene. Look at the hierarchy: EasyRoads3D object, Markers (with all markers as childs) and the road. In the final scene you only want the road.

    You can manually drag the road to outside this hierarchy and remove the remaining objects. Or you can select the EasyRoads3D from the horizontal menu at the top of the Unity Menu and select “Build Road Objects”. This will automatically process the above steps. But again, I recommend to duplicate the scene first so you always have a back up of the road editor objects.

    Now the road will never jump back to Edit Mode! Alternatively, if you want to keep the full road editor objects as long a s possible in the scene, you can disable them so the editor scripts will not be executed when selecting them in the hierarchy.
     
  35. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
    i got the idea now, thanks. i watched all easyroads videos, but you should make high res and with voice tutorial videos for this great product. we users do not read all documentation. we like watching videos :)
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, the latest video, the one with the scene cam fly over is high res. When I have time I will redo some of the videos.
     
  37. napalm44

    napalm44

    Joined:
    Apr 23, 2010
    Posts:
    14
    Hey Roaul,
    All of your tips have worked well. The one I struggle with currently though, is the sideobjects w/ welded vertices. Being that we are running on mobile, fully welded sideobjects (using clamp), while looking perfect, push our polys way to high for mobile devices. Just was wondering when you expected LOD sideObjects to be released? Taking sideobjects out, putting them into obj, cutting them up, and reimporting them won't work because: 1) We desire seamlessly textured roads, and this can cause a break in the continuity of the texturing and 2) it is highly impractical and challenging as part of our workflow; the sideobjects are very difficult to navigate in blender due to them being pre-offset by world coordinates.

    Hope all is well, and thanks for the hard work!

    Thanks!
     
  38. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi Raoul,
    How do I export my side objects? There is an import function that allows an import of *.er3dObjects files in the Sideobjects manager, but I'm not sure how to export it?
    Thanks
    EH
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi napalm44,

    What if you also import the optimized road in the modelling app? This way you have a clear reference on how to optimize the side object so they will still perfectly "clamp", or did you meant something else with that? As long as you don't touch the UVs there shouldn't be a problem with seams in the texturing between LOD levels. Regarding world coordinates, it is fairly simple to adjust vertices so the center of the bounding box is at 0,0,0. Let me know if this is useful for you.

    Another solution would be to disable / enable markers according to how you setup the LOD segments for roads and export each set of generated side objects to .obj and use that in your lod system.

    Hope this helps, otherwise let me know if you have furthe questions.
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi Eyehawk,

    Do you mean the side object settings so you can use them in another project or the generated side object models?

    Export Side Object settings:

    EasyRoads3D Menu > Side Object Manager > Export (at the right top)

    You will be able to select those side objects you want to export. Also export used assets like materials and, possibly, prefabs to a package!


    Export the generated Side Object:

    After the side object is build and visible in the scene you will see an option "Export Geometry" in the Inspector after selecting the specific side object in the hierarchy. This will export the side object to .obj
     
  41. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi Raoul,
    Apologies, I don't seem to have that Export option under the Side Objects Manager. It just shows:

    $sideobjectsmenu.png

    Do I need to set an option anywhere?
    $sideobjects.png


     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I should apologize! ;)

    There is actually no need to export side objects. Side object data is stored in the file /Assets/EasyRoads3D/sideobjectsLog

    If you want to import all or some of the side objects from another project you click the import button and select this specific file in that other project. You will see a list of all available side objects in that file and you can select which of them to import in your current project. That's why it is also importand to pay attention to which assets are used in those side objects because these assets will have to be imported as well. If you think you will be using this feature, it is recommended to store these assets in a dedicated folder so you can easily create a package.
     
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Just got this, looks very slick. But I'm having trouble with my terrain splatmap. I have created several roads. Now I'm doing more terrain painting with the terrain tool. When I switch back to the roads, it loses the splatmap changes. I've tried doing Backup Splatmap Data after making terrain changes, but that doesn't help -- the changes still disappear when I go back to work on the roads. I must be doing something wrong, but can't figure out what it is. Help!

    thanks
    Dave
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    When you go back to Edit Mode the terrain is indeed restored to its original state. This is to avoid that the shape of the road is thill visible in the heightmap or splatmap (if you use that feature) after you make changes to the road.

    If you don't want the terrain to fallback to its original state, you can indeed make a backup of the splatmap after you made changes to the terrain. The terrain splatmap will still fall back to its original state, but now you can use the "Restore" option in the EasyRoads3D menu to load the newly created backup of the splatmap back to the terrain. Did you do that?

    In general it is recommended to minimize working on the terrain while creating the roads and make the necessary terrain changes when you are finished with the roads. It is also recommended to rename the old backup files before you make new backups of the terrain so you still have the old backup, just in case...
     
  45. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Ah, got it. That's all I needed. Thanks!
     
  46. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Aha! That did the trick - as soon as I imported the Side Objects package and imported from /Assets/EasyRoads3D/sideobjectsLoger.3dObjects it worked absolutely perfectly.

    Thanks very much for your kind assistance Raoul! :D
     
  47. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Couple of (maybe stupid) questions:

    1. does it work with Advanced Terrain Shader?

    2. does it work with lightmaps?

    I need it completely compatible with these 2 things, then you have another buyer :D
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Megmaltese,

    EasyRoads3D mainly deforms terrain heights so that doesn't affect the shader. But one of the other features is to embed the road shape in the terrain splatmaps, this could affect a custom terrain shader. However, the road shape is also stored as a png file on disk so you can manually tweak it and add it to the terrain splatmaps, so there will be a way to use this one way or the other. I am not 100% sure which advanced terrainshader you are referring at so I can't really tell how it will work with that shader.

    The uvs for mesh.uv2 (the lightmap uvs) are relative to the terrain size. This means you can use the terrain lightmap on the road. But like always, for this sort of things, if you need something else, just let me know. For instance, a couple of pages back in this thread, you will find a custom script that will set all uvs from global to within 0..1 range which could also be useful for lightmaps.

    Let me know if you have further questions.
     
    Last edited: May 10, 2013
  49. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Hi, I'm talking about this terrain shader.
    Possibility to get the road splatmap is ok.

    About lightmaps, it's a bit limited imho.
    Taking terrain lightmaps for the road is totally ok.
    But for the objects like rocks, fences, stones, sidewalls, they should be mapped like common meshes I think.
    In example, I would like to use this tool to build also large walls, like castle walls or fortress walls.
    Is it possible to export the generated meshes? That would solve the problem: they would be reimported using the Unity importer and generating the second UV easily.
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I haven't looked yet at the latest reléase of the ats ultra shader. I remember reading that you can now paint the splatmaps using a single terrain object so that sounds it is using the default terrain splatmaps. Anyway, like I already mentioned, if it does require custom splatmaps, you can simply use the generated png file with the road shape and blend that with your own splatmaps.

    Regarding the lightmapping, I was referring to the road only. Prefabs you use as side objects keep their own uvs. For procedural side objects, like walls, uvs will be generated based on world coordinates which you can set to within 0..1 range using the script I already mentioned. Or, you can indeed export the side obejcts to .obj and have Unity generate the lightmap uvs.