Easyroads3D V2 Manual


1. Quick Start
2. Download files
3. Add the EasyRoads3D tool to your project
4. EasyRoads3D Menu
5. Getting started creating a Road

6. General Settings
7. The River Object
8. Side Objects
9. Procedural Mesh Object
10. Useful Notes / changes to previous versions
11. Error Messages
12. Troubleshooting
13. To Do / Known issues


 

QUICK START

1. Import the EasyRoads3D package in your project. More Info...

2. You will see a new menu item "EasyRoads3D" in the top horizontal menu under GameObject > Create Other > EasyRoads3D. Select "New EasyRoads3D Object" from the EasyRoads3D menu. In the window that will appear you can select the object type and you can set the name for the new object. Select "Road Object" as the object type and optionally change the name that is displayed by default. More Info...

A new EasyRoads3D road object with the name you entered is created in the scene hierarchy. It will be selected automatically and in the Inspector you will see the EasyRoads3D Toolbar. More Info...

3. Select the most left "Add Markers" tab, hold the [Shift] key and click in scene view on the terrain where you want to start the road. Continue adding markers by holding the [shift] key and clicking in scene view on the terrain defining the shape of the road. These are the control points that will define the shape of the road. After placing 3 markers they will start to connect. The white surfaces represent the shape to which the terrain will be adjusted. The road mesh itself will also become visible. Please click here if at this stage you cannot see the road and white surface mesh. More Info...

4. Click the middle mountain (Level terrain) tab in the above toolbar to start deforming the terrain heightmap according the road shape. This may take a while depending on the road shape, length and the terrains heightmap resolution. When finished, the white surfaces will disappear and the terrain will match the road mesh.

You have created your first road with EasyRoads3D!

You can now tweak the final build settings for the road and the terrain. Or you can click the middle mountain tab again to switch back to Edit Mode and add more markers, Insert Markers or tweak marker specific settings (Full version & Pro only).

After getting familiar with all these road specific features it is time to start with the Side Objects features. (Full version & Pro only) For this it is recommended to have a close look at the demo project. It includes various type of ide objects. You can see how they are build in the Side Object Manager and how they are used in the scene regarding marker specific settings and side object specific Inspector settings.

 


 

DOWNLOAD FILES FROM www.unityterraintools.com

The zip file contains the following items:

1. EasyRoads3D.unityPackage
2. Manual
3. licence


 

ADD THE EASYROADS3D TOOL TO YOUR PROJECT

This applies to packages downloaded from our website. Assetstore packages should directly import.

Menu > Assets > Import Package > Custom Package...

This will open the file dialog window. Browse to the EasyRoads3D folder and select the EasyRoads3D.unityPackage.

Tip: Put the EasyRoads3D unityPackage in the folder Unity\Editor\Standard Packages. You will be able to include it to new projects just like for example the Standard Assets and Toon Shading packages

All necessary assets will be imported in your project. A new menu item EasyRoads3D will be available in the top horizontal menu under GameObject > Create Other > EasyRoads3D. Click on an empty area in the top menu bar to update it, if the EasyRoads3D menu is not yet visible in that sub menu.

After creating your first road object and selecting this object you will be asked to enter license info:

Fill in your serial number, your name and email address. Save the scene and RESTART Unity after you received the confirmation that registration was successful.

NOTE: make sure that the project Build Settings are NOT set to Webplayer, it will not be possible to connect to the server. Just set it temporarily to Standalone. You can switch back to Webplayer after registration.

NOTE: The free version does not require registration.

 

NOTE: The free package does not require registration!



 

EASYROADS3D MENU

You can find the EasyRoads3D Menu in the top horizontal menu under GameObject > Create Other > EasyRoads3D

1. New EasyRoads3D Object
2. Backup Terrain Height Data
3. Restore Terrain Height Data
4. Backup Terrain Splatmaps
5. Restore Terrain Splatmaps
6. Backup Terrain Vegetation
7. Restore Terrain Vegetation
8. Side Objects (Full version & Pro only)
9. Build EasyRoads3D Objects (Full version & Pro only)

 

1. New EasyRoads3D Objectæ

Select this menu item to add a new EasyRoads3D road object to the scene.

A dialog window will appear where you can set the name of the new object and select the type of EasyRoads3D object, road or river. After clicking the "Create Object" button the new EasyRoads3D object will be added to the scene.

After the road object is created some other processes are executed. A temporary script will be attached to all terrain objects. This script is used to identify the terrain. Backups of the original terrain height data and splatmaps will be save in the folder EasyRoads3D/<terrainid> and can be used at any time to restore the terrain at any stage to its original state.

2. Backup Terrain Height Data (Full version & Pro only)

Execute this option to update the terrain height data backups after making changes to the terrain. You will always have a fresh backup of the terrain height data!

3. Restore Terrain Height Data (Full version & Pro only)

Execute this option if you want to restore the terrain height data to its original state. Terrain height data is automatically restored when switching between Edit and Terrain mode.

4. Backup Terrain Splatmaps (Full version & Pro only)

Execute this option to update the terrain splatmap data backups after making changes to the terrain splatmap(s). You will always have a fresh backup of the terrain splatmap(s)! In the case of multiple terrains in the scene, first select the terrain you want to backup otherwise the terrain selected in General Settings will be backed up.

5. Restore Terrain Splatmaps (Full version & Pro only)

Execute this option if you want to restore the terrain splatmap data to its original state. The terrain splatmap data is automatically restored when switching between Edit and Terrain mode. Optionally you may also select a texture with the manually edited road splatmap. The road shape will be blended in the terrain splatmap(s). In the case of multiple terrains in the scene, first select the terrain you want to restore otherwise the terrain selected in General Settings will be restored.

6. Backup Terrain Vegetation (Full version & Pro only)

Execute this option to update the terrain vegetation data backups after adding or removing trees or detail objects. You will always have a fresh backup of the terrain vegetation data!

7. Restore Terrain Vegetation (Full version & Pro only)

Execute this option if you want to restore the terrain vegetation data to its original state. Vegetation data is automatically restored when switching back from Terrain mode to Edit mode.

8. Side Objects (Full version & Pro only)

This will open the Side Object Manager. Use it to create and edit side objects.

9. Build EasyRoads3D Objects (Full version & Pro only)

