How to paint wetness on terrain?

I have created a terrain material with 3 diffuse and 3 normal textures. These textures are plugged into respective landscape layer blend expressions. The Blend type for first texture (Dark soil) is Alpha blend and the rest are LB weight blend. Same for their respective normal maps. Metallic and Roughness are controlled by Param 0 and Param 2 respectively and I am getting good control on specularity. I also have a landscape visibility mask for cave. My question: Is it possible to add another texture node for painting wetness on the landscape? When I look at the blend expression, I see no way to add another node with just control for metallic or roughness. Image of my material editor attached here.

http://i124.photobucket.com/albums/p37/sgv3dmax/OTC-Unreal4/Terrain_Material_02_wetnessQuestion.jpg~original

Hi,

You can add a separate a LandscapeLayerSample node with another layer name and attach that to the roughness and metalic inputs, or in an expression attached to it. That layer name will then appear in the landscape tool as another layer. You might want to set it to be a “Non-weight blended layer” which allows you to paint it independently of your other color layers. (Painting a normal weight-blended layer will reduce the strength of the other layers, which might not be what you want in this case).

The LandscapeLayerSample will return 1 where you’ve painted it and 0 where you haven’t. Note that there’s a bug with the LandscapeLayerSample node in 4.6, I’d recommend using a 4.7 preview if build if you’re not already. Alternatively you can get the same result as a LandscapeLayerSample node using a LandscapeLayerWeight node like this:

Cheers

Attaching a 0 and 1 to a LandscapeLayerWeight allows you to extract the painted value directly, which is what a LandscapeLayerSample node does.

29151-landscapelayerweight.png

Awesomeeee!!! It works like charm. Thank you so much. I tested with layer sample node and Specular 0 with a constant. Only thing is while painting with the new sample wetness layer, I have to keep the brush strength @ 0.5 or it just erases it and only pixels around the brush (0.5 strength) will get wetness effect. One solution I found was to set a target value @0.5 under tool settings. Then if I need to erase wetness, just remove the target value. I will test the other landscape layerweight node next.

This time I went one step further and added a OneMinus expression to the output of Landscape layer sample node and plugged into roughness. The problem before was that while painting, pixels with value +1 were erasing roughness completely at the center of landscape paint tool. So I plugged in an expression that would reverse this effect using a OneMinus. Now the wetness is very clean. Only problem is it looks very dark relative to the environment. Connecting specular to wetness node does not change it much.

Keep in mine that specular default value is 0.5 not 0 not 1. You can always clamp this value.