Tutorial: Displacements Last edited 5 years ago2018-06-07 11:21:46 UTC

Displacement Basics

✔️ Download example VMF
See also: Tutorial: Creating blend textures for Displacements

One of the best improvements in the Source engine from the original Half-Life was the addition of displacements. Without displacements, HL2 wouldn't look half as good as it does. This tutorial will explain how to use them, as well as tips and tricks on using them.

What is a Displacement?

What do you use displacements for?

Displacements are generally used for realistic looking terrain like the ground and cliffs, But they have other uses. Look at some of the coast levels in hl2 to see liberal use of displacements.
Displacements can be used as cliffs as well as groundDisplacements can be used as cliffs as well as ground
Examples of displacements in HL2Examples of displacements in HL2

How to make a displacement

Displacements are fairly easy to make, so here is a quick step-by-step guide to make a displacement.

Step 1: Make a brush
Get out your brush tool and draw out your brush in the 2d views, and press enter. Put the top of the brush where you want your displacement to be (or in the case of cliffs, the side). Your brush should be a cube/block, as displacements must have 4 sides.

Step 2: Texture your brush
Select your brush, and click the texture application tool.
The Texture Application toolThe Texture Application tool
Hold ctrl, and click the top side (the one that will be the displacement plane). You should have 5 of the 6 sides selected. Now, in the texture application window, click browse. Select the nodraw texture, and click ok and apply.

Now, select the top face. Displacements can use normal textrures like everything else, but they have special textures made especially for them. They are 'blend' textures - to find them filter for 'blend' in the material browser. Pick one and apply it - I'll pick blendgrassdirt001a. Keep the texture application window open and your newly textured displacement plane selected.

NOTE: Texturing non-displaced surfaces with blend textures does work at the moment. Although Valve states when you load up a map with a blend texture on a non-displaced surface that they are 'removing this soon', there doesn't seem to be a timeframe set for when this will happen. As well as this, Valve have used blend textures on non-displaced surfaces in their own maps, so for the time being, you can assume it's ok to do.
A brush with a blend texture, ready to goA brush with a blend texture, ready to go
Step 3: Create your displacement
In the texture application window, there is a displacement tab. Click it. This is your main window for displacement-ing.
Creating a displacementCreating a displacement
Click the 'Create' button (you still only have the top face of your brush selected) and in the box that pops up, pick 3. This is the medium grid size. 2 is large, and 4 is small. Avoid using 4 on small faces.

Click ok in the box and you will see two things happen:
  1. Lines form on your top plane
  2. The 5 NODRAW faces disappear!
Try looking at your displacement from the back in the 3d view. Its gone! As said before, displacements can only be seen from one side.
A top-down view of the newly created displacementA top-down view of the newly created displacement
Step 4: Manipulation
With the displacement window still open, select the 'Paint Geometry' button. The new window that opens up lets you raise and lower points in the displacements.
Painting the geometryPainting the geometry
Have a muck around with this until your displacement looks nice and curvy. NOTE: The 'distance' and 'radius' lets you change the amount of effect the tool has. Turn radius up to move more points on the displacement, and put distance up to move the points faster. Left click to raise a point, right click to lower.
Curvy.Curvy.
Now close the window and choose the 'Paint Alpha' button. This new window lets you manipulate the texture on the displacement.
The Paint Alpha toolThe Paint Alpha tool
Remember when you picked the 'blend' texture for the displacement before? Well, the blend texture actually contains two textures which slowly blend into each other. The paint alpha feature lets you make patches of dirt in your grass, for example. Also, alot of blend textures automatically insert random grass sprites onto the places of the displacement painted with alpha. Its really handy. Make some of your displacement alpha, just for fun. The paint alpha window works exactly like the paint geometry window ('Value' is the speed of change from one texture to another).
Blended...Blended...
Here is what the final product looks like in Hammer:
...and served...and served

The Displacement Edit Form

Here is a summary of each feature on the displacement window.
The displacement "Face Edit Sheet"The displacement "Face Edit Sheet"

Create

You know how to use this one if you followed the first tutorial, the Create button is what you use to create a displacement. You must select a side or sides of your brush to be a displacement, and click the create button. Then the 'power' box pops up. 2 is the largest grid for low-detail work, 3 is average - use it in most cases. 4 is high, avoid using it except in special cases or on extra large faces.

Destroy

The complete opposite of Create, select the displacement and click the destroy button to return the displacement back to its original brush form.

Select

Nothing very involved, click this button to get the select tool to select displacements or displacement candidates (faces). Not used very often, as most of the other buttons open windows which, when closed, select the select button by default.

Paint Geometry

Used to manipulate points of the displacement. The Distance slider changes the distance moved in units by the point each click, and the Radius slider lets you change the area of the effect. The axis box lets you change whether the point is moved along the x, y, or z axis. Face normal means that it will move at a 90 degree angle to the displacement plane. Click and drag the point for greater effect. Left click to raise, right click to lower.

Paint Alpha

Used to change the texture of the displacement if it is textured with a 'blend' texture. The Value slider lets you change the speed the texture will change. The Brush drop-down box lets you change the size of the 'Paintbrush', letting you change a large (or small) amount of texture at one time. Click and drag for greater effect. Left click to increase alpha texture, right click to decrease.

Invert Alpha

This switches all alpha textures to their direct opposites. I have found no use for it yet, but hey, you never know.

Noise

Lets you make your displacements all randomly bumpy in one click. It raises or lowers each point of the displacement to a random height within a range that you specify. Dont make the numbers too far apart or the displacement will look really strange.
The noise popup boxThe noise popup box

Sew

Displacements can be connected together flawlessly:
Before sewingBefore sewing
After sewingAfter sewing
This feature lets you join 2 or more displacements if they have one of these special features:

1. 2 vertices from one displacement share the exact same points with 2 vertices from another displacement (i.e. they share an edge)
Two displacement edges touchingTwo displacement edges touching
2. same as #1, except one of the displacements is a brush.
Displacement edge touching a brush edgeDisplacement edge touching a brush edge
3. same as #1, except one of the vertices on one displacement is replaced with the midpoint of that displacement.
Displacement edge half the width of the one it's touchingDisplacement edge half the width of the one it's touching

Subdivide

A very powerful tool which smooths a displacement so it is round, but retains the original vertices of the extremities of the displacement or group of displacements. 2 displacements can only be subdivided if they are also sew-able. This tool is best used with 'sacrifical' displacements (sounds evil huh?). This technique is best learnt through use, so more info in a later tutorial. For a quick look at what this tool can do, make a perfect cube, make all 6 sides displacements (select all and click create), and, with all 6 selected, click subdivide. Ta-da! A perfect sphere!
Subdivide can easily create complex surfaces.Subdivide can easily create complex surfaces.

Other Resources

These websites are external to TWHL and may be offline.

Beginner

VDC's Displacement Page - The VDC always has a good range of articles, and since it is a wiki, it is usually the most helpful and accurate information resource. This article has a very detailed and easy-to-read explanation of displacements and how to use them.

Snarkpit - Snarkpit has some basic tutorials on displacements. Part 2 is here.

Interlopers - Another tutorial on displacement basics.

The VDC, again - A more detailed look at the displacement face edit window.

Holes in Displacements - Learn how to make holes in displacements.

Grass on Displacements - Grass sprites show up automatically on some alpha blend textures! Find out about them.

Intermediate

Displacement Cliffs - Shows you how to make cliffs with displacements.

Rock Formations - Make realistic looking rock formations with displacements.

Subdivide - The Subdivide tool, general tutorial.

Tunnels and Caves - Making realistic tunnels and caves with displacements.

Subdivide & Vertex Manip - Using Vertex Manipulation in combination with the Subdivide tool.

Curved Pipes - Make curved pipes with displacements. See Part 4 on how to make hollow curved pipes.

Blend Textures - How to make your own blend textures.

6 Comments

Commented 15 years ago2008-06-22 15:01:21 UTC Comment #100768
splendid stuff Pengi, thanks a bunch...

LeFtY
Commented 15 years ago2008-07-11 06:56:13 UTC Comment #100769
nice work!
Commented 15 years ago2008-09-03 19:45:30 UTC Comment #100770
holy crap that's what i'm talking about!!

thank you very much
Commented 14 years ago2010-04-04 16:12:46 UTC Comment #100771
WOW! thank you!
Commented 13 years ago2011-02-16 01:04:01 UTC Comment #100772
Superb tutorial! I'M DISPLACMENTING!!1

)

Commented 12 years ago2012-02-19 06:05:05 UTC Comment #100773
Thank you for making this.

You must log in to post a comment. You can login or register a new account.