Execute this option when you are ready with all EasyRoads3D terrain objects in the scene. If not already done, the terrain will be leveled according the created road objects, road geometry, side objects and terrain splatmaps will be created according the settings and all EasyRoads3D editor objects will be destroyed including the temporary script added to terrain objects in the scene. This process will also automatically save the road geometry in the folder project/EasyRoads3D/[roadname]/ under the same as the EasyRoads3D object name with "_final" added to it.

Tip: Make a backup of the scene with all EasyRoads3D objects. You will be able to fall back on it would you have to make changes changes.

NOTE: This action is permanent, all control data will be lost if you save the scene after executing this task! However should something go wrong or you do want to undo this action, do not save the scene. Instead open for example a new scene and then reopen this scene. All EasyRoads3D object should still be there.



 

GETTING STARTED CREATING THE ROAD

Select New EasyRoads3D Object from the EasyRoads3D Menu. A dialog window will appear where you can name the new road object. The new road object will be added to the hierarchy panel after clicking the Create Object button.

In the property Inspector you will see the EasyRoads3D toolbar:

 

ADD ROAD MARKERS

Add road markers by activating the Add Markers toolbar tab. Move the mouse to the position where you want the road to start and click the left mouse button while holding the [shift] key.

Continue adding markers according the shape of the desired road. You will see that the road system will create surfaces representing the road and the affected surrounding which are configurable in General Settings.

NOTE: Make sure the scene camera is in perspective mode when adding or inserting markers. In isometric mode the markers will be placed in the center of the screen!

Tip: For the best results (smoothly bending roads) and road shape control, add markers at more or less equal distances from each other. Avoid big irregular distances between consecutive markers.

 

INSERT ROAD MARKERS

Insert road markers works similar as adding road markers but instead of adding the marker at the end of the road, it will insert the marker between the 2 closest markers to the mouse position. Make sure you are in Insert Markers mode by activating the Insert Markers toolbar tab!

NOTE: In order to add or insert markers make sure is active!

 

MARKER PROPERTIES

Click on one of the generated surfaces to change its properties.

Soft Selection: When enabled for the selected marker all other markers within the entered soft selection distance will be affected to an extend as the distance to the selected marker.

Left/Right Indent. Use this feature to increase the distance between the road and the edge where the terrain has the same height as the road. This is useful in hilly areas to avoid the terrain break through the road because of the Unity terrain LOD system. (In the free version only the right indents are editable)

Tip: Sometimes you will see the terrain pop through the road. Usually this happens in case of significant height differences between the road and the original terrain height. Try increasing the indent values at these spots, you will probably get better results! It is also worth while to check the pixelError setting in Terrain > Settings. Higher values will result in the terrain popping through the road unless you raise the road far enough above the ground.

 

Left/Right Surrounding: This represents the distance used to level the area between the road and the current terrain height. This property gives you full control over the area around the road, especially in hilly areas. (In the free version only the right surrounding is editable)

Tip: It is recommended to experiment with the surrounding settings together with the soft selection tool. You can get spectacular results. It can be used as a terrain shaping tool by itself.

 

Left/Right Tilting (Full version & Pro only). This feature will lift the road up to a maximum of the road width minus 1 meter. You will get the best results when used together with the soft selection tool so the tilting affects all road surfaces in a bended road. (In the free version only right tilting is editable)

Refresh Surfaces (). By default the road surfaces will be updated instantly after changing one of the above settings. However when Auto Updates in General Settings is toggled off this will not be the case. Click the Refresh Surface button to update the surfaces manually.

Delete Road Marker. Clicking this button will remove the selected road marker.

Tip: Especially when using soft selection on a large distance repositioning can take quite some processing. If it runs too slow, press [shift] while moving the gizmo. This will only move the road markers. After releasing [shift] and the mouse button the surfaces will be updated.

 

Bridge Object (Full version & Pro only): Activate this toggle to create bridges. The terrain will not be deformed while the road geometry will still follow the marker positions.

Distribute Heights: This toggle is associated with bridge objects. Activating it will distribute the road surface heights evenly from the previous marker position to the terrain height at the selected marker position. This feature is useful to create realistic viaducts.

Creating Bridges

Simply select a marker, make sure the road surface area between this marker and the previous marker is raised above the ground and check "Bridge Object". You will see that the white surfaces disappear. This means that the terrain will not be adjusted for this part of the road. Alternatively you can check "Distribute Heights" which will gradually lower the terrain from the previous marker to the terrain height at the selected marker. The shape will be visually represented by the white surfaces. A bridge with distributed heights enabled, consists of at least 3 markers:

  1. The start of the bridge, "Distribute heights" checked, make sure this marker is raised above the terrain or just before something like a ravine where the bridge starts.
  2. One or more middle segments, with "Distribute heights" unchecked, make sure this marker is raised above the terrain
  3. The end of the bridge, with "Distribute heights" checked, at this point the terrain will be leveled up till the height of this marker.
Tip: The best workflow to create bridges is, first make sure the shape of the road that will cover the bridge is smooth. Afterwards check the bridge objects for the affected surfaces.

Note: You cannot set the first two markers of a road object as a bridge object. This is mentioned in the Inspector when selecting the first or second marker.

 

Start New LOD Segment (Full version & Pro only): In EasyRoads3d v2 you can create and save your road geometry in different LOD segments. Simply check this checkbox when you want to start a new road LOD segment at the selected marker. When rendering the road object you will see that the road asset in the hierarchy now has a number of child assets matching the number of LOD segments. Exporting the road geometry will save each segment in its own group. To create the geometry for your LOD system, export the road with a high resolution, rename the files, switch to a lower resolution and again save the road.

 

Additional Marker Functions

When two markers are selected you will see the below buttons in the Inspector:

Align XYZ: This will align all markers between the two selected markers on a straight line

Align XZ: This will align all markers between the two selected markers on the x and z-axis

Align XZ Snap Y: This will align all markers between the two selected markers on the x and z-axis and snap the y position to the terrain height at that position.

Average Heights: This will average the heights of all markers between the two selected markers.


Tip: Hold [ctrl] while moving markers to snap the marker to the terrain height at the new position.

 

SIDE OBJECT MARKER PROPERTIES (Full version & Pro only)

By default markers cannot be accessed when road objects are in render mode (see just below). However when side objects have been built in render mode you will see that the marker objects appear again. By selecting a marker you can adjust the side object settings for this marker for any of the available side objects. Depending on the type of side object you will see the following properties:

Selected Object: this is a combobox with all available side objects. Select the side object from the list you want to edit.

Display Object: Toggle this on/off when you want to render the selected side object for the selected marker.

Spline Node: Toggle this respectively on/off when you want to use this marker for the spline shape. The road scene in the demo project uses this feature for the "Right Fence" in the sharp corner. It cuts of a large part of the road shape. This allows you to create shapes that run independently from the actual road shape.

Distance Sideways: This allows you to move the spline path for the selected side object away from the road shape.



 

DEFORMING THE TERRAIN

Click the Level Terrain tab on the toolbar to level the terrain according to the created road and road surrounding surfaces. Depending on the resolution of the terrain and the size of the road this may take a while.

Click the Level Terrain Tab again to switch back to "Edit Mode" and continue adding markers or tweaking markers settings (Full version & Pro only).

Clicking the Terrain tab from the marker toolbar will select the main road object first. In this case, click this tab again to activate the terrain rendering.

NOTE: If you save a scene while an EasyRoads3D objects is in "Render" state and then close Unity, these objects will automatically switch back to edit mode after reopening the scene. This is to make sure the EasyRoads3D object is correctly initialized on startup and also to ensure that the original terrain data is preserved. It is therefor recommended to save your scenes with all EasyRoads3D objects in edit mode.

After leveling is finished the following properties will appear in the Inspector Panel:

ROAD GEOMETRY PROPERTIES

Render: When this property is toggled on, terrain matching road geometry will be created.

Material (Full version & Pro only): This will display the current road texture. Click on the texture to open the Road Texture Window. This will display all available road textures in the folder: /Assets/EasyRoads3D/Textures/Road Textures. You can add your own textures in this folder if you like to use this system. Below each texture you will see the supported shaders for this texture. Currently supported shaders are: Diffuse, Bumped Diffuse and Bumped Specular. The name convention is: texturename_d for the diffuse texture and texturename_b for the bumped texture. When the window opens, the above mentioned folder will be scanned and matching materials will be added to the dropdown box accordingly. Select the shader type and then click the road texture to assign it to the road material.

The folder /Assets/EasyRoads3D/Shaders/ contains 6 different depth offset shaders to make sure the road is rendered on top of the terrain. When using a low Field of View on the camera you may still encounter some z-fighting. In this case open the respective shader and tweak the two Offset factor and unit parameters (just below LOD) further downwards.

NOTE: Currently all road objects in a project use the same material. Changing the material on one of them will change the material on all other road objects. In the next version this will be handled per road object individually. Meanwhile you can manually create new materials or duplicate /Assets/EasyRoads3D/Resources/roadMaterial and assign different textures to them once the road is ready.

Blend the start and / or end (Full version & Pro only): This will blend the start and / or the end of the road with the terrain for a more fluent transition. When checked the below control will be enabled. See the below note regarding the shader requirements for blending.

Start Distance: the distance over which the road will be blended at the start

End Distance: the distance over which the road will be blended at the start

NOTE: For road blending one of the transparency shaders is required. Select the "road" game object inside the EasyRoads3D road editor object. In the Inspector look for the road material and choose one of the "EasyRoads3D/Transparent/" shaders from the shader dropdown. Also apply this shader to the following material in the project folder: /Assets/EasyRoads3D/Resources/roadMaterial so the transparency shader will be automatically applied on next builds. Please use the transparency shaders inside the Unity 3 folder if you are using Unity 3, otherwise the road will be invisible!

Road Segments (Full version & Pro only): The number of segments over the width of the road. When this number is larger then 1 you will see the following new properties:

  • Bumpyness: the height of the bumpyness
  • Bumpyness Offset: this controls the variation over the width of the road
  • Bumpyness Density: this controls the Variation over the length of the road

Resolution. This represents the geometry resolution of the road.

UVMapping. This allows you to control the texture mapping on the road.

Raise (cm).Represents how much the geometry is positioned above the terrain. On relatively flat surface 2 cm should be fine. Below 2 cm some terrain adjusting is necessary using the unity terrain tools at specific spots.

Calculate Tangents (Full version & Pro only). This will calculate the mesh tangents which is required if you use a bumped shader on the road mesh. This button is disabled when "Tangents" in General Settings is enabled.

Save Geometry (Full version & Pro only). This will create a .obj file of the road geometry with the name of the road object saved in the folder project/EasyRoads3D/[roadname]/.

Finalize Object (Full version & Pro only). This process does the same as "Build EasyRoads3D Objects" from the main EasyRoads3D Menu but only for this road object. It will unlink the road mesh from the EasyRoads3D object, rename it to the same name as the EasyRoads3D object and destroy the EasyRoads3D editor object. Note that after this process the road cannot be edited anymore. However you could try reloading the scene, the full road object should this be there unless you save the scene after this process.

NOTE: When exporting the terrain the geometry will match the position of the resolution slider!

NOTE: The road object created by EasyRoads3D includes uv2 coordinates matching the terrain boundaries. This will allow you to use the terrain lightmap on the road. Simply choose a lightmapped shader for the road material and drag the terrain lightmap in the lightmap slot of this shader.

 

TERRAIN SPLATMAP HANDLING

EasyRoads3D can embed the shape of the road in the terrain splatmap.

Apply Splatmap. When toggled on the road shape will be included in the terrain splatmap. You will have access to a number of splatmap properties.

Terrain texture. Select the terrain texture you like to use for the road shape. The splatmap features support terrains with up to 8 textures (2 splatmaps).

Expand Width: This will make the road shape wider. The actual sizes depends on the Control Texture Resolution of your terrain.

Smooth Level. This will smoothen the edges of the road splatmap slightly. Better results can be achieved in your paint program especially when you use a resolution of 512 or lower. The smoothing algorithm will be improved in next updates. You can find the raw road splatmap in the folder: project folder > EasyRoads3D > [road name] > roadSplatMap.png. You may edit it in your paint program and merge it with the terrain splatmaps.

Offset x/ Offset y. Especially when the Control Texture Resolution is low compared to the size of the terrain the road shape on the splatmap can be slightly out of position compared to the road geometry. Changing the Offset parameters may give better results. Alternatively and recommended, reposition markers to better match the terrain splatmap resolution or increase the Control Texture Resolution of the terrain.

