I'm looking for a way to mix two materials based on distance from open edges of a mesh.

Example: I have a terrain mesh and a road mesh that follows the curvature of the terrain, slightly above it. These meshes obviously haven't got a volume, only a surface. The scale of the scene is too big to use image textures or meshes with sufficient resolution to paint fine details. I'm looking for a way to create a procedural texture for the road that fades out into transparent towards the open edges of the mesh so it blends into the terrain. Is this possible?

If not possible, then what would be the best way to create winding roads that follow the curvature of the terrain and blend in without sharp edges in a low-poly environment? A solution that would give as much control and flexibility as possible?

Scene in viewport Material changes based on distance from open edge


1 Answer 1


I figured it is best to use curves for the road:

  1. create curve of the road in top view 2D,
  2. use another curve to define the cross section of the road,
  3. use a shrink wrap modifier to project the road curve onto the terrain,
  4. use the below material setup to define a different material along the edges,
  5. modify any aspect of the road later: it's all non destructive and remains editable!

The idea comes from the answer to "How to change color along a curve?". Same thing here, except we're changing color across the curve instead of along.

Scene in Object Mode Scene in Edit Mode Material Setup


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .