How to add borders to the roads

  • Issue category: Lightship Maps
  • Device type & OS version: Android / iOS
  • Unity version: 2022.3.14f1

Hello everyone, I was wondering how it would be possible to apply borders to the roads.
By default, the roads of the Lightship map are single-color lines, but I would like to add a border of a certain thickness, perhaps proportionate to the road’s thickness itself.
I had the idea of creating a shader and then applying it to the roads, but I don’t know how to capture the right tiles that contain the mesh renders of the road.
If anyone know how to do it, I would be very grateful.

In the end, I tried to delve into and implement a solution based on the advice from Maverick_Liberty, whom I thank. However, I was not successful because it is too complicated for my skill knowledge.
For future individuals facing the same “issue”, I solved it by creating 2 builders for the same road. One of them has a slightly lower z offset and a slightly larger linear feature size. The layer below has one material(road material), while the one above has anotherl(road border material), creating the effect of the road edges I desired. Obviously, it’s not very efficient, and there are certainly better ways, but in my case, it works well.

Hi Lorenzo,

For something like this, I’d recommend looking at Feature Builders on the Maps documentation: Builders allow you to place prefabs at the location of particular features. For example, if you wanted to add labels to streets, you could create a feature builder as shown in the Feature Labels sample.

I would recommend opening up that sample, and studying the TextMeshLabelBuilder, LabelBuilder, and ObjectBuilderStandard scripts to get an idea of how you would go about implementing street borders.

Kind Regards,
Maverick L.

1 Like

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.