Opacity. Controls the blend level of the road splatmap with the rest of the terrain.

Apply Changes. Click this button to apply changes made to above settings.

Tip: EasyRoads3D supports custom road splatmaps based on the raw shape of the road. You can find the texture with the raw road shape in the folder: project folder > EasyRoads3D > [road name] > roadSplatMap.png. You can modify it in your painting program, make it smoother, add detail, etc. Afterwards you can apply it to the terrain splatmap by running Restore Terrain Splatmaps form the main EasyRoads3D menu and choose Yes when asked if you would like to merge the terrain splatmap with a road splatmap. You can then select the modified road splatmap in the file dialog that will appear.

 

SMOOTH EDGES

This will smoothen the terrain near the indent edges to the left and right over the distance set in Distance (m). Click the "Smooth Edges" button to apply the smoothing.

 

SMOOTH SURROUNDING

This will smoothen the terrain near the surrounding edges to the left and right over the distance set in Distance (m). Click the "Smooth Surrounding" button to apply the smoothing.

SIDE OBJECT SETTINGS (Full version & Pro only)

When this road object has active side objects you will see a button "Built Side Objects". Click this button to create / remove the side objects.

Note: Click the "Terrain" tab once again (or any other toolbar tab) to switch back to edit mode.

Note: The quality/detail of the shape of the road in the splatmap depends on the Control Texture Resolution and the size of the terrain. Increase the Control Texture Resolution for better results. Or edit the splatmap in your paint program.

 

CAM FLY OVER (Full version & Pro only)

The cam fly over is very useful to quickly explore the roads directly in scene view.

Position: with the position slider you can control the cam position from the start to the end of the road.

Height: Use this to control the height of the cam above the road.

 


 

GENERAL SETTINGS

- The general road settings are displayed in this toolbar item

  1. Display Object. This will toggle the road surface on/off.
  2. Surface Material. This will let you select the surface material for the road surfaces. You can choose between the standard "Diffuse" and "Transparent" shader. The advantage of the standard "Diffuse" shader is that the road and surface geometry is clearly visible on top of the terrain in hilly areas. The advantage of the "Transparent" shader is that you can control the opacity of the road surfaces with the "Surface Opacity" slider that will appear when this option is selected. This will make it easy to accurately draw road shapes when using a road map overlay texture as the terrain texture. The roads on the map will be clearly visible through the road surfaces.
  3. Surface Opacity. This controls the transparency of the road surfaces and is especially useful when you use map overlays. Simply lower the opacity level so roads ont the map are clearly visible. This will make it easier to position the road markers.
  4. Multiple Terrain. Toggle this On if you have multiple terrains in your scene.
  5. Restore. This option will be enabled when the previous setting, Multiple Terrains, is toggled on. "Restore" refers to the process of restoring the terrain data to its original state before building the road and deforming the terrain. Keep this toggled on until you are finished with the road. Then toggle it Off. The terrain will not be restored to its original state. This setting will allow you to build all terrains one by one once you are finished with the road(s).
  6. Backup Location. By default EasyRoads3D stores backup data of the terrains in the folder [your project]/EasyRoads3D. In the same folder you will find road object specific data such as exported road geometry and road splatmap files. The EasyRoads3D folder is located outside the assets folder to avoid unnecessary file imports by the Unity importer. However, if you use the Unity asset server you will most likely need these files to rebuild the terrain after projects have been saved with EasyRoads3D objects in "Build" mode. You probably also like to synchronize manual terrain backups after manual changes to the terrain. In this case, chose "Inside Assets Folder" from the drop down list. Also make sure to hit ctrl-R before you commit changes to the Asset server!
  7. Enable Debugging. Check this when you are experiencing issues when using EasyRoads3D. It will write debug info to the console which will help us to solve problems.
  8. Road width. This is the width used for road geometry.
  9. Road indent. The part outside the road that will have the same height level as the road. The value of this parameter will always be bigger then the distance between 2 terrain points to avoid the terrain popping through the road geometry, more info.
  10. Raise markers (cm). When adding a road marker the y position of the marker will match the y position of the terrain at the specific point. This property will automatically raise or lower the marker position according the entered value. This is a simple but effective feature to add focus and detail to the road and near surrounding. Set it before adding markers!
  11. Force Y position.This is a useful feature when creating shapes with consistent y position changes, like rivers. When checked you will be able to assign a value. This value represents the y change per meter. When you add markers, the new marker will inherit the y position of the previous marker + this value * the distance between the markers.
  12. Surrounding. Distance between the road and the terrain used for smooth transitions
  13. Closed Track. This will stitch the start and end of the road together and is useful for creating race tracks.
  14. iOS Platform. This will optimize the road mesh UVs for the iOS platform and prevent common texture distortion issues on this platform caused by repetetive UVs.
  15. Geometry Resolution. This controls the geometry resolution of the road surfaces. 1 represents the highest resolution towards 5 representing the lowest resolution level. It is recommended to use the lowest level (5) while creating the road as it will improve performance although it may lead to less accurate results. Just make sure to set it at level 1 when testing the terrain leveling. Level 1 will always automatically be used when building the terrain and road geometry.
  16. Tangents. This will automatically calculate mesh tangent data after clicking the middle tab which also generates the final road mesh. Mesh tangent data is required if you use a bumped shader on your road.
  17. Active Terrain. This setting allows you to set the currently active terrain in the case you have more then one terrain object in your scene. When processing the terrain and road (middle tab) the selected terrain will be affected. Alternatibely you can use Ctrl+Alt+Click this will automatcially set the clicked terrain as the selected terrain in the dropdown.
  18. Update Vegetation. When toggled on all tree and detail objects near the road will be removed. For both tree objects and detail objects individually you can specify the distance to the road within these objects will be removed (Full version & Pro only). Depending on the number of tree and especially detail objects in the scene this process can take up some time. You may choose too disable this feature during testing the road and terrain leveling to speed up rendering the terrain.
  19. Active Side Objects (Full version & Pro only). Here all available side objects will be listed. You can toggle on / off side objects for this particular EasyRoads3D object. This will make it much easier to control your scene and manage side object settings per marker

