Download

How to Blend B/W Grass/Dirt like in Torchlight 2?

Notice how to grass blends with the dirt. The strands of grass extends into the dirt textures. How was this attained? Can it be done with UE4 painting system?

Or do I have to model and texture my terrain in photoshop?

Yep, its possible… Here is a video tutorial on how to do it, special thanks to Virtus Education! He is awesome :smiley:

https://youtube.com/watch?v=pkByz_lz_GM

Thanks, but the tutorial doesn’t cover the style I asked about. (In the screenshot above, the grass stands seem to blend into the dirt in a stylized way)

Huh, I think you want to add foliage then. The tutorial above shows you how to paint on textures so they blend. For stylized, you need to look at post processing which can change the style. To me that blending of the grass can be done using the tutorial above. Its simply painting them on and blending them in… If you want sticky out grass then you would add foliage.

I think he is talking about a harder edge rather than soft blends like in the video.

Yes that’s what I mean! I can’t highlight it in the picture because I’m in my phone.

I’m talking about the hard edge transitions between grass texture and dirt. The strands stick out into dirt

Seems like a tile map.
Maybe all transitions are hand drawn.

It could be a mask or some type of black and white image that is set up to achive the hard edge shape.

I also thought about using a mask to harden the transition, although I don’t know if it will be “nice and neat” like in Torchlight

I wrote a shader of my own ten years ago that does something similar.
The idea is to include an alpha map in each material, and add the alpha map to the blend value between terrain layers.
The grass would then have the alpha map opaque where it has “blades.”
The blending function would then make it so that:

  • when the blend is 100% grass, only include the grass texture
  • when the blend is 0% grass, only include the mud texture
  • when the blend is 50%, lerp between grass at 100% alpha and mud at 0% alpha
    This turns out to be a single lerp based on a scaled sum of the layer blend function, and the texture alpha

The main draw-back was that it’s more work to create good alpha materials that blend well together using this method.

I believe the same kind of material could be created in the Unreal terrain material system, although you’d probably only get 3 layers out of it if you want the fancy PBR material properties.

That makes sense! I’ll try to implement it using the material editor and see if I can get it to be similar.

If not, would it be a good idea to instead model a terrain in 3ds max, UV it, and tile textures onto it in Photoshop? That way I might be able to paint the transitions with more control?

Here’s an example of how to achieve it. You have to do it for each material property.
This would be easier if I could access the blend weight directly, rather than having to blend between “0” and “1” just to get the blend weight :slight_smile:

ac6f25af5edaadd96f1d47a2ba4d93edf661395c.jpeg

In the preview, the part of the grass with alpha > 0.5 will start blending in; the part with alpha 1.0 will be blended at 0.5.
If you set preview weight to 0.5, you will blend the grass with alpha as normal.
If you set preview weight to 1.0, you will only get the grass texture.

Whoah! Thanks for this demonstration! I’ll whip up a quick alpha mask for my grass and see how this works. Many thanks!

I found a link for you where the blending is explained. http://simonschreibt.de/gat/world-of-torch-siege-blended-trunks/

Use blendweight 0 and 1 for the 2 textures. then paint with a custom brush that has the shape of the grass to all 360 degrees. that way you can paint any path with it.