Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    URP and HDRP is material related. By default the package includes a set of shaders that work for a standard Unity 3D project. The additional URP and HDRP packages include matching shaders but for the respective project type.

    So materials in the v3.2 demo scene will auto update. This is not the case for the v3.1 scene because the shaders do not match.

    In that case, yes, it is a matter of assigning new v3.2 shaders. For standard roads including those that use the older "EasyRoads3D - Unity Standard 2018+" shader the "ER Road" shader can be used. For dirt tracks the "ER Road Dirt Fade In - Out" shader. For decals, the "ER Road Decal" shader.

    If you want to update these older assets to URP you may want to create a new standard 3D project and import the same Demo Project package. All materials will work and you can see which textures are assigned. This can be used as a reference to update the same materials for your URP project if necessary.

    Thanks,
    Raoul
     
  2. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Thanks Raoul - I'll go through and reassign the shaders. Thanks for the help resolving this.
     
    raoul likes this.
  3. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    One further quick question - is there a way to add the retaining wall to a junction crossing, like the example below:

    upload_2021-10-15_14-38-41.png
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Not yet, currently side object are roads only but this is being worked on. The side object will continue on the junction when it is also active on the road on the other end.

    But side objects can also be generated by themselves without a road involved. So meanwhile an additional section for the junction could be created. Or, the road could first continue with no junction inserted and with the retaining wall. Then move the retaining wall out of the road network hierarchy so it is no longer updated and insert the junction at the same spot.

    Thanks,
    Raoul
     
  5. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Thanks Raoul

    What I ended up doing is reducing walls and just ensuring the junctions are alighted to the terrain so there is no need for walls in those areas.
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Yes, that is the current workflow. And that way, with the v3.2 retaining wall example which has "Auto Generate" active, the wall should actually not appear on the road section near the junction when both the road and the junction are aligned with the terrain.

    Thanks,
    Raoul
     
  7. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    Hello, @raoul !

    I've been using EasyRoads3D for a few years now and have been running my project with HDRP for a year minimum, running EasyRoads with the proper SRP Support Package and NatureMAnufacture hdrp asset.

    I only recently ran into a breaking bug with ER which prohibits me from creating any new road objects, no matter if I'm in a "clean" scene with no previous road network or in one with an existing road object. I attempt to create the new road object by shift + left clicking but this always results in me selecting the terrain object. I've attempted to remove my installation of ER (unsure what the exact steps are to completely remove everything ER in the project) and re-install but this did not solve the issue. I updated ER to latest 3.2.x which did not help either. Thinking of upping to 3.3.x but not sure where I find my serial key?

    In short, I am at a loss as how to fix the issue and get ER working again. Don't know if this helps, but I suspect that it might have to do with me fiddling with a few shaders and materials to get the unsupported road types working with HDRP. Other than that.. could it be a conflict with another asset/tool?

    Thank you for any and all assistance with my query.
     
  8. raoul

    raoul

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

    Somewhere late Unity 2018, early Unity 2019 changes were made to the Unity editor setup. Specifically the Gizmos tab in the top right above the Scene View window.

    When this tab is inactive, for example the road marker handles will not be visible and a known side effect is that Shift + Click to add road markers will fail resulting in exactly what you describe, the terrain being selected which is default behaviour when clicking an object in Unity.

    So this Gizmos tab should be active, which is the case in a standard Unity setup. Could you check that?

    Thanks,
    Raoul
     
  9. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Hi, @raoul !

    Unity 2020.3.11f1, ER3D v3.3.b2

    Recently i found a bug with long roads (i.e. > 1.5km) when UVs are broken in PC/win build on spline points (only in build, not in editor/play mode).
    I fixed it by splitting the roads with I-connectors.
    Currently i found the same bug on recent scene, tried to split the road, but got unrecoverable behaviour (See attached image).
    closed-track-bug.png
    I tried to close the road after splitting. Now i can't select the last spline point because of errors in console: ArrayIndexOfBounds and "Please update the Road Network: General Settings > Scene Settings > Refresh Road Network".
    BTW, "Refresh road network" is not good for me, because i already have custom settings for each splitted roads. But anyway, "Refresh" doesn't help.

    Other less significant bug: when i adding I-connectors, they have wrong rotation (See 2nd image).
    i-connector-rotation-bug.png

    Could you please suggest any fix for this behaviour?

    UPDATE: after receiving console errors, all Unity UI became unusable (no response on user actions, only errors in console)

    UPDATE#2: example of console error
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3. System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    5. EasyRoads3Dv3Editor.OQDDCQQQOO.OnSceneGUI () (at <2b8fcf079eb34c98b3b444b04cce1944>:0)
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    7. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
     
    Last edited: Oct 18, 2021
  10. raoul

    raoul

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

    Yes, UV issues on longer roads that are not split by inserting connection objects can be resolved by inserting I Connectors.

    Another way to fix this is by changing the Unity project settings. This texture stretching happens because of floating point inaccuracies in the final build which can be resolved by switching off compression of the UV ccordinates: Project Settings > Player > Other Settings > Optimization > Vertex Compression > Tex Coord 0

    It is hard to comment on errors without being able to look at this. Have you tried Undo? Can you provide exact steps how to reproduce this or email us a scene in which this happens so we can look at it?

    The I Connector works as a connector without a mesh. By rotating it and using the same rotation values as on the road sections, these road sections will align.

    What is this related to? When exactly does this happen?

    Which version are you using? This is visible in the most right Info tab.

    Thanks,
    Raoul
     
  11. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Thanks!

    Yes, but anytime i pressed Undo some weird behaviour occurred: i.e. trying to undo move of spline point lead to undo adding of the road or undo adding spline point.
    Sounds good, but seems, I-connectors has it's own vertices. For typical case: (1) end of road point with angle -10 degs, (2) I-connector (3) start of road with angle -10 degs. I-connector has some rotation (Local transform origin not aligned neither with World Coordinates nor with road direction). And road mesh became stepped both in edit mode and after "Build terrain".

    I can't figure steps to reproduce. Just build the road about 10km with 20 rotated markers (+/- 10 degrees), with different height and try to split it.
    As i wrote in message above:
    Unity 2020.3.11f1
    ER3D v3.3.b2

    BTW i restored road by randomly adding and removing markers, by removing and building again part of the road and several restarts of Unity. The only things remaining are:
    1. bug with side object positioning near the I-connectors
    side-objects-bug.png
    2. wrong UVs in editor after building the road (not related to UV compression in game build)
    wrong-uvs.png
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Especially when using betas could you please always update to the latest version? v3.3.b4 in this case.

    I would try to avoid using and I Connector on a road section that is also using road tilting, especially when both road sections use the same material like in the screenshot in your previous post.

    But it can be done:

    iConnector.jpg

    For both images it is hard to tell what is wrong.

    The side object shows a situation that technically could result in that side object shape. So more details would be useful here. Because the image is zoomed in, what is the exact road shape? In what way does the side object not match up en what are the side object settings?

    For the road I see a line marking that could be off, what is the exact road shape here? Do triangles overlap?

    Thanks,
    Raoul
     
  13. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    In future i will not split the roads, but will disable UV compression :(
    Not sure it'll be easy to switch now from 3.3.b2 to 3.3.b4 for current project, so will leave it as is.

    Image is not zoomed, just screenshot of part of Unity screen. It's a standard side object "Wall Fence", settings are only set to shift side object from the road (15 or 30 units).

    It's just a smooth turn, not triangles overlapping, even no surrounding shape overlapping. Problem was only with LODs enabled (default 4 LODs). I disabled them and side line became smooth.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    3.3.b4 has more features and is more stable then 3.3.b2. You could first backup the project so you can always fallback. Backing up projecta before upgrading is recommended anyway.

    Only a small portion of terrain and the side object is visible, that is what I meant. All I see is a terrain that changes height and a side object that follows this height change. Side objects can be set to snap to the terrain height resulting in this shape. But this is not the case with the "Wall Fence" preset which should align with the road edge when the default settings of this preset are used.

    Below are two screenshots, the original settings and with "X Position" shifted 5 units with a gap between the road and the wall. The walls on both roads are aligned with the road and connect well at the I Connector position in both cases.

    WALL_FENCE1.jpg

    WALL_FENCE2.jpg

    But in general, you probably want to insert I Connectors, if needed, at strategic positions. More straight road sections not involving side objects.

    Ok, so this is LOD related, what LOD level was this? Because the highest level uses the original mesh.

    Thanks,
    Raoul
     
  15. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    I'm positive this is the case. I clearly remember turning gizmos off to disable wire view when working on level design.
    Thank you, Raoul, for quick reply and the most welcome solution to my issue. Was a real headscratcher.
     
    raoul likes this.
  16. raoul

    raoul

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

    Glad to hear that. Keeping the Gizmos tab itself active and disabling "Selection Outline" and / or "Selection Wire" should work just fine.

    Thanks,
    Raoul
     
  17. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Terrain originally was smooth, Wall Fence is within road surrounding. So it seems Wall Fence was deformed by road deformation (I-connector or not idk) and terrain was deformed after. Surrounding nevertheless was smooth.
    Anyway, artifacts on side objects are accetable for given part of road and i post-processed terrain after build of the road.

    It was a screenshot of closest view, so it was a maximum LOD level. Probably LOD generation was broken by earlier errors.

    For now i'll leave all as is and will try 3.3.b4 for next tasks.

    Thank you!
     
  18. raoul

    raoul

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

    In the two images I posted, the wall fence object exactly follows the road. So it is hard to give feedback without knowing the exact situation if you see something else on your end.

    I would certainly recommend to try the latest 3.3 beta.

    Thanks,
    Raoul
     
  19. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    90
    Hello I am wondering if there is an easy way to build a road on a terrain using a simple list of coordinates, I mean something like this :
    43,8883293;3,6241629
    43,8882337;3,6239568
    43,8881526;3,622534
    43,8881571;3,6221512
    43,8882243;3,6211806
    ...

    And 2nd question : Do playmaker actions exist for Easyroads3D ?
    Best regards, Phil
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello Phil,

    Where do you get these coordinates from? EasyRoads3D can import OSM and KML files.

    Also, the scripting API can be used to create roads through code. The main EasyRoads3D Pro package includes a runtime example where a road is created from code. But in your case the coordinates you posted should first be converted to Unity units.

    I am not familiar with Playmaker, but as mentioned the scripting API can be used to create roads from code, just two lines.

    Thanks,
    Raoul
     
  21. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hello raoul

    I have a problem, the connection are disappeared. i dont know why happened this.

    thanks

    ********fixed*********

    2 terrain in scene
     

    Attached Files:

    Last edited: Oct 20, 2021
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hello claudius_I,

    ********fixed********* , so indeed the problem is resolved?

    I can see the error happens in code that will check for changes in the terrain setup. Code that also collects the different Terrain Layers which is used for the road shape bake option in the terrain.

    Which EasyRoads3D version do you use? Because in previous versions this NullReferenceException happened when empty Terrain Layers are assigned to the terrain, the Layer actually does not exist or no texture is assigned. This NullReferenceException error should be resolved in current versions.

    And, 2 terrains in the scene is perfectly fine, EasyRoads3D supports a multi terrain tile setup.

    Thanks,
    Raoul
     
  23. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    90
    Thanks Raoul for your quick answer
    Unfortunately I am not very familiar with using API, even for 2 lines...
    Yes I know that kml can be used, but in my case I have a more simple file, with only the coordinates. I manage the data with BG Database, and I can use Vector 2 variables like "43.7789|3.456". I could convert my text files to get kml, but maybe you could add a feature (in a further version) to import a simple list of coordinates, as it is possible to import kml and OSM files.
    Best regards, Phil
     
  24. raoul

    raoul

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

    In your case the coordinates appear to be latitude / longitude coordinates, so they need to be converted to Unity units. OSM and KML files do have additional bounds info, that is why I mentioned this. EasyRoads3D will by default match these bounds with the terrain in the scene. And when the coordinates of the terrain are different, these coordinates can be entered so the road data can be parsed relative to these coordinates.

    An option for that can be added to the scripting API but as mention above a scale reference is required for that. So the coordinates can be converted to a Vector3 array, then the below can be used to create the road.

    Code (csharp):
    1. // Create a reference to the road network
    2. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    3.  
    4. // Set the road type
    5. ERRoadType roadType = roadNetwork.GetRoadTypeByName("your road type");
    6.  
    7. // Create the road, markers is the array of Vector3 positions
    8. ERRoad road = roadNetwork.CreateRoad("road name", roadType, markers);
    Thanks,
    Raoul
     
  25. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Yes, i deleted the second terrain.


    3.2.0.f15

    The second Terrain was broken (this terrain was imported in a prefab), i think this was the problem. now work well

    Thanks raoul :)
     
    raoul likes this.
  26. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi @raoul ,

    I am not up to date right now and just want to ask if ER already has some kind of organisation for the created RoadType selection. I know I will get to the point where I have more than 100 road types, and I can´t imagine building my map without having some kind of folders / cathegorys to unfold for the Road Type / Side Object selection.

    Best Regards
    Marcell
     
  27. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Hi, is there a way to use this with splines exported from OpenStreetMap?
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi @Marcell,

    v3.3 has options to select the type of road or catgeory. Current options are: Motorway, Motorway Ramp, Primary, Secondary, Tertiary and Path.

    Is that what you are looking for? Currently all road types are still listed in one dropdown but this could be handled in a similar way as for the Side Object category tabs.

    Thanks,
    Raoul
     
  29. raoul

    raoul

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

    Do you mean OSM data files? That is possible: General Settings > Import Road Data

    OSM road types can be linked to EasyRoads3D road types and specific OSM road types can be excluded. After that it is only a matter of importing the data file.

    Optionally it is possible to enter latitude and longitude coordinates matching the terrain when the terrain bounds does not match the bounds in the OSM file.

    Thanks,
    Raoul
     
    hakankaraduman likes this.
  30. marcell123455

    marcell123455

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

    Yes, this is kinda what I had in mind. I just think it would make sense to create own cathegorys. I personally would create usual roads for 2, 3, 4 lanes then versions that support both driving directions and one way direction, I would create versions of them for city, countryside, and highways, and all these versions would have extra versions like clean, desert, snowy. and then I would create extra tunnel and bridge roads etc... This multiples up really fast, So having pre made cathegorys is, nah. I wouldn´t know how to add them all correctly into the options you mentioned.

    thanks
     
  31. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    And yes, the dropdown is what I am talking about. ;)
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The reason for these road type categories is to have them interact in a logical way on intersections among others.

    I will make a note of your request for custom categories.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  33. marcell123455

    marcell123455

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

    even if custom cathegorys aren´t a thing in the future, I could imagine it would be a huge help if it was possible to set the display order of the road types / side objects within these pre set cathegorys!

    thanks
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, this should probably not become too overly complicated with different category systems. But it could still be done in a way like "advanced" options where this feature can be activated. And when activated there will be controls to manage these categories and display them accordingly.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  35. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354

    Thanks for the response.

    After importing OSM data, It overlaps roads without putting a default intersection. Do you have any tips on improving this workflow? Even if it inputs default t or x intersections, it would increase the workflow a lot, otherwise it becomes removing all of the roads one by one and adding them back.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello hakankaraduman,

    Real world situations can be very complex. That is why automatically inserting intersections is not active yet. This will be improved and activated as more built-in intersection options are added. The v3.3 Flex Connector and support for motorway exits will already be a big step forward.

    Inserting standard X and T intersections is actually implemented. It is experimental and can be activated by setting the static bool "buildIntersections" in the parserTest component to true. As mentioned, real world situations can be complex, inserting these X and T intersections should work fairly well for maps with only this type of intersections. Expect the unexpected for maps with complex situations. :)

    Intersections can always be added manually. In that situation I am not sure what you mean with this? Why is it necessary to remove roads and add them again? Intersections can be inserted at any marker positions and roads can also be split when that is necessary.

    Thanls,
    Raoul
     
  37. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Thanks for the explanation. I didn't explain good enough the second quote, but I understand you.

    Is there any ETA for 3.3? I'm sure that's already been asked a lot of times.
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    V3.3 is released in betas available on our website.

    But the state of OSM data import and inserting intersections is the same as the current v3.2. And there is no ETA for the final release yet because there are still some features to implement.

    Thanks,
    Raoul
     
  39. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hey @raoul
    I have another question. Is it possible to get the reference of a connected road/s from a custom connection prefab?

    I am currently spawning some traffic waypoints using the sideobject feature and because my connection prefabs also have pre set lanes it would be cool if I could write a script that connects my waypoint lanes of my road and connection prefab. This could save me a ton of time.
     
  40. raoul

    raoul

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

    GetConnectionCount() in the ERConnection class can be used to get the number of connections. public ERRoad GetConnectedRoad(int index, out ConnectedTo connectedTo) can be used to get the road (ERRoad) and at which side of the road it is connected, start or end.

    There is also public ERConnectionData[] GetConnectionData() in the ERConnection class which returns all connections. One of the properties in ERConnectionData is "road" (ERRoad).

    What type of connection prefabs do you use? V3.3 includes new road type options to set lane info. Lane data is generated on both roads and intersections.This can also be used to spawn traffic waypoints. Currently Flex Connectors and X and T Crossings are supported. Lana data on custom connections based on imported meshes will also be supported.

    Thanks,
    Raoul
     
  41. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    I am just using usual connection prefabs, not the flex connectors *yet*. Is version 3.3 flex connector fully functional? What about highway ramps? How do sideobjects like sideways act in a flex connector?

    Thanks ;)
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Are you using the the dynamic v3.2 connectors? The road data described in my previous post is supported on these prefab types. You could give it a try in a new project. The v3.3 beta package includes a small demo scene and a runtime script using this data to move objects along the roads and intersections. These are Flex Connectors but you can also easily test this with v3.2 X and T crossings.

    v3.3 Flex Connectors are fairly stable especially when the same road type is used. There is still some work to do regarding triangultion when different road types are involved, especially when the road widths of the involved roads are significantly different.

    Highway ramps is not part of the beta yet, it is being worked on.

    Sideways / sidewalks are not the same as "side objects" as used in the tool. This works independently from the EasyRoads3D Side Object systems and this also gets an upgrade in v3.3. It is in preview state in the current v3.3 beta. The next beta, soon available, will have new crosswalk features. And all this is supported on the Flex Connector, check the current beta scene.

    Thanks,
    Raoul
     
  43. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi Raoul,

    I still use v3.2.0f4. The thing is, I know the flex connectors / the new ER version has lane support that would be very useful in my case, but I don´t really want to use the flex connectors if it´s not production ready. For now I created custom connection models in blender, set them up and I am happy with it. It works fine. I´ll try out the functions you mentioned above to get the connected roads of a connection prefab and if I can set it up, I´m fine. I guess it makes sense to at least upgrade to the current asset store version. And I will upgrade again when it´s possible to sort road types within a cathegory as mentioned above.

    thanks ;)
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    That is why I asked which types of connection prefab you are using. This new lane data system is not yet supported for your connection models made in blender. It will be added.

    And as mentioned this v3.3 lane data system is also supported on the X and T crossings in the current v3.2.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  45. LuoriverStudio

    LuoriverStudio

    Joined:
    Aug 10, 2020
    Posts:
    1
    Hi there,
    Question about HDRP
    In fact, I bought EasyRoad a long time ago, I want to try to use EasyRoad in the Unity2020.3LTS (with HDRP10.6) today, I saw the update instructions said that HDRP is supported, and I also saw HDRP10.3+ package in the folder.

    I installed the DEMO HDRP 10.3 and HDRP 10.3 packages, and updated the project materials to HDRP material according to the instructions in the root directory (Edit> Render Pipeline> HD Render Pipeline> Upgrade from Builtin pipeline> Upgrade Project Materials to High definition Materials). But there are still many materials that are incorrectly colored, they appear as onion red. Is there a mistake in my operation?

    Used V3.2
     
  46. raoul

    raoul

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

    Are you referring to the HDRP readme in the project folder? Because it also mentions that HDRP is supported for the assets in the v3.2 demo scene.

    The older v3.1 demo scene that is still part of the package is not optimized for HDRP so assets in this scene that are using custom shaders which cannot be auto upgraded by Unity will indeed appear in union red / pink. It is a matter of assigning the v3.2 EasyRoads3D shaders to the materials.

    Can you compare the assets with pink materials with the assets in the v3.1 and v3.2 demo scene? If these are v3.2 assets than it seems that indeed not all materials are upgraded. But first thoughts are that these are v3.1 demo scene assets.

    Thanks,
    Raoul
     
  47. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hi @raoul ,
    currently I am writing a few editor scripts, and everything works fine. But is it possible to call a function in my script if a road is docked to a connection prefab with ERCrossingPrefabs script?

    thanks ;)
     
  48. raoul

    raoul

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

    Not directly, but in the ERRoadNetwork class:

    public delegate void RoadUpdateCallback (ERRoad road);
    public static RoadUpdateCallback onRoadUpdate;

    So you could call your function after a road is updated and check for new connections to a connection prefab.

    Thanks,
    Raoul
     
  49. marcell123455

    marcell123455

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

    sounds good, but to be honest, how do I use this? Never used such callback functions before. Could you write a small example please?

    thanks ;)
     
  50. raoul

    raoul

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

    It is already late near midnight over here, and I don't have an example ready here to copy paste, but the free (you do have Pro :)) demo package, https://assetstore.unity.com/packages/tools/terrain/easyroads3d-demo-project-105045 , includes an example how to use this /Assets/EasyRoads3D/scripts/ERCallback.cs

    Can you import this package in a new project and check that? Otherwise I will post an example tomorrow.

    Thanks,
    Raoul
     
    marcell123455 likes this.