NOTE: Multiple terrains. Currently terrains are processed individually by selecting the active terrain (point 14 above). This minimizes processing time when working on a specific part of the road. In the next release a progressbar will be visible and the option to proces all terrains at once. The reason why this is not implemented right now is because procssing a large number of terrains at once can take some time. It will be confusing to know what is going on without a progressbar visible.

NOTE: EasyRoads3D uses layers 29, 30 and 31. Make sure other game objects in the scene are not on one of these layers to avoid unexpected behaviour!

Road Splatmap to Terrain Splatmap

 

NOTE: Photoshop users, it is recommended to use "Save for web..." to save the png. If you save the image using "Save as...", be sure to select the png format. Do not simply select the already existing file in your folder as this will probably NOT import well in Unity.

NOTE: DO NOT use the splatmap features if you are using more then 8 textures on your terrain!

 

Road Geometry

The road geometry exported from EasyRoads3D contains vertex info, face info and UV info. You will have to apply normal info in your modeling application. If you exported the geometry with terrain lightmap support you will see 4 corner faces. Select all road faces and corner faces and use a planar type of uvmapping on the second channel. Save or export to .fbx. In Unity make sure that the import setting for size is 1. Choose a lightmap supported shader on your road asset and drag the terrain lightmap to the shaders lightmap slot. Drag the asset to your scene go to the EasyRoads3D menu and select "Position Road", browse to the EasyRoads3D terrain export file and select it. The road will be positioned correctly.

Depending on your modeling application and/or the export settings you used to export the road, it could be that you have to rotate the object on 1 or more axis. The "Position Road" editor script has some commented code in it that can take care of this automatically once you figured out the correct settings for your case. Just uncomment the lines and fill in the right amounts.

RIVER OBJECTS (Full version & Pro only):

EasyRoads3D Menu > New Object > Object Type: River Object

River objects essentially work similar as road objects. With the following differences.

In Settings you will see 4 more properties:

- Water Level. The minimum distance between the water surface and the surrounding. In the case the surrounding is below the water level it will be raised with this value.

- Floor Depth. This represents the depth of the river relative to the marker position. This value can be adjusted per marker.

- Material: This will display the currently available water materials in the project folder. Import the water packages if there are no materials available!

- Script: This will display the currently available water scripts in the project folder. Import the water packages if there are no scripts available!

After Leveling the terrain and creating the river you will see also the the Material and Script options. Changing these in this mode will instantly update the river object. If you cannot see the changes, simply click in the scene view to update it.

You now probably want to see the river animation. Please note this will output a warning regarding loss of the original terrain data stored in memory. Read about this here.

 

SIDE OBJECTS (Full version & Pro only):

The Side Objects feature is a powerful tool which will significantly lower your production time. In general you can create 3 types of side objects:

1. By instantiating game objects / prefabs.
2. By defining the shape of procedural geometry
3. A combination of these two.

Side Objects are managed through the Side Object Manager.

Side Object Manager:

Menu > EasyRoads3D > Side Objects > Object Manager

Instantiated Side Objects:

  1. Selected Object: Use this combobox to selected and edit created side objects
  2. Create New Object: Click this button to create a new side object.
  3. Duplicate Object: Click this button to duplicate the selected side object. This is a useful feature to quickly create identical objects used on both the left and right side of the road
  4. Import Objects: This will display the "open file" dialog, browse to the "sideobjectsLog.er3dObjects" typically located in /Assets/EasyRoads3D of a Unity project. All side objects in this file will be displayed in a new window, you can select side objects and click import. This will import all selected side objects into the current project. The easiest way to use this is by renaming the "sideobjectsLog.er3dObjects" file in the original project. Export this file including all associated side object assets like start/end objects, material etc. to a Unity package. Import this Unity package in your current project and import the renamed .er3dObjects side objects file through the Side Object Manager.
  5. Object Name: The name of the side object
  6. Object Type: Select the appropriate side object type from the combo. In the case of instantiated side objects choose"imported Mesh Object".
  7. Object: Drag the gameobject / prefab you want to use for this side object in the corresponding slot.
  8. Terrain Vegetation: The combobox will show all tree prototypes currently added to the terrain object. Selecting one of the prototypes will move the associated prefab to the object slot. Once you are finished with tweaking the side object settings you can add all instantiated trees to the terrain vegetation data with all the the advantages of for example tree billboarding, etc. Do this by selecting the specific side object in the hierarchy and click the "Update Terrain vegetation" button in the Inspector.
  9. Vegetation Scale: Use this min/max slider to set the minimum maximum scale boundaries for vegetation side objects. A random scale between the two will be chosen for each tree instance.
  10. Prefab Childs: This feature is enabled when more then 1 child object exists in the prefab. So the correct way to use this feature is to setup your prefab in a way that all possible objects are childs of the parent prefab. You have 3 options:
    - All: this will instantiate all child objects per new instance
    - Child sequence: this will go through all child objects according the child index and instantiate a single child object per instance
    - Random: this will randomly select a child object per instance. If you want specific objects to be instantiated more often, simply duplicate them in the prefab so there is more chance that they will be chosen.
  11. Distance: The distance between instantiated objects.
  12. Y-axis Rotation: This controls the rotation on the y-axis. Options are "Follow Road", "Fixed" and "Random".
  13. Sideways Position: This defines the default position to the right or left of the center of the road. This position can be adjusted for each marker , therefore changes to this value in the Object manager will currently not affect this side object on existing road objects as it will overwrite possible manually adjusted values per marker.
  14. Density: a value between 0 and 1 which indicates the chance of how often the object should be instantiated relative to the distance setting. A value of 1 means always.
  15. Maximum Offset: you can use this setting to position the objects perpendicular to the direction of the path over a random distance with a maximum of the chosen value. 0 means exactly on the path. This feature is useful for objects such as rock formations.
  16. Align with Terrain: When checked the object will be aligned according the normal of the terrain at the objects position.
  17. Combine Instantiated: Depending on the used materials, this will combine all instantiated objects into a single object.

Procedural Objects:

For procedural objects choose "Procedural Mesh Object" as the Object Type. You will see that the properties will change:

  1. Edit Geometry: Click this button to define the shape of the procedural object.
  2. Start Asset / End Asset: When you disable this type object for specific markers a gap will appear at the start and end of the procedurally created geometry. This gap can be avoided by using start and end objects modeled in your modeling application. Import the objects in Unity and drag these objects to the appropriate slots. The shape of these objects can be used to define the shape of the procedurally created geometry. See important extra info below.
  3. Controller: This controls the geometry structure and positioning, the options are "Clamp Left", "Clamp Right" and "Spline Controller". "Clamp Left" and "Clamp Right" will create geometry based on the resolution and vertice positions of the road geometry. "Clamp Left" will create the geometry at the left side of the road, "Clamp Right" will create the geometry at the right side of the road. When "Spline Controller" is selected the geometry will be created according a new spline. New properties will appear (see the image below).




  4. Distance Sideways: The default distance to the right or left of the center of the road. Note that this refers to the spline position of the marker. This position can be adjusted for each marker. When this setting is not 0 for all or some markers this side object will be positioned on its own spline shape based on the sideways distances. If you want to align side objects exactly according the road shape, use X Positioning in the Inspector of the specific side object. When you change the default sideways distance setting you have several options to choose from: 1. Do not update exisiting EasyRoads3D objects (the changed setting will only b applied to new EasyRoads3D objects). 2. Update all markers in all EasyRoads3D objects (be careful with this option, all manually adjusted marker settings will be lost!). 3. Only update markers with the previous default Sideways Distance value applied (this option will preserve the values of manually adjusted markers)
  5. Face Distance: The distance in forward direction between vertices. Use this to control resolution of the geometry.
  6. Align with Terrain: Options are: 1. None, which means no rotation, 2. Terrain Normal, this will align the side object according the terrain normal at that point, 3. Follow Path, this will align the side object according the forward direction of the path, 4. Path Sideways. This will align objects exactly accordin the shape of the road.
  7. Connection Object: Optionally you can assign a gameobject / prefab as a connection object. This object will be instantiated along the procedural shape. An example is the train lead and post geometry in the demo project.
  8. Material: Drag the material you want to use for the procedurally created mesh to this slot. Note that the uvs of procedural objects move in Y direction. With regard to textures for objects like walls or fences you may have to rotate it 90 degrees. In a future version you will be able to control whether the uvs move in Y or X direction.
  9. Combine procedural geometry..: This option appears for procedural side objects that have "start" and / or "end" assets applied. When toggled on the final geometry will be combined in a single mesh. Note that all objects must have the same material applied!
  10. Weld matching vertices..: This option appears when "Combine procedural geometry..." is turned on. It will weld vertices at the same position, those at the attach points between the procedural geometry and "start" / "end" assets. The advantage is, the normals will look better, the disadvantage is that, depending on the original values on the "start" and "end" assets, the UVs may look wrong. In this case you may get better results when editing the geometry in a modeling application.

Update button. Click this button to automatically update the currently selected side object in the scene. This will only work if this side object is currently rendered for one of the EasyRoads3D objects in the scene.

Tip:

Choosing the right rotation for your side objects. Use "None" for objects such as fences, walls etc. Use "Terrain Normal" if you like to always align the objects according the terrain normal. Use "Path Normal" when you have have tilting applied to markers and you would like to align the side objects accordin ghte tilting level also when the side object is not inside the path and indent area. Use "Path Sideways" for side objects that together with other side objects create a specific object or shape, like bridges or train rails. This setting makes sure the alignment of all objects is exactly the same.

 

 

IMPORTANT NOTE REGARDING PREFAB ROTATIONS!

The rotation of prefabs whether used as Start Asset, End Assets, connection object or when used on an Instantitaed Object type is important:

As explained above you can use start and end gameobjects / prefabs to close gaps on procedurally created geometry. It is important that these objects are correctly rotated. Depending on the modeling application you use, gameobjects may be rotated and point in the wrong direction after being imported. Always make sure that they point in the correct direction. You can check this by selecting the object with the mesh renderer attached in the project view and have a close look at the preview pane.

Look at the images below. On the left you see the imported geometry of the "left end of the wall" object in the road demo. The intention is to snap this object to the end of the wall with the open gap. However the closed area is pointing towards us, this is the wrong direction. The importer rotated the object by 180 degrees on the y-axis.

Wrong!

Correct!

 

You can also see if the rotation is correct by dropping the object in the scene. Check the rotation values in the Inspector. Did Unity automatically apply rotations to one or more of the axis? These rotation values are ignored in the side objects system.

The solution is to create a new prefab and use the gameobject with the mesh renderer attached as a child of this new prefab. It is very important that the mesh renderer is a component of the child of the prefab and not the parent object. Make sure that the relative position of this child object to the new prefab is at (0,0,0) and, rotate the child object 180 degrees on the y-axis in the Inspector or according the same rotation values as Unity automatically applies when dropping the prefab in th scene. You can see the result on the right. Now the gameobject is pointing in the correct direction. Have a look at the demo project.

So, depending on your modeling application and export settings within the modeling application you may have to rotate the child on the x-axis, Y-axis or z-axis.

 

Procedural Object Editor Window:

For procedural objects you can define the shape of the object in the Procedural Object Editor Window. This window will open when you click the button "Edit Geometry" on the right of the Object Type combo box. This button will become visible when "Procedural Mesh Object" is selected.

The editor window gives a 2D representation of the shape of the procedural geometry. You can define any shape you want:

  1. Add new vertice positions by double clicking on the stage there where you want to position the new point. Points will be connected to give a clear idea of the shape.
  2. Move points by selecting them (the point turns red) and dragging it while keeping the mouse down.
  3. Delete points with the "Backspace" or "Delete" key.

Controls / Hot Keys:

  • [Shift] click: Select and drag or delete multiple points
  • [Control] double click: Insert a point between the two closest points
  • Z key: Zooms the grid so all the points are clearly visible
  • R key: Resets the zoom and positioning to the original values
  • Mouse down: and drag, will move the grid
  • [alt] drag stage on Y-axis, Mouse scroll, [Command] & drag, right mouse button & drag: Zooms in / out on the grid.

 

