Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hi raoul,

    I created a new scene and could replicate the problem. I removed all textures and shaders to reduce file size.
    I guess it has something to do with how roads are created. I mean if they are created and attached to the connection or if they are pulled out of the connection end.


    Red arrow: created and attatched.
    Blue arrow: pulled out of the connection

    https://imgur.com/tDVkH5c

    Thanks
     
    Last edited: Mar 17, 2022
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi Marcell,

    Thank you for sending the scene.

    This does show what is also visible in the original images you posted.

    The way this works is that at connection edges the road Indent and Surrounding vertices snap to the corresponding Indent Surrounding vertices on the connection.

    That also happens in your scene:

    marcell.jpg

    I removed the sidewalk on the road so the triangulation of the surfaces is clearly visible. The first road surrounding vertex snaps to the connection surrounding vertex, the green line. And the first road indent snaps to the connection vertex, at the top of the blue line.

    The red gap is a result of the connection shape.

    So that explains the gap in the final terrain deformation.

    marcell2.jpg

    It is a result of the different, reasonably high Indent and surrounding values on this specific road and the default values on the connection.

    As mentioned on the previous page, in the next update the Indent and surrounding values values on connections will interpolate between the values on the involved road objects so that will improve your situation.

    Additionally, you are using custom sidewalks instead of the built-in sidewalks system. To make sure the terrain is adjusted outside the sidewalk area, the Indent values on the road objects are set so they cover the sidewalk. All that makes sense.

    But your custom connection mesh includes these invisible triangles to deal with that. Because in the next update the Indent and surrounding values will interpolate between the respective values of the involved road objects, you probably want to remove these invisible triangles.

    By removing these triangles the Indent and Surrounding edges will be calculated relative to the road edges on the connection just like for the road objects.

    If you want I can prepare a build of the upcoming changes so you can test this.

    Thanks,
    Raoul
     
  3. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hi raoul,

    thanks that you can could figure that out. I don´t know what you exactly mean with invisible triangles. Do you think you could edit my model so I have something for comparsion in the future? Yes, I would be happy to try out the updated build :)

    thanks
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi Marcell,

    Regarding the invisible triangles / faces I was referring to your post on the previous page:

    "that area" (in your post) will already be covered by the interpolated Indent values so these faces (the pink faces in this post) as part of the model are not required anymore. In fact they will interfere with the smooth interpolation on the connection prefab.

    Regarding sending the updated version for testing, which Unity version are you using?

    Thanks,
    Raoul
     
  5. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hi raoul,

    Ok wow, that sounds cool! So I can completely remove them ok.
    I am using 2020.3.22f1.

    thanks
     
    raoul likes this.
  6. UnityMagoo

    UnityMagoo

    Joined:
    Dec 28, 2021
    Posts:
    17
    How does using this to make roads impact performance?
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi UnityMagoo,

    The roads are ordinary unity game objects with a MeshRenderer, MeshFilter component and MeshCollider component.

    There are two ways to set/optimize the geometry resolution, the default resolution and the option to set an Angle Threshold, this will optimize the mesh with minimum loss of quality depending on the settings.

    So regarding impact on performance, that depends on the size of your road network, additional side objects and the used settings.

    Thanks,
    Raoul
     
  8. UnityMagoo

    UnityMagoo

    Joined:
    Dec 28, 2021
    Posts:
    17
    Thanks for the answer. Do the roads render as one big object or are their options or ways to render only the parts you see?

     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi UnityMagoo,

    The roads are separate objects so you are in control of the renderering, among other by using the LOD Group option in the general settings tab.

    Thanks,
    Raoul
     
  10. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Somebody knows why I keep getting VSP trees in the middle of the road with each seed I tried even when the mask areas are within 6 meters from the center of the road both in ER and in VSP settings?
    Thanks
    Captura de pantalla (559).png
     
  11. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hey @raoul

    i have a quick suggestion... what do you think about per marker material apply setting... e.g. the road has base material but i would like to be able to apply different materials on some of the markers and this will create a mesh that uses array of materials and will not have to compose some short track or road from different road types... what do you think ?
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi Joan,

    That is unknown. Can you pass the road width and the exact Vegetation Studio settings for the road / road type so we can test these settings?

    Thanks,
    Raoul
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi @Vagabond_,

    Currently one material is supported per road object.

    There are two options to do what you are looking for.

    1. It is possible to set vertex colors per marker. This data can be used on a single material to display 4 different road textures associated with the 4 color channels.

    2. Use I Connectors (available near the bottom in the marker section in the Inspector) to cut the road in separate road objects preserving the original road shape. That way it is possible to set a different material for each section.

    Thanks,
    Raoul
     
    Vagabond_ likes this.
  14. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Width 7m.
    Road Type
    upload_2022-3-20_19-44-35.png
    upload_2022-3-20_19-45-8.png

    upload_2022-3-20_19-47-47.png

    VSP VegetationMaskLine.cs
    upload_2022-3-20_19-43-2.png

    Is that what you need?
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi Joan,

    I just created a new project, imported Vegetatation Studio Pro and EasyRoads3D. With the same ER settings as yours, this is the result using the VSP demo scene with a higher tree density:

    VS1.jpg

    VS2.jpg

    There are no trees on the road.

    Below are the Vegetation Mask Lines generated by VSP based on the settings in ER. The Inspector values look exactly like yours.

    VS3.jpg

    Does this also work well for you in the demo scene provided by VSP?

    Thanks,
    Raoul
     
  16. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Yes, its work well in the demo scene. Also for the majority of the road but there are a few spots with this issue, even placing a second biome mask with no vegetation:
    upload_2022-3-21_10-15-18.png
    I don't know. I'll keep digging.
    Thanks for your time.
     
  17. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    In fact, this is something that had already happened to me in the prototype. Then I solved it manually, but now I would need to know the cause.
     
  18. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Well, when the area of the mask is enlarged more than needed, the trees disappear. It may be something related to the noise of the objects location or it may be that the prefab is not well referenced spatially.
    It seems weird to me but I consider it solved.
    Thanks Raoul.
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Ok, glad to hear that!

    Just in case it is necessary to dig deeper into this,

    Two different situations are being discussed at the moment, the intial issue with VSP Vegetation Mask Lines, and in the new post the Biome Mask Area option in VSP.

    Vegetation Mask Lines: Because this works well in the demo scene for you too, this is perhaps related to the inner workings of VSP. It is hard for me to further comment on this without being able to recreate the situation where trees are still visible on the roads. If you want you can email a project / scene in which this is reproducible.

    Biome Mask Areas: This should work as well in general although I belief there can be issues with circular road sections. So further details, Biome Mask Area settings and the road shape would help here.

    Thanks,
    Raoul
     
    joanpescador likes this.
  20. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    I will but have to find the way to isolate the indispensable from a 40gb project.
    Thanks,
     
    raoul likes this.
  21. Hiddendrag0n

    Hiddendrag0n

    Joined:
    May 21, 2019
    Posts:
    3
    hello,
    after easy road build when I move camera terrain overlap the roads (some places of the terrain), can someone please tell me what i m missing or is there any setting that i can tweak to remove this issue.
    thanks in advance
    Screenshot 2022-03-21 192719.png Screenshot 2022-03-21 192807.png
    Screenshot 2022-03-21 192719.png Screenshot 2022-03-21 192807.png
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi Hiddendrag0n,

    The same issues is visible on all 4 images, it looks like z-fighting with the terrain.

    I assume this is indeed in Build Mode after adjusting the terrain?

    In that case, what is the "Raise" value in the Inspector?

    And especially for the road object, is the "ER Road" shader used? What are the "Terrain Z-Fighting Offset" values visible further below in the road material in the Inspector?

    Thanks,
    Raoul
     
  23. Hiddendrag0n

    Hiddendrag0n

    Joined:
    May 21, 2019
    Posts:
    3
    after tweaking Raise value and ER shader Z- offset problem is solved, Thankyou
     
    raoul likes this.
  24. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hey raoul,

    I wrote myself a tool that creates wires with Easy Roads for energy poles. It´s just a sideobject thats basically spawning a prefab with stuff every X meters. Now I am facing a small problem. In real life or racing games, you can see that in curves, the power lines sometimes change the road side to save cabel. Is it possible to do this with ER right now?

    The red line is where I would like it to go.

    https://imgur.com/yHz8Zy4

    thanks
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hey Marcell,

    The position of side objects relative to the road can be set per marker, the "X Position" value in the Marker Side Object Settings. So that way it is possible to have a side object cross the road. For example in the image, these are the free demo package assets.

    powerline.jpg

    So it is possible to do that, and that is how the powerline visible in the screenshot was manually done just now.

    But in the v3.2 demo scene, this powerline preset is not used as a side object that is activated on road objects.

    A "Powerline" object preset was made for it, a "road type" that is marked as "Is Side Object" in the road types settings. That way no actual road mesh is created. Instead it will only create the powerline. By doing that there is no need to change X Position values per marker. As it is an object by itself, the marker positions can be used to control the spline curve.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  26. braur

    braur

    Joined:
    Jan 7, 2018
    Posts:
    7
    Hi raoul!

    I'm a programmer and in our current project we are using EasyRoads3D. The roads are already created in the scene and I want to get access to the road network via stripting API, but the documentation is so scarce in this aspect that I don't know where to start with this.

    Where do I get a reference for ERRoadNetwork to later call e.g. GetRoads() or GetConnections() methods?

    ERModularBase has dozens of methods and fields but the class is not documented at all.
    ERRoadNetworkObject is a misterious black box with no acces to ERRoadNetwork

    Is there one ERRoadNetwork on the scene or there are multiple?

    I don't see the connection between numerous components on the objects in the scene and the few classes listed here http://www.easyroads3d.com/v3/html/scriptingAPI.html.

    Please give me something to start with :)
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hi braur,

    There can only be one road network object in the scene.

    So when a road network object already exists, the ERRoadNetwork constructor will create a reference to this road network:

    ERRoadNetwork roadNetwork = new ERRoadNetwork();

    That is it :)

    After that you can do for example:

    ERRoad[] roadObjects = roadNetwork.GetRoads();

    Thanks,
    Raoul
     
  28. braur

    braur

    Joined:
    Jan 7, 2018
    Posts:
    7
    Thanks Raoul, it works as you described :)

    That's sufficient info for me at the moment.

    BR!
     
    raoul likes this.
  29. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    I tried to build a simple project with URP and unity 2021.2.16f1 and got a lot of build errors related to the easyroads shaders. Is this something you can take a look at?
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hello Innovine,

    What errors do you get?

    In general the current URP shaders do work in 2021.2 like they did for similar projects in previous URP versions, but in the new URP version does include updates like for example support for the deferred rendering path. The shaders are being updated to this.

    Thanks,
    Raoul
     
  31. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Hi, I'm using Unity2022.1.0b13 + HDRP13.1.7 + EasyRoads3D Pro v3 v3.2.1f2, I can't add markers, is there a way to fix this?
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614

    Hi AngelBeatsZzz,

    There is an issue in the current Unity 2022.1 beta with switching to Build Mode to adjust the terrain to the road network shape. This will be fixed in the next update.

    Adding markers however should work fine. Do you see the road markers, are they selectable? Or is this a new project without any road objects in the scene yet? In that case, can you try this in the small demo scene part of v3.2.1f2?

    When the road markers are not visible, can you check the status of the Gizmos tab, is it active? This should be the case to show the road markers in the scene, but also to Add road markers. It is active by default.

    Thanks,
    Raoul
     
    AngelBeatsZzz likes this.
  33. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    You are right, markers can be added when Gizmos is enabled, thank you.
     
    raoul likes this.
  34. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    Here trying to advance in the process of moving road sections between scenes by:
    1 roadNetwork.CenterPivotPoints();
    2 Store Mesh Assets in Project Folder
    3 Finalize the roadNetwork.
    4 Save prefabs.
    It work find until here but now I include vegetation's biomes from VegetationStudioPro through VegetationLineMask and I have this weird behavior when I change the CenterPivotPoint:
    upload_2022-4-3_14-53-49.png

    upload_2022-4-3_14-54-51.png
    The yellow line has a desplacement and vegetation have lost the position reference of the road.

    I guess that the yellow line is the reference for the vegetation line mask?
    What can be the reason that the vegetation line mask changes his position?
    Do you think there will be a way to keep the vegetation line mask attached to the road section when you change the CenterPivotPoint?
    Maybe is there a way to change mannually the CenterPivotPoint of the VegetationLineMask?
    Thanks,
    Joan
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hello Joan,

    Step 3. Finalize the roadNetwork.

    With this step your work with EasyRoads3D is finished, all EasyRoads3d script components are removed it is no longer possible to make changes to the road network and that includes EasyRoads3d changes that affect Vegetation Studio. So, I think this is not the workflow you want.

    I am not sure how CenterPivotPoint() is involved here because that is a scripting API options. That will only work when all script components are still present.

    Other than that, EasyRoads3D does not draw yellow lines. The Vegetation Mask Line component is a Vegetation Studio component. And I don't know the inner workings of Vegetation Studio. I would have to see if CenterPivotPoints() affects the VegetationLineMask component sentings.

    Thanks,
    Raoul
     
    joanpescador likes this.
  36. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    All right.
    You give the clue. If is not ER related, what I did is simply call CenterPivotPoints() before add the vegetation. Then, vegetation biomes just use the centered pivot point reference.
    Its works fine.
    Thank you very much,
    Joan
     
    raoul likes this.
  37. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, I have a simple question but I prefer to ask than to have troubles later.
    I'm going to use two scenes in my project: one for terrain and one for the road network, because the terrain is huge and made by many different tiles and having two separate scenes would help me in editing.
    Could this choice give troubles later or is ok proceed in this way?
    Thanks!
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hello tomobiki,

    The road network and terrain object(s) can be kept in different scene files both loaded in the editor.

    Thanks,
    Raoul
     
  39. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Thanks!!!
     
  40. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    HI, I'm experiencing a strange issue with the railway that is in the demo pack.
    In the first picture you can see that I have two train rail in my scene: one ont right that is correct and one on the left that (and this is the issue) has been created without the rails but with the texture of the rails placed over the base of the railway, and I get the warning in the bottom of the screenshot that says: "Unable to open Assets/EasyRoads3D Assets/RailRoad/Secondary - Train Rail.obj: Check external application preferences."
    This warning is actually quite weird, because the file "Secondary - Train Rail.obj" is actually where it should be (second screenshot) and I don't understand what does it mean for "external application preferences" as that there are no external applications that are using that file.
    In the meanwhile I noticed that in the General Settings / Road Type tab it has appeared an option that before there wasn't (third screenshot) that is the UV editor for the road type.

    I have this issue with two different projects: the first is the one where I'm working on, while the second is a clean project that I've done just to test the railway (the screenshots I publish come from this clean project).

    So I'm confused because I don't understand where is the problem: somehow the road type has "lost" the rails meshes and has put the rails material over the base of the railway. The strange thing is that this issue is on both the projects, also on the clean one that I made just on the purpose to understand the issue.

    I tried also to reimport both the EasyRoads3D and the Demo package, but nothing changed.
    I'm using Unity 2021.3.31 and URP 10.8.1

    Please, could you help me to manage this problem? If you want I can send to you the project.
    Thanks.



    upload_2022-4-5_11-41-43.png upload_2022-4-5_11-42-55.png upload_2022-4-5_11-43-25.png
     
    Last edited: Apr 5, 2022
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hello tomobiki,

    The second image shows the previous railroad prefab, not the current prefab which was also used in the Custom Connection tutorial video.

    Have you looked at this concept of Custom Connection prefabs by for example watching the specific tutorial video about Custom Connection prefabs based on imported models?

    The UV Editor in Road Types that you mention should not be used in this case. That is for built-in road types not road types derived from imported Custom Connection prefabs like this Railroad example.

    So it seems the UVs of the specific Railroad preset in your project are incorrect.

    Can you try dropping the Railroad crossing prefab in the scene from the Custom Connections tab in the Inspector and pull out a railroad from the specific railroad connections. Does that work well?

    Thanks,
    Raoul
     
  42. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, thanks for your fast reply.
    I watched the video about custom connections and I checked that the rail road connection was correctly set up (even if I noticed that the name of the meshes and of materials are somehow different from the ones in the video). However the connection was correctly set up, then I instanced a connection and pulled the railroad out of it and you can see the result in the screenshot.
    I'm pretty sure that the problem is in the railroad mesh, even if I don't know how to manage it. The strange thing is that this happened in both projects: the first railroad I instanced was correct, and tthe second appears in this weird way.

    In the second screenshot you can see the detail of the junction. I don't understand what happens to the two rail tracks.

    When I try to reimport the demo package it package manager shows the railroad prefabs as non changed and doesn't let me to reimport them.

    Maybe could it be a problem with the version of Unity 2021.3.31?

    Thanks.




    upload_2022-4-5_23-4-11.png upload_2022-4-5_23-4-47.png
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Hello tomobiki,

    The Railroad prefab is only used in the Custom Connection Editor to extract data required to set connections where road objects and railroad objects should connect. After that the prefab is instantiated as it is and is no longer involved for creating the actual railroad objects. It is the connection data that seems incorrect.

    Have you tried recreating the railroad preset following the specific tutorial? Drop the railroad prefab in the Custom Connection Editor window, set the two railroad connections, assign the railroad material, create a new "road type" for this railroad in the Custom Connection Editor window and in Road Type Settings assign the other railroad elements that are generated as side objects to this new road type.

    If you want you can email the project but that will probably only confirm what you are posting.

    Thanks,
    Raoul
     
  44. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Thank you very much Raoul for your effective help and support.
    This evening I'll follow your advice and I'll try to recreate the railroad preset following your instructions.

    Keep up the good work :)
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614
    Recreating the connections should fix the problem and since the tutorial about this uses the same assets, it is a quick simple way to get familiar with this specific feature, importing custom models / shapes into the system.

    Let me know if you are still having issues afterwards. I will check the specific railroad assets in the demo package, but I belief they work well. They are used in the previous v3.1 demo scene.

    Thanks,
    Raoul
     
    tomobiki likes this.
  46. jmclaveria

    jmclaveria

    Joined:
    Oct 16, 2018
    Posts:
    19
    Hi Raoul,

    I have been using Easy Roads for just one month but it just enough time to see the infinite posibilites for creating any environment. Thanks for creating this amazing tool!

    I have a problem with side objects, maybe you could help me. I'm trying to create "destructible" guardrails, I mean guardrail chunks that have their own Rigidbody and can be wrecked by the car. I created other destructible objects already, like warning curve signals, but this time with guardrails is different because they are created with "Side Object Type = Procedural Mesh Object" instead of "Side Object Type = Mesh Object", so the mesh is procedurally created and batched in one single mesh instead of many chunk meshes.

    Is there any way to create chunk meshes instead of a whole mesh using the "Procedural Mesh Object" method?

    Thanks in advance.
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614

    Hi jmclaveria,

    Glad to hear you like the tool!

    The Procedural side object does indeed generate a single mesh contrary to the "Mesh Object" side object. The two have different features, the Procedural side object generates the mesh along the spline with optional random offsets and rotations. This concept is not possible with the "Mesh Object" type which instantiates the prefabs / mesh as it is.

    How would you like to see this working? Optionally, generate unique meshes for each section?

    Thanks,
    Raoul
     
  48. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, I followed the tutorial and recreated the railroad from the railroad intersection, and now everything is ok, as you can see from the screenshot.

    The only mistery is how could this issue happen on two different projects at the same time (but maybe it's just me that am clumsy).

    Thanks :)

    upload_2022-4-7_22-37-24.png
     
    raoul likes this.
  49. Hiddendrag0n

    Hiddendrag0n

    Joined:
    May 21, 2019
    Posts:
    3
    Hi Raoul,
    I have one issue and one query
    Issue - After finalizing the road when I m creating a prefab of the road mesh is missing, after exporting obj same issue.
    Query - After finalizing the road it remove all the script from the easyroads is there a way to go back to edit mode in easyroad after finalize ?
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,614

    Hi tomobiki,

    Glad to hear you were able to get it to work by regenerating these connections.

    I don't know what happened in your project. First thoughts are that either importing the specific preset in the scene did not work well or, as mentioned before, the connection settings were incorrect which can happen when the shape /UV settings are changed for the specific road type.

    Thanks,
    Raoul