WiseDisplacement01: Displacement basics
This tutorial was originally created by wisemx.
Ported from SDKnuts.net to VDC by: Peter [AGHL] 13:27, 12 Feb 2008 (PST)
First the facts
- Displacements can not be converted into entities. (i.e.
- They do not seal your map. Your map must be sealed against leaks.
- Do cast shadows and have a collision system. (i.e. Players, NPCs and Vehicles)
- They are static and can not be moved in the game.
- Displacements must be created from normal 6-faced (4 sided) brushes.
- Do not block PVS Visibility.
- Can add dramatically to the overall file size of your map.
- They can be Clipped, Vertex Edited, Rotated, and Moved in Hammer.
Displacements will be one-sided once they are created, the original brush is tossed. As a general guideline you can seal behind the visible face with normal world brushes entirely textured with nodraw. Making these sealing brushes 16 units thick works out well. They can overlap the displacement but be careful that they don’t come through the face or you will see gaps in the game.
When creating displacement floors it’s often best to create two brushes for the floor identical in size. The top one will become the displacement, the bottom one will seal your map. Before you create a displacement apply the texture you will be using to the entire brush you are starting with. Once you create the displacement faces the other faces will be discarded and you can not have nodraw faces on displacement surfaces.
Displacements can be used anywhere but they may require finessing.
Here are some uses for displacements in your maps:
- Outside map geometry, such as seen throughout HL2.
- Columns and pipes.
- Perfectly round cylinders.
- Corners on buildings.
- Tunnels and caves.
- Contoured cushions for beds and seats.
- Glass tubes.
Let’s create a simple displacement floor.
- Make sure Snap to Grid is on. ( + )
- Create a normal world brush entirely textured with nodraw.
- Select this new brush, hold and drag a clone of this brush by dragging it in the side or Front viewport.
- With the new brush still selected chose a texture and apply it to the entire brush.
- For this example I’m going to use
- We now have two identical brushes, once entirely textured with nodraw and one entirely textured with
- The bottom brush is complete; we will not do anything else to it.
- This brush now serves the purpose of sealing the map.
Create the displacement map
- Open the Face Edit dialog. ( )
- Click the Displacement tab.
- Left mouse click on the top textured brush face to select it.(To select multiple faces hold .)
- With only the top face selected click the Create button, it will default to a power of 3 which is fine for our project. Click OK.
- The Power of your displacement surfaces can be 2, 3 or 4.
- Power of 2 = Simple displacements where fewer triangles are required.
- Power of 3 = Common applications, all around best option.
- Power of 4 = High triangle count, should be used with caution.
- The top face is now a displacement surface and all other faces of that brush are gone.
- Our new displacement surface is still flat.
- Let’s add some noise to give it some shape.
- With the Face Edit dialog still open and the displacement surface still selected click on the Noise button.
- Adjust the Min and Max and click OK.
- Our displacement surface now has shape.
- Even though the original brush shows as being the same in the 2D viewports you can see how the brush will look in the game in the 3D viewport.
- We have shape now but we can add a little more by using the Displacement Paint Geometry tool.
- Don’t go crazy with this tool, it’s far too easy to blow your displacements out of proportions with this tool. Use the adjustments and make careful changes.
- Click where the triangles intersect to make changes in that area.
- Left click to raise the geometry.
- Right click to lower the geometry.
- Make subtle changes at first until you get used to this tool.
For our final touch we’ll add some contrast to the floor texture by using the Displacement Paint Alpha tool.
- Move around with the WASD keys as you use the Left mouse button to paint.
- You can hold down on the Left mouse button and just sweep the area.
- Use the Right mouse button to restore.
Seal your new displacement project by building skybox brushes and ignoring the displacement brush. Your new displacement has nothing to do with sealing your map, you should only be concerned right now with that normal brush we created in the beginning, the one that has remained under our displacement.
light_environment in your map, an
info_player_start and you’re ready to compile the map and test your new displacement. I’ve also placed one
env_cubemap in the very center at the player's eye level.
- Keep in mind objects will need to be placed above the displacement surfaces so they aren’t stuck when spawned in the game.
- For many objects it’s best to place them well above the displacement surface and let them fall to the ground when they spawn.
The final effect: