Painting my terrain

Hallo everyone,

I’d like to start off by saying that I’m new at UE4. I have spent around 7 hours in the software so please bare with me :slight_smile:
I have read the documentation and seen tutorials that explains how to add a material with grass, dirt and snow. It also shows how to paint it onto your terrain (although I end up mostly with black areas).

I decided to take a step back and start off by creating a lovely terrain and paint it as attached.
White = snow
Brown = rock, dirt, gravel
Green = grass
Blue = water

This is a large terrain so if I were to paint these textures onto my terrain, how would I proceed? I tried using my new knowledge from the tutorials but honestly, I can’t seem to make it right in any way.
I guess I also lack the required texture resources such as detailed grass, snow and so forth. But what are you guys thoughts? How can I complete this epic quest?

Here you can download the umap scene, I’m not sure if that’s the correct way of sharing scenes:

PS. I’m only using UE4 for still-image renderings as I would make in Eon Vue :slight_smile:


What you should do is to create masks for your terrain. Then create a splat map with them. Then using the splat map you can define where each texture should take place.
I imagine you are using world machine so your masks would come from the erosion node. Flow map, Deposition map are the main 2 masks you’d always need. Then if you want snow on tops, you’d use a height selector node in world machine to chose the heights for snow, then subtract it with flow map etc. to make it look nice. Once the splat map is created, head to UE4 material editor and set it up like this:

That is in UDK of course, but its the same for UE4 too. That’s a basic setup to get the textures to appear where you want. From there you can make a lot of advancements.
Here is a thread I made at my first day UE4’ing:

Hope this helps. :slight_smile:

Hallo Maximum-Dev,

First of all, it’s pretty neat to read your resume and the graphics you’ve made for Galaxy Bowling, I played that myself :wink:
Anyways, thank you for trying to explain this to me and referer to a thread similar to mine. I do have masks for the terrain from World Machine (flow, output, RiverDeposit, RiverFlow, ValleyDeposit, ValleyFlow), but I’m not experienced enough to play around with all these nodes/function editors.

Having these masks and setting them up in UE4 is beyond my imagination. I only know the very basic of texture setups from the tutorials I’ve read. They informed me about textures, landscapeblend and that’s about it :slight_smile:

I can see from your first thread that your base understanding exceeds mine :slight_smile:

Thanks for the compliment. :slight_smile:

If you have photoshop create a new document and put each of the masks you have in RGBA channels.
For example, paste the flow map in R channel, river mask in G channel and so on for the B. For A you can create an alpha channel and paste another mask in it if you wish.
Then that’ll be your splat map. Save it as .psd (if it’s not photoshop you are having, just save it with .tga or anything that holds the alpha channel in it too).
In this image the splat map is the first node from bottom right:

In UE4 material editor create the same graph you see in the image above and it will work.
If there is anything you need more explanation for let me know.

(Note: you see Lerp nodes in the image above, you can create them in your UE4 material graph by simply holding down L key on the keyboard and left clicking anywhere on the graph).

Thank you for the detailed walkthrough. As I just opened Photoshop CC I remembered that I exported World Machine terrain as Raw16 (.r16), Photoshop cannot open that format, not unless I export the terrain from WM as 8-bit instead of 16bit. but that wouldn’t be recommended, would it?

Your welcome.
I did not mention to open the terrain in Photoshop. It’s not required at all. I was talking only about the masks.
Also you can export the terrain as 16bit .png so you can open it in photoshop too. (.png works well with UE4)
And no. Never export in an 8bit format.

My bad! Right now my head is running at 100% :wink:
I tried to copy your setup and I’m wondering if it’s alright. I honestly have no idéa what I’m doing but if I see it working, I’m sure I’ll see the logic.

If this is correct and for what I understand so far:

The main texture sample (splat map) is using 3 outputs: RGB just as in the PSD file.
I attach each texture map / lerp to the corresponding color, exactly like in Photoshop.
I now have to apply texture to each of the texture map and they should apply to the correct places?

In UDK (the image I posted above) it’s a right to left setup. In UE4 you should go from left to right so your wires look much better.
Instead of using TexCoords use LandscapeLayerCoord.
You should also use a LandscapeLayerCoord for the splat map itself. (Plug it into the UV input of the splat map). For this LandscapeLayerCoord node (only the one that’s plugged to the splat map) you should enter a value equal to the terrain size. For example if the terrain is 4033x4033, you enter 4033 for LandscapeLayerCoord.
Once you did this, apply the material to the landscape and it should be working as expected.

Ahhhh it works like a chaaarm!
Thank you very much for your patience and dedication Maximum, you’ll get a star in my little book!

My terrain looks really really bad but, the technique works ;D

I’m glad I could help. :slight_smile:
Your masks look very off. They don’t match the landscape itself. I see on the left side of the image you posted it’s saying overall resolution 4319x4319. Do you have the LandscapeLayerCoord you plugged to splat map set at 4319 too?