Complete Displacements Guide
Tutorial Quick Nav
1.0 - Brief Intro. Completed
2.0 - Displacement Settings Info Completed
2.1 - Basic Displacements - In Progress -
 
2.1.1 - First Steps Completed 02/07/08
 
2.1.2 - Displacement Editing - In Progress -
 
2.1.3 - General Rules Completed 02/13/09
3.0 - Advanced Uses - 5/7 -
3.1 - Basic Shaping Completed
3.2 - Sealing Completed 02/15/09
3.3 - Sudivision Tricks Complete Rewrite?
3.4 - Cliff Paths Completed 02/07/09
3.5 - Caves and Tunnels Simplify more/complete
3.6 - Carving Into Displacements -ToDo-
3.7 - Curving Displacements (Roads) -ToDo-
4.0 - Blend Textures -ToDo-
4.1 - Using Blend Textures -ToDo-
4.2 - Custom Blend Textures -ToDo-
4.3 - Advanced Blend Textures -ToDo-
5.0 - Detail Props -ToDo-
5.1 - Use with Blend Textures -ToDo-
5.2 - Manual Placement -ToDo-
5.3 - Custom Detail.vbsp -ToDo-
5.4 - Custom Detail Sprites -ToDo-
5.5 - Real Model Use -ToDo-
Brief Intro
This is my second attempt at a displacement tutorial, however unlike the first I will not just quickly state something and move on, I'm going to go into detail on how to do more advanced tricks with displacements and achieve better results and beautiful looking maps. Displacements go hand in hand with ground for most mappers so its almost a requirement to use them. Also displacements give us the chance to get away from the rigid shapes and structures that dominate the mapping community and create more organic looking scenes and environments.
Through this tutorial I'm going to assume you know a few things about hammer and its tools however I will include a section here on the absolute basics of mapping, my apologies however you can skip it and move to the next if you feel you have the existing skills in place. I will try to keep the word count down in this tutorial and have mainly visual steps but there will be some dry spots nonetheless, oh and no promises :D
Also,
DISPLACEMENTS WILL MAKE LEAKS! - wanted you to be aware of this from the start, they are not solid, visleafs go right through them so you need to follow proper building methods to seal your level from the void. Never skip those steps. Its a beginners mistake that you should avoid.
Displacement Settings Info
Displacements become entities once they are made into a displacement, resulting in how they don't effect vvis during its processing and doesn't block the player from rendering items and objects behind it. So the first thing people should know is that if you make a displacement, don't then again tie it to yet another entity type, ie Func\_detail etc which is a common mistake some people make.
However, since a displacement is more or less an entity, we can play with its properties and settings. The basics you should all know about. Increasing and decreasing the power of the displacement makes it more or less detailed in its shape that you can modify by using the Paint geometry feature, Alpha painting to use blend textures, subdivision, sew etc should all be fairly well known. Those are the basics I shouldn't have to go into too much detail about here but there are more options that are not used often. I'm speaking of the flags that you can enable on displacements. There are three simple options:
- Physics objects will pass through the displacement. Players wont.
- Players will pass through the displacement.
- Bullets will pass through the displacement.
Those properties can have a few applications for mapping, first basic idea would be if your making snow then you could duplicate the displacement and have the second one a few units above the real one, turn on all three settings and then players will look like they are actually running through snow, minus the foot prints of course, Resulting in something similar to this.
Could use this same technique for mud or similar substances What you can do with these extra options is completely up to your imagination.
Basic Displacements
Going to run over some ground rules when it comes to displacements, things you simply cannot do with them, first and foremost is that when you make displacements you cannot tie them to another entity, like func\_detail or func\_breakable, this will cause your entire map to fail compiling and end up wasting your time. Just don't do it, the other thing is that displacements don't seal your level, they leave gaps in the geometry that must be sealed because once again, your map will fail to compile. Also, a displacement cannot be any shape other than a rectangle, trying to create one with more sides will simple fail and provide yet another error in the compile log. Don't let this discourage you however.
Keeping those main issues in mind we're going to go through some basic displacement work.
Going to a straight step by step process here so its best to have hammer open and follow along, I will be colour coding this section to help beginner mappers.
First Steps
- First thing we are going to do right now is increase the grid size to make out lives easier. The current setting of the grid snap can be seen in the bottom right of the hammer interface. To change it you can use the [ or ] buttons on the keyboard or via the buttons in hammer
. For now click the Plus Sign Button or the ] key to change the grid size to 32 units.
- With a blank screen and the grid settings complete, create a basic block brush with the
button as seen on the left of the screen (may change for customized interfaces) and go to your top view panel and create a simple 512x512 block and 32 high via one of the side views. Placement of this brush is not important. Your view should now look similar to that on the right.
- If your view is not centered on the brush as mine is then click on the brush, go to the top menu, select View > Center Views On Selection or press CRTL+E. That will do the three 2D views, now go back to the View menu and select Center 3D Views On Selection. You should now see some yellow lines across the screen.
- Move your mouse over the window and press the Down key a few times and S to zoom backwards in the screen. You should now see the normal brush in the 3D view. Using the WASD Keys and the mouse/arrow keys you can move around within the 3D view. Feel free to play around with this for a while.
Try to put the 3D view in the same type of perspective as mine seen on the right, viewing it from the top at a bit of an angle. This will be easier to work with later when dealing with texture application and the creation and modification of the displacement.
- Go back over to your left toolbar and select the texture application tool
. A new menu will pop up, before playing with anything in this menu move the mouse to the 3D view and select only the top face of the brush as we don't want to make the sides or bottom into a displacement since they will not be used.
With the top face selected we are going to select a suitable ground texture, so go to the browse button in the bottom left. The material browser will show up, use the filter option at the bottom and search for "blend". Scroll down a bit and double click to select any blendable ground texture you wish, I will be using the nature/blendmillground008\_2\_plants texture for this tutorial. Now Click the Apply Button within the texture application window, you will see that the top face of the brush has changed to the ground texture now.
- Now that the brush is set up and ready we can turn it into a displacement. With the top face of the brush still the only one selected move into the displacement tab of the texture application tool.
You should see quite a few new buttons and inputs available. We are just going to play with the basic ones, I'll explain the others later. The first thing that needs to be done is hit the "Create" button to turn that face into our displacement. Once you've done that you will see all the other sides of the brush are gone and only the top is left.
If you did this incorrect then all the sides would have been turned into displacements,
Displacement Editing
General Rules
- Must be 4 Sided.
- Cannot be tied to an entity. Displacements are already classified as an entity.
- Can only sew displacements:
- of Equal Power.
- where edges match in length and endpoints.
- where edges are 1/2 (1/4 works but can create gaps) length of the other and share an endpoint.
- Can only subdivide displacements that can be sewn together. Will create errors otherwise.
- Will NOT split visleafs or seal your level from leaks. Only standard world brushes will.
- Displacements are completely rendered when within a leaf that can see them. Even if behind or under an object so you can't "visually" see.
- Do NOT overlap displacements, follow the correct sewing guide.
Advanced Uses
Basic Shaping
...
...
...
...
...
...
Sealing
Displacements are not normal brushes anymore, and like brush entities they will not seal your level from leaks. So a common problem people face is that their maps leak and they don't know why. Normally due to the ground being a displacement and as such its as if they don't have anything there when they compile so leaks happen.
Sealing the areas where your using displacements is
EXTREMELY IMPORTANT. You can't skip this step ever.
A good way to look at your level to check for leaks is to use the autovisgroups feature in hammer. By turning certain groups off you can your map as it will be cut up ingame with visleafs and also spot leaks much easier rather than constantly loading pointfiles to locate each individual one.
The groups to turn off are those that you can see on the right so that yours matches it. The reason behind it is that only World Geometry effects visleafs and seals your level, however, the displacements within the World Geometry group do not - I'm not sure why they still have that under the same group.
Using CS\_Militia as an example to show the difference between in the map when you look at it without the displacements to see how they have been 'roughed in' so to speak with nodraw brushes to seal and split the level up.
You can see how the basic shape and structure of the displacements have been blocked out with nodraw brushes, this allows vvis to properly split up your level into visleafs that will be useful and also seal all the leaks that would have been there without them.
Its very important that that only nodraw is used behind displacements to seal them and not toolsskybox for example. This will create oddly lit displacements and create brighter spots along the seams between sewn displacements (generally overlapping displacements), also this will happen where they intersect with normal geometry. You can see these two examples below:
In a few rare cases sewing displacements together will remove these visual glitches but even so, its best to have them sealed properly from the void without using the toolsskybox texture - for optimization purposes anyways.
Also, I would suggest reading about this tutorial as well in terms of proper skybox creation that will also help with displacements.
Using Tools Textures - Prt 5
Subdivision Tricks
...
...
...
...
...
...
Cliff Paths
Creating cliffs is a bit easier to do than one would think, you just have to understand the sewing rules that were already covered here - each edge must line up or be 1/2 of another same power displacement - and that displacements must be 4 sided, no triangles here. So cliffs might appear like something difficult to do because one would think they are shaped like the following:
But that triangle piece cannot be made into a displacement, its just not possible. So the way around that and still have all displacements correctly sew together is to form it a bit differently to create it like this:
Just by using a bit of vertex manipulation to move one point to the midpoint of the top path so that it will still sew together correctly when constructed. One could also just make a new displacement off that midpoint line as well to ensure a proper seam between all the displacements.
Simple enough right?
When building your cliffs its a good idea to do it entirely in nodraw brushes in the configuration like you see in those sketches. this will make it easier later to select only the faces you need to turn them into displacements, then following similar methods seen in the subdivisions section of the tutorial you can shape and tune them to a realistic style.
Takes no time at all to construct, just remember that these are displacements and MUST be sealed from behind via more nodraw brushes otherwise you will get either leaks or visual errors from lighting along the displacement seams.
Caves and Tunnels
Simple Tube Tunnels
Starting with something easy here that you can build and design fairly quickly. Tube tunnel systems, they are the most common used tunnels that mappers make in counterstrike or any other source mod for that matter because they are simple to create and fairly organized and simple to optimize afterwords. A complex tube based tunnel system can be created within a few minutes when you have just a few basic "prefabs" created in which to build it.
Just going to be working off a 16 unit grid size and making some bocks that are 128*128*16. Going to need 12 that are arranged to form a hallway as seen in the screenshot. Each block should have only the inner face edges touching, no overlap or gaps between them. This is because the inner faces will be our displacements and they need to be able to sew and subdivide together.
Now the reason that there are three displacements for the top, bottom, left and right sides is that only the middle section is what we need because it will be perfectly round whereas if we used only one the subdivisions then they would go to the square shape at either end, which is useless for what we want.
Carving Into Displacements
...
Curving Displacements (Roads)
...
Blend Textures
Using Blend Textures
...
Custom Blend Textures
- Basic gradient blend.
Advanced Blend Textures
- Blendmodulate textures
Detail Props
Use With Blend Textures
...
Manual Placement
...
Custom Detail.vbsp
...
Custom Detail Sprites
...
Real Model Placement
...