TUTORIAL: Getting Started with Landscape and Blending Textures

veteran polycounter
  • Offline / Send Message
  • Joined
  • 86 Topics
  • 2.8K Replies
Swizzle veteran polycounter
In this brief tutorial, I'll show you how to start setting up Landscape for use as terrain for environments. Before I start, though, I'd like to point out that there is a ton of useful info on the UDK help pages.

Here are some relevant links:
http://udn.epicgames.com/Three/Landscape.html
http://udn.epicgames.com/Three/LandscapeMaterials.html
http://udn.epicgames.com/Three/LandscapeEditing.html
http://udn.epicgames.com/Three/LandscapeCreating.html

This tutorial is going to distill the info in those pages down to the essentials to get you started with Landscape.

This WILL NOT be an in-depth tutorial.

If you want specific numbers and info on things not covered in this tutorial, go read those pages. There's a lot of info in them.


GETTING STARTED

The first thing you should know about Landscape is that it is a completely separate tool from Terrain, UDK's previous ground mesh creation tool. Terrain has a lot of useful tools, but the way it handles materials is a little bit clumsy and it doesn't take advantage of some of the polygon-pushing power that UDK now offers.

Landscape is compatible with DirectX 11 hardware tessellation and offers a very different but much more powerful material editing system (SPOILER ALERT: It's the material editor.). I'll outline a basic way to take advantage of this material editing system in my next post.

So, let's take a look at how to start working with Landscape.

In a new map, click on the Landscape button under Modes.
tut_001.png

This should cause the Landscape Edit window to pop up.
tut_002.png

We want to create a new Landscape, so scroll down to the section called Create New.
tut_003.png

We're not importing a heightmap for this tutorial, so don't worry about that section. What we're worried about is Heightmap Size. Because of the somewhat complex way Landscape works under the hood, the numbers you're going to plug in here may look a little odd. There's an in-depth description of how it works here: http://udn.epicgames.com/Three/LandscapeCreating.html

In the Heightmap Size section, we want to plug in some pretty small numbers since this is just a test to make sure we know what we're doing. In the Size (vertices) boxes, type 63 for both. In Component Size, select 63 quads and 4 sections per component. Now just click the Create Landscape button.

You should now have something that looks a bit like this:
tut_004.png

That large checkerboarded plane is your Landscape. How cute! If you want to add some sort of lighting, such as a DominantDirectionalLight, that will help with sculpting the Landscape.

From here, sculpting your Landscape is very similar to sculpting Terrain. All the tools in the Landscape Edit window have tooltips telling you what they are and information about them is available in the links at the top of this post. If you wish to sculpt some bumps and such, you can do so by holding Ctrl and clicking, just as you would with the Terrain tool.


THE LANDSCAPE MATERIAL SYSTEM

In a nutshell, the Landscape material system is really just an extension of the Material Editor. To take advantage of possibilities this offers, you will need to create a material that has your ground textures in it. If you don't know how to create a material and put a couple of textures in it, then this tutorial is going to get a little too complex a little too quickly for you.

Drop your textures into a new material. Your material editor should look a little something like this right now.
tut_005.png

For the purposes of this tutorial, I'll just be blending two textures. These textures are available in the August UDK. Their filenames are T_CobbleStone_D and T_Cobble_02_DL. I'll also be using their normal and displacement maps in the next post.

To blend these two textures together, you're going to need two nodes introduced with the Landscape system. These are TerrainLayerWeight and TerrainLayerCoords. The first puts your textures into layers so you can blend them and the second applies the textures to your Landscape UV coordinates. We're only going to need a single TerrainLayerCoords node and this will be plugged into our texture nodes. We will need two TerrainLayerWeight nodes, however, since we want to have one layer for each texture.

Plop two TerrainLayerWeight nodes and one TerrainLayerCoords in the material editor. Then plug them into your texture nodes like this:
tut_006.png

Now, that's all fine and dandy. However, there's a problem that may not be immediately obvious. Each texture layer you'll want to paint onto your Landscape needs to have a unique name, but you're working with a single material that only has one name. How to overcome this obstacle? Click on the TerrainLayerWeight nodes and type in a unique name for each of them under Parameter Name. You're going to use these names in the Landscape Edit window in just a moment.

This is what your material should look like now. Note the names of the TerrainLayerWeight nodes have changed to reflect the names of the layers they'll be assigned to.
tut_007.png

We're now finished with our very basic material and we need to apply it to our Landscape. Save your material and close the material editor.

To apply the material to the Landscape, select it in the Content Browser and then double-click on your Landscape in the main viewport. This should open the properties for the Landscape.

tut_008.png

Under the Landscape rollout, click the green arrow next to Landscape Material and close the properties window.

NOTE: If your Landscape turns black in the viewport, DON'T PANIC. That means your material has been successfully applied.

Now, finally, we can get to the part everybody wants to see: Painting texture layers.

LANDSCAPE TEXTURE LAYERS


Open up the Landscape Edit window if it isn't already open and scroll to the section under the Editing rollout labeled Target Layer. In this section, you should see a brownish box with the words Height map and an icon of displaced wireframe terrain. This is a texture layer, and it just happens to contain the height map for your Landscape, as opposed to a texture you'd want to paint color onto.

tut_009.png

Notice the three Edit Modes you can select. For this tutorial, we need the one in the middle, Edit. Click the radio button next to Edit and it should change to look like this:

tut_010.png

We're now going to add layers to paint onto the terrain. To do this, simply type in the name you entered for one of the TerrainLayerWeight nodes and press the + button to create the layer. Follow this same procedure for subsequent layers.

The Target layer section should now look something like this:
tut_011.png

Now that you have a couple of layers, it's time to actually paint them onto the Landscape. Since the Landscape is totally black right now, it's a good idea to lay down a base using one of the layers so you can see what you're doing more easily. To do this, click on one of the new layers you created. It should be highlighted and the Height map layer should gray out. Now you can paint on the Landscape as you would if you were sculpting terrain by holding Ctrl and clicking and dragging.

Since you probably want to fill the entire Landscape with a texture, you should probably adjust the Brush Size, Tool Strength and Brush Falloff so that you can cover as much surface as possible and then click and drag on the Landscape. This should fill large portions with texture very quickly.

If you did everything correctly, you should have a Landscape that looks a bit like this:
tut_012.png

Now that you have a texture applied to the Landscape, it's as easy as selecting the other texture layer and painting with it in the same way to achieve whatever look you want. The links at the beginning of this post have a wealth of information on how to use these tools in detail, so make sure that you read through them carefully if you have any questions about how to use Landscape and its texturing tools.

In my next post, I'll show you how to take advantage of the new material system that Landscape uses so that you can blend textures together in ways that were previously only possible on imported meshes. Vertex painting, bitches!

Replies

  • Swizzle
    • Offline / Send Message
    • Joined
    • 86 Topics
    • 2.8K Replies
  • Bart
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 187 Replies
    Thanks for this Swizzle :) Looking forward to see the next tutorial !
  • Ace-Angel
    • Offline / Send Message
    • Joined
    • 204 Topics
    • 4.7K Replies
    Vertex painting bitches indeed! Can't wait for that post, awesome work mate :)
  • Froyok
    • Offline / Send Message
    • Joined
    • 29 Topics
    • 1.6K Replies
    Bart wrote: »
    Thanks for this Swizzle :) Looking forward to see the next tutorial !
    Me too ! :)
  • Visceral
    • Offline / Send Message
    • Joined
    • 46 Topics
    • 790 Replies
  • Zipfinator
    • Offline / Send Message
    • Joined
    • 46 Topics
    • 2.7K Replies
    Thanks for the tutorial Swizzle. I made a quick landscape and am trying to paint the materials on it, but after I apply one material to one part it won't let me subtract or paint another material over it. Isn't Control+Shift+Left Mouse how you subtract?

    EDIT: Figured it out... The brush strength was defaulted at 0 for some reason. Derp.
  • Jeff Parrott
    • Offline / Send Message
    • Joined
    • 100 Topics
    • 3.5K Replies
    Jeff Parrott veteran polycounter
    Sweet Swizzle! Been thinking about messing around with landscape. This will definitely help.
  • b1skit
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 71 Replies
    Hey Swizzle, great tutorial. Any idea how to get normal maps to work with terrain?

    I've tried using the same TerrainLayerWeight and TerrainLayerCoords blending mode material method described above, but it doesn't seem to work at all with normal maps?

    The epic documentation is vague (and possibly outdated), the same setup works perfectly for specular and diffuse... I'm tearing my hair out.

    Any help/advice appreciated :)

    the same setup also works for the specular slot)
  • EvilPixills
    • Online / Send Message
    • Joined
    • 22 Topics
    • 141 Replies
    Well executed. Looking forward to Part 2.
  • HeliosphanXtal
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 3 Replies
    Hey, I also have the issue with the normal maps (like b1skit has I guess).
    what I do basicly is this; I set up my spec and normal maps also with terrainlayerweight nodes, like the tutorial does with the diffuse maps.
    I give these (layerweight-)nodes the same names as their difuse 'brothers'.
    I noticed this works fine up to a set of 3 textures with each their spec and diffuse.
    But from the moment I add a 4th one, the terrain texturing goes blank.
    Is this because I hit the DX9 limit?
    Or is there a better way to do what I am trying (so painting with diffuse, spec and normal maps for grass for example at the same time, instead of just diffuse grass)

    cheers
  • Sandro
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 622 Replies
    Hey Swizzle, thanks. Have never used UDKs landscape system before, my question might sound silly :)

    Basically I'd like to know if it's possible to pull this kind of environment using landscape.

    BIGegypt-railway-tours-and-train-travel.jpg

    Where there is little or no elevation data but need for complex material transitions (blending diffuse/normal/spec elements of several different concrete tiles, soil, asphalt, grass) Or am I better off designing custom tile-sets and using vertex paint?
  • b1skit
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 71 Replies
    I think that would be remarkably easy to pull off. Just taking a look at that reference pic, I see the following materials:

    - Plain Gravel/dirt
    - Larger, darker gravel under the tracks
    - Grassy, weedy dirt
    - Weedy, garbage-littered dirt

    You could easily blend those together, and then cover the landscape with:

    - Static meshes for the trains, tracks (modular), fences, poles etc
    - Foliage meshes (for the overgrown grass)
    - Garbage meshes (add some 3D clutter on top of your garbage texture)

    I actually think the HARDEST part of the scene is going to be your skybox. Large, flat areas that fade to the horizon are tough, you need to believably obscure the void from the players view (and this scene doesn't call for very dense fog). You're gonna have a lot of work building background meshes (buildings, highways, etc) that obscure your horizon than the work involved in setting up your landscape textures.

    What does everyone else think?
  • b1skit
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 71 Replies
    HeliosphanXtal: My normal maps don't blend at all. I can plug one normal map directly in and it will appear on my landscape, but if I attempt to set up the TerrainLayerWeight and TerrainLayerCoords blending mode material with my normal maps it doesn't work. Is this what you're seeing?

    Are we just restricted to 1 terrain normal map?
    Is anyone able to get more than 1 normal map to appear (or even better, blending normal maps?)
  • Sandro
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 622 Replies
    @b1skit

    Thank you, that's not the actual landscape I'm going to attempt, only ground portion is similar. I'm aiming for this quality of blend, where both diffuse, normal and spec elements are correctly blended using custom mask or heightmap.
  • b1skit
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 71 Replies
    Damn, that's an amazing tut. BOOKMARK :D
  • HeliosphanXtal
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 3 Replies
    b1skit;
    I manage to blend 3 layers with diffuse/spec and normal maps.
    Check my image here; it shows my shader up to the breaking point.
    what I show in the image works for me; but once I add a 4th texture, it goes wrong on its normal map. udklandscapepaintlimit2.jpg

    This is the link for the image if it doesnt show here;
    http://imageshack.us/photo/my-images/97/udklandscapepaintlimit2.jpg/
    udklandscapepaintlimit2.jpg
  • HeliosphanXtal
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 3 Replies
    I think the issue is related to the amount of texture samplers you can use; I noticed that it works up to 10/12.
    Regardless if it are diffuse/specular/normal maps.
    I ran some tests and it all seems to point in that direction;
    this explains also why it worked for me up to 3 diff/spec/nm (total of 9/12 texture samplers) and also with some other tests I did; it works also with 5 diffuse/normal maps if you drop the specular.
    So whatever combo you make, with a maximum of 10 texture samplers seems to work.

    cheers
  • b1skit
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 71 Replies
    Hrm.... INTERESTING. I can test this very easily myself, but I'm wondering: Is it SPECIFICALLY limited to the number of unique texture samplers?

    I'm guessing if it is, we still might be able to use some normal map blending trickery to create some extra variation if we go above 9 unique texture samples?
  • Lithium
    • Offline / Send Message
    • Joined
    • 0 Topics
    • 1 Reply
    I can only hope that you will post the next tute on vertex painting in landscape mode soon... I have been attempting to work this out for hours and it is driving me crazy.
  • King Mango
    • Offline / Send Message
    • Joined
    • 30 Topics
    • 200 Replies
    Just reserving a seat in the most clear cut and helpful tutorial I've found in two days of searching. Thanks Swizzle. :cheers:
  • MasteroftheFork
    • Offline / Send Message
    • Joined
    • 22 Topics
    • 388 Replies
    Ah excellent tutorial, this really helped a lot :)
  • Jessica Dinh
    • Offline / Send Message
    • Joined
    • 69 Topics
    • 1.7K Replies
    Thanks so much Swizzle, this is exactly what I've been looking for. Now my Landscape is all set up! Happiness! :D Looking forward to your vert painting tut ^_^
  • King Mango
    • Offline / Send Message
    • Joined
    • 30 Topics
    • 200 Replies
    bump :D
  • synergy11
    • Offline / Send Message
    • Joined
    • 80 Topics
    • 318 Replies
    Awesome tutorial!
  • Reverenddevil
    • Offline / Send Message
    • Joined
    • 63 Topics
    • 316 Replies
    Ya, thank you very much Swizzle. There is not much out there yet on Landscape. This is exactly what i was looking for..!:thumbup:
  • Bumper
    • Offline / Send Message
    • Joined
    • 9 Topics
    • 77 Replies
    Thank you indeed for the Tut. Got me rolling on Landscape for sure!

    Any word on when you'll address normals?

    Thanks again!
  • jahanzaib1x
    Your tutorial is awesome... i am new here your tutorial helped in texture section ;)

Leave a Comment