Unity plugin

Streets

The street render config asset defines the ruleset for the street mesh generator. COALA currently offers two street generation logics, Version 4 and the Outlines version.

Version 4

Version 4 is optimized for performance and is split into three regions:

In the Categories field you can add the types of streets that the options in the Element will be applied to (see below for how to find the existing categories)

Version with Outlines and Render Priority

This newer version can spawn streets with outlines, improving the overall look of intersections, and can also better handle which types of streets to be placed on top wherever different street types intersect.

Like Version 4, this config is also split into three sections. The difference is that in this version you can assign two materials for each Element. 

The settings in the Street Mesh Render Config will be used for the inner part of the streets, while the settings in Street Outline Mesh Render Config will be used for the outlines.

The outlines need to always have a larger Width value than the street mesh and they also need to have a lower Mesh Render value.

Render Priority Config

This config determines the implementation of the render priority. There are two default implementations:

and

To implement your own render priority logic, you can inherit from the abstract class StreetRenderPriorityConfig.

Materials 

Default PaperMap street material 

Three different street textures 

Visual results 

Default streets 

Textured streets 

(Tip: If the street material is not aligned properly, check the Tiling X value of your material. A value of 0.02 looks generally good ) 

FAQ 

Where do I get the street categories from?

If you are not sure what to enter as a value for the Categories list do the following:

Special street types

Bridges

In the street render config asset there is another Section under List called Bridge List. You can define bridges the same way you define normal streets. Add a new entry and its categories. Bridges use the street-bridge category.

There is a difference when rendering bridges, since you would usually want your bridges to be an actual mesh. This is why the mesh entries in the Bridge List section in the street render config have an additional field called Mesh Generator.

To fill this field you have to create a street mesh object under Assets/Coala/StreetMeshGenerator. Now you can simply drag and drop the newly created object into the Mesh Generator field.

In the Street Mesh Generator you can specify how you would like the bridge to be rendered. To do that you have to first select a base mesh. This mesh will be stretched and transformed to fit the path of the bridge. It should be 1 unit wide on the X and Z axes and it should have its origin at its lowest Z position.

The mesh generation for bridges handles corners by creating additional base meshes. You can specify the number of additional meshes for corners by adjusting the Maximal Angle value. A high value means that there will be less additional geometry created while a low value will create more, making corners look smoother. The corner radius defines the distance of the newly created meshes from the actual bridge path. It should usually stay at 0.5 but feel free to play around with this value.

If you want to use multiple materials for your streets you also need to define which Submesh should use which material. You can do that with the Submesh Material Indeces entry. If you only use a single material, you can ignore this field.

In the details field you can specify repeating details on the bridge mesh, such as pillars that hold the bridge. You can add multiple different details. When creating a detail, add a mesh in the mesh field. Distance specifies the distance between the single instances of the repeating element.

If you check the Stretch to Y Zero checkbox, every vertex with the lowest Y value will be stretched to world Y zero. This is useful for pillars that should always stretch to sea level regardless the bridge's altitude.

Submesh Material Indeces are handled the same way as above.

With Static First/Last Detail Position you can specify what distance the first/last detail should have to the start/end of the mesh.

Bridge base 

Bridge pillar