Projection of road on terrain

Hi,

problem is simple:

I would like to create road or line which would follow terrain but would not edit it, like this:


Do you have any ideas how to do it?

Thank you very much! :slight_smile:

You could just draw the path with the existing texture tools.

Or check out the terrain api and asset store for relevant tools to do this.

In theory with a spline or b-spline you could write your own path tool.

Do you want it exactly like the CryEngine method? Because this asset will do just that.

It’s all about the assets now

You can always build your own solution using the Catlike Coding spline tutorial as a starting point. Creating a road through this method would simply be a matter of procedurally generating your own road mesh with the spline as a guide.

http://catlikecoding.com/unity/tutorials/curves-and-splines/

MegaFiers also has a conform modifier for dong what you need.

Or you use their other asset MegaShapes which will map a loft to the terrain or map the terrain to the loft.

the OP’s picture shows a spline that projects a decal
https://blogs.unity3d.com/2015/02/06/extending-unity-5-rendering-pipeline-command-buffers/

something like that ^
mixed with spline things .. (never done these things myself, but know of them)
splines + decals

and the things people are posting are meshes made from a spline
… theres all sorts of stuff about splines

… QuakeWars mod tools / level editor had that system of road making…
the terrain is ANY shape, and it just projects a decal texture onto the terrain, based on a spline.

Thank you very much :smile: In the end I used a lot from this and it was very helpful! Thank you very much once more!!! :smile:

You can use the ClipperLib at http://www.angusj.com/delphi/clipper.php . I have a basic function to conform any shape to terrain. Nevertheless it’s slow, so you can’t use this method in runtime.

Fancy making that into a little asset? Id happily pay a few quid to save me my current headache. All I want to do is drop a script on a object, click a button and have the unity terrain move to meet it. Maybe a little border area or slope if you were feeling fancy.