Side Object Geometry Controls:

  1. Selected Index: When you select a point the associated index value will be displayed in the ComboBox. The purpose of this is become explained in the NOTE here below.
  2. Close Geometry: When checked, the first and last point will connect.
  3. Trace Object: if you added a Start or / and End object to the associated slots in the Object Manager this object will appear here. It can be used to analyze the geometry and automatically define the shape of the procedural geometry accordingly. Make sure that those vertices used to connect the start and end assets with the procedural with each other are at position 0 on, depending on your modeling application, the y-axis or z-axis.
  4. Trace On: Depending on the rotation of the asset you may have to switch between x-axis, y-axis and z-axis until you clearly see the shape that the procedural geometry should have. By default objects are traced on the z-axis when opening the editor window and no points are stored yet for this side object.
  5. Auto Connect: Below the situation is described where you can clearly see that the dots are positioned correctly but they do not connect in the right order. Auto Connect will be enabled when you select the first point, from this it will connect all points according the closest neighbor. Depending on the geometry structure it may simplify reordering of point indexes.
  6. Mirror Horizontally: This mirrors the shape horizontally and is useful when correcting the shape of a duplicated side object or when it turns out that tracing the geometry of the start or end asset results in a flipped shape.
  7. Mirror Vertically: This mirrors the shape vertically.
  8. Flip Faces: It may happen that the normals point in the wrong direction, you will notice this when rendering the side object. This button will flip the faces so it will appear correctly. This feature is also available in the Side Object Inspector.

Update button. Click this button to automatically update the currently selected side object in the scene. This will only work if this side object is currently rendered for one of the EasyRoads3D objects in the scene.

Tip:

Use [shift] click to select and move or delete multiple side objects

 

NOTE: If you use the geometry trace feature it may happen that you clearly see the correct shape but the points do not connect to each other in the right order. This is due to the vertice order in the mesh. You can correct this by changing the index of points. Start at one of the two points that should have only one connection. If the index is not 0 you can either set it to 0 by selecting 0 from the combobox at the top left. But preferably first check the other point that should only have one connection. If this point is set to index 0, start here. Now select the next point to which this point should connect. If it already connects, the index will be 1. If not, then select index 1 in the combobox for this point. Repeat this procedure until all points are correctly connected.

Points are NOT connected in the right order!

Points are connected in the right order!

 

Managing Side Objects in your scene

Select an EasyRoads3D object in the scene and make sure the General Settings tab is selected .

At the bottom you will see a list with all available side objects in this project. You can activate / deactivate side objects per scene. For example in the demo, the train track side objects are not used in the road scene so we uncheck all side objects related to the train track. This same list is also available after your build the side objects. If you toggle / off side objects the scene will update and you will instantly see how the changes affect the scene.

Building the Side Objects

To built the side objects of an EasyRoads3d object , first render the road and terrain by clicking the middle tab, .

At the bottom you will see "Side Objects Settings". Click the button "Built Side Objects". Now all active side objects will be built and you will see a new button "Save Side Object Geometry". This will create .obj files of each individual side object. Find the files in:

your unity project/EasyRoads3D/road object name/

Controlling Side Objects per Marker

After building the side objects you will also see that the Marker Objects will become visible. This allows you to easily select a marker. Instead of the default marker properties, You will now see a combobox with all active side objects and below the properties of the currently selected side object:

  • Selected Object: this is a dropdown box with all side objects listed that are active for this object. Select the side object that you want to edit from the list.
  • Display Object: Toggle this on/off when you want to render the selected side object for the selected marker.
  • Spline Node: Toggle this respectively on/off when you want to use this marker for the spline shape. The road scene in the demo project uses this feature for the "Right Fence" in the sharp corner. It cuts of a large part of the road shape. This allows you to create shapes that run independently from the actual road shape.
  • Distance Sideways: This allows you to move the spline path for the selected side object away from the road shape.

 

Tweaking Side Object Properties

At this stage you might notice for example that the normals of a side object point in the wrong direction. You can correct this by going back to edit mode and opening the Side Object Manager, but you can also tweak side object properties by selecting them in the scene or in the hierarchy (RoadObject Asset> Side Objects > ...).

Depending on the type of side object you will see a number of properties you can control in the Inspector. Any changes you make here are stored permanently in the side object data.

This makes it very easy to quickly flip normals, experiment between the alignment options, manage UV tiling, etc.

Note the additional X Position and Y Position options. Use this to control the position of the side object relative to the spline shape.

For procedural side objects you will also see the following options:

- Add Mesh Tangents. Check this if you want to use a bump mapped shader.

- Add Mesh Collider. This will automatically add the Mesh Collider component to the side object.

 

PROCEDURAL MESH OBJECT (Full version & Pro only)

EasyRoads3D Menu > New Object > Object Type: Procedural Mesh Object

The Procedural Mesh Object is based on the side objects feature. You can associate one or more of the side objects to this object type. The main difference with the road and river object is that this object type will not alter the terrain heights. It is the ideal tool to instantiate objects according a path or create procedural geometry according a path. It can be used to create for example individual fences, walls, hedges, pipelines, rock formations etc.

Procedural Mesh Object inspector functionality differences compared to the road and river object:

When a marker is selected you will see the markers side object properties (for road and river objects, you will only see these properties after you leveled the terrain and build the side objects). The middle "Process Terrain" tab will not alter the terrain heights. Use it to show / hide the markers.

New properties:

General Settings > Snap to terrain: This property is checked by default. Uncheck it if you want to have the side object follow the spline shape exactly according the marker positions. In other words, if you do not want the side object to snap to the terrain.

Markers > Sharp Corner: This is a very useful property for objects such as fences, hedges. When checked the shape will not have a rounded corner based on the spline path at this marker position, instead the corner will be sharp.

NOTE:You may have to move the marker slightly for a perfect sharp corner in order to have the the number of instances exactly fit for a sharp corner.

 


USEFUL NOTES

- adding / inserting markers is done by activating the respective toolbar tab, holding the [shift] key and click.
- you can select a road surface directly by clicking on the surface.
- [shift] select surfaces to change the position of multiple surfaces, (the individual surface properties will not be visible)
- [shift] move gizmo will only change the surface position, when releasing shift the surface geometry will be updated (this is useful in case of performance issues).
- [ctrl] move marker, the marker will snap to the terrain height at the new position
- [ctrl + alt] click on terrain, this automatically select the clicked terrain as the active terrain when "Multiple Terrain" support is enabled.


ERROR MESSAGES:

MissingComponentException: There is no 'Renderer' attached to the "road" game object, but a script is trying to access it.
You probably need to add a Renderer to the game object "road". Or your script needs to check if the component is attached before using it.

