Material edge fade?

Hey all I’m trying to make some nice roads for my project. I can’t seem to figure out how to make the material fade on the edges though. Some sort of way to translucent mask the edges or something?

It’s just a spline mesh component with a gravel material I made but it looks really weird when it’s a straight line against other materials. Perhaps place decals along a spline somehow?

1 Like

Are you placing the roads by hand or are they being generated at runtime? If you are placing them all by hand I personally recommend, vertex painting an object into it’s surrounding world, either using the surrounding materials to blend onto the mesh or push the world position offset down into the surrounding meshes.

Some examples and resources:

https://www.youtube.com/watch?v=tyLSH5zF-rI

I know that’s kind of not really an answer but hopefully that’s enough to give you some ideas.

Trying to do random run-time generation for paths through the level

You can use Generated Band with width dependent on object scale.

How would I tell it to mask the edges though? Say a default plane mesh or something?

you can tell the material to mask wherever you like in the uv space. then you just need to make sure your meshes uv are setup in a manner that works (or reverse the order and make material work for mesh uv).

below is a few examples. first if you wanted a linear gradient theres a node for that. the node will give you a fade from a single direction say top or left, from there you need to dulicate and negate that fade using a 1-x. after that i included some functionality to modify the gradient size and brightness. once you have this setup simply plug it into the opacity.

another option is to use textures as the mask. the texture mask i created wasn;t in the right orientation so i used a rotator to rotate the uv. from there it can be as simple as plugging in a texture to the opacity. i decided to add some variation by including some macro/micro tiling.

1 Like

why not just use a masked or translucent material like you mentioned? you can use a mask in the material and have the mask “mask out” the edges to be translucent. of course that will depend on your meshes, their uv layouts, geometry, complexity, etc.

Okay I’ll have to try the mask then, Thanks!