This message may appear when clicking the middle tab "Level Terrain" and appears when previous render data has been lost due to for example playing the scene or saving a script while the terrain object was in render mode. For now, to solve this problem, optionally save the scene, create a new scene and reopen the previous scene, this will refresh the terrain object.

Mesh.vertices is too large. A mesh may not have more than 65000 vertices.

This error may occur when rendering side objects. If the side object is an instantiated object, make sure you uncheck "Combine instantiated objects". Instead, divide the instantiated objects in groups by parenting them to an empty game object and apply the Unity combine script.

 


TROUBLESHOOTING:

 

The road object is visible in Game View but not in Scene View

EasyRoads3D uses layers 30 and 31. These layers must be active in the layers dropdown at the right top of the Unity Editor. If these layers are not named and your Unity Editor is set to use custom layer, layers 30 and 31 will be disabled and therefore the road will not be visible in scene view. Selecting "Everything" however will NOT activate Layers 30 and 31 in this case! The fix, with the EasyRoads3D object selected, In the Inspector select "Add Layer" at the bottom of the Layers dropdown and give layer 30 and 31 a name like EasyRoads3D30 and EasyRoads3D31. These layers will now become visible in the other layers dropdown. Make sure they are active.

Mismatched serialization in the builtin class 'Mesh'. (Read 10380 bytes but expected 10381 bytes)

This error can appear immediately after importing the package in Unity 4.3. It is harmless. Further info http://forum.unity3d.com/threads/210417-project-4-2-to-4-3-Mismatched-serialization-in-the-builtin-class-Mesh

Markers do not connect

- Did you restart Unity after registering EasyRoads3D?
- Check if markers are very close to each other. If so, remove one of them or make the distance bigger.
- if this doesn't help, clear the debug log, enable debugging in "General Settings" in the Inspector and select a marker. This will write debug info to the console. Please send the debug log file to trberg@andasoft.com

All Markers are placed at the same position in the center of the scene

Make sure the scene camera is in perspective mode (Scene Gizmo) or one of the axis is selected when adding or inserting markers. In isometric mode ("Iso" is displayed in white below the scene gizmo) the markers will be placed in the center of the screen!

The road disappears below the terrain

This will happen when road vertices are below the terrains Y position because technically it is impossible to set terrain heights below its Y position. The road will be below the terrain in these areas. So make sure all markers are at least positioned at the terrains Y position. Also avoid big height differences between markers at the terrains Y position and the next marker. The road will first slightly move downwards to below the terrains Y position. To fix this situation, move the marker at the terrain Y position slightly upwards.

The road can also disappear below the terrain on terrains with a larger heightmap scale and considerable height differences in the road. There are simply not enough terrain points to accurately deform the terrain. You can see this when turning on Wireframe or Tex-Wire for scene view and zoom in to the critical area. You will clearly see the terrain points. To solve these situations, avoid big short height differences in the road or use an higher heightmap resolution on your terrain.

Side Objects do not appear

This happens when you have chosen to disable this side object by default for each marker. To check this, select a marker, in the inspector select the specific side object from the Selected Object combobox and have a look at the Display Object property. Is it checked?

Wrong Rotation Prefabs used in side objects

Prefabs may appear in the scene with the wrong rotation. This is directly related to the mesh data of your prefab.

First, EasyRoads3D instantiates side objects according the direction of the spline path in the Z direction. So if you want to Instantiate a fence mesh along the track, the fence model must be modelled in the direction of the Z axis, not the X axis.

The second thing to check is how Unity displays the prefab and if that is the correct orientation. If it is the correct orientation, check the rotation values in the Inspector. Did Unity automatically apply rotation values to the prefab or are the rotation values (0, 0, 0)? If Unity did apply rotation values, these rotation values are ignored in EasyRoads3D.

You can do two things to solve this. First you could change the rotation of the model in your modeling app. Second, you can create an empty prefab, position it a (0, 0, 0), add your real model as a child to this prefab at (0, 0, 0) and apply the same rotation values as Unity does to this child object. Attach this new prefab to the side object, the orientation should now be correct. The importance of the correct rotation setup of prefabs is also explained here.

 

Side Objects: Error: Mesh.vertices is too large. A mesh may not have more than 65000 vertices.

This error may occur when building side objects. If the side object is an instantiated object, make sure you uncheck "Combine instantiated objects". Instead, divide the instantiated objects in groups by parenting them to an empty game object and apply the Unity combine script to each group.

 

The generated river mesh breaks through the terrain:

This most likely due to the terrain heightmap resolution / terrain size settings. Increasing the "River Bank Height" setting in General Settings should solve this.

 

Errors when swapping river materials / scripts

The materials and scripts available in the comboboxes are the currently available assets in the project referring to the water assets in the Standard and Pro Standard Assets folders. If you get error messages when swapping them it means the combination of the selected Material and selected script will not work. This usually happens when using either a Watr3 material or script on one of the older materials or scripts. This is taken care of in the scripts by automatically updating the material or script. However it may still raise an error. This is on the list to fix.

 

I cannot add a new EasyRoads3D object

Do you get error messages in your project also unrelated to EasyRoads3D? Make sure Unity comples the project without red error messages. To ensure the problem is not related to EasyRoads3D you could test it in a new fresh empty project. Please contact us if creating a new object still fails.

 

I am using Start / End blending but the road does not blend with the terrain.

For road blending one of the transparency shaders is required. Select the "road" game object inside the EasyRoads3D road editor object. In the Inspector look for the road material and choose one of the "EasyRoads3D/Transparent/" shaders from the shader dropdown. Also apply this shader to the following material in the project folder: /Assets/EasyRoads3D/Resources/roadMaterial so the transparency shader will be automatically applied on next builds. Please use the transparency shaders inside the Unity 3 folder if you are using Unity 3, otherwise the road will be invisible!

 

The package does import with errors or fails to import

Do you already have the Free version in your project? Please remove that folder first. Or do you have EasyRoads3D already imported and is Monodevelop open? In that case try closing Monodevelop before importing the package.

 


KNOWN ISSUES

 

Terrain Toolbar Tab. When a road marker segment is selected, sometime you may have to click the tab twice to start leveling the terrain .

Road Splatmap: On bigger terrains with a low heightmap resolution it may happen that some parts of the generated road splatmap are missing. Edit the road splatmap and re import using Restore Terrain Splatmaps.

 

Have fun and do not hesitate to contact me if you experience issues or if you have questions! Email