Complex Brush Creation

From Valve Developer Community
Jump to: navigation, search
Warning.pngWarning:This guide contains methods that are prone to random errors causing loss of floating-point precision, creation of invalid brushes and/or other errors. Proceed with caution. Consider turning complex brushes to models using Propper or use alternative methods using Displacements or Instances
Blank image.pngTodo: Revise "Creating A 45-Degree Cylinder Corner" section in case of unclarity.

Introduction

Creating complex brushwork without resorting to using many brushes can be tedious. Hammer allows you to have complex brushes without them being invalid nor having to create multiple useless pieces and unnecessarily increase the brushsides value.

Here are a few examples of complex brush creation.

A curved pipe connecting 2 cylinders.
An arch connected to rounded edges.
A dome.
A detailed connecting tube with all brushes vertexes connected.
4 complex brushes.
Note.pngNote:The Torus primitive was not used in any of the examples shown above. With this technique, you should no longer need to use such an inaccurate primitive.
Note.pngNote:This technique also applies to GoldSrc games. See this Sven Coop mapping tutorial.
Note.pngNote:It is recommended that you familiarize yourself with the vertex tool.

Creating A Sphere Type Corner

Let's go ahead and create a brush with a sphere type corner. Create a normal brush using the block tool.

A normal 6-sided brush.

Using the clipping tool, create a rounded edge (as if you were creating a cylinder).

Cutting The Edges Off.png
Cutting The Edges Off 2.png
Clipped Edge.png

Proceed to do the same thing on the adjacent side.

Proceeding At Doing The Same.png

You want to make sure that all vertexes are on grid. This is very important, else the editor will act all funky like later on.

Aligned Vertexes.
Make sure that there is a perfect 45-degree angle; making sure vertexes are all properly aligned.

Clip the corner of the brush in a 45-degree.

Clipping the angle on a 45-degree.

From here, you want to enter Vertex Manipulation mode by hitting Shift+V.

Entering Vertex Manipulation Mode.png

Pull the appropriate vertexes until you get the following shape.

VMM.png
VMR.png

Select both middle vertexes and hit Ctrl+F. This will split the face into 2 and eliminate the invalid solid structure error.

Selecting Vertexes.png
Everything went fine if Hammer doesn't report the solid as invalid.
Note.pngNote:If nothing happens, then the face wouldn't end up flat. Check that all your vertexes are aligned to the grid and on the same plane and try again.

Select the middle and bottom vertexes and hit Ctrl+F. Then, select the bottom and top left and hit Ctrl+F. Finally, select the bottom and top right and hit Ctrl+F.

Splitting Faces.png
Splitting Faces Again.png

Select the bottom vertex and move it so that each line shown by the arrows are straight.

Moving Vertexes.png

Finally, select the middle vertex and merge it with the one to the left or the right.

Merging Vertex.png
Merging Vertex 2.png
Final Product.

Creating A 45-Degree Cylinder Corner

The process is very similar to creating a sphere like corner. Create a block and clip the sides to have a cylinder type edge. The number of faces doesn't matter if it's higher than 2.

A brush with 4 faces clipped.

Cut the brush on a 45-degree. Pull the vertexes until they are straight. Make sure every vertex is aligned to the grid.

45-Degree Clip.png

Select the vertexes from top to bottom and hit Ctrl+F.

Note.pngNote:Once again, if hitting Ctrl+F does nothing, then your vertexes aren't placed properly.
Moving The Vertexes.png
Finished Product.
Warning.pngWarning:If you get the following error message (see screenshot below, then your vertexes were not aligned and/or on grid. You cannot recover from this error if it happens as Hammer will crash.
Error when attempting to split the faces. Hammer crashes if you see this error after clicking on "Ok". You cannot recover from this error.

Creating A Funnel Brush

Create a cylinder and enter vertex mode by hitting Shift+V.

Create cylinder.png

Select every yellow dots in the middle and hit Ctrl+F. Then select every white dot in the middle and hit Ctrl+F as well.

Note.pngNote:You cannot draw a box around the yellow and white dots using the selection tool and hit Ctrl+F. You will need to select a pair of yellow dots and white dots next to each other manually and go around the primitive. You also cannot select a yellow and white dot together. Hammer forces you to either choose one or the other. In some cases, we can circumvent the problem altogether, or find a different way to achieve what we want to do.
Splitting The Faces.png

Select the bottom vertexes and hit Alt+E.

Vertex Manipulation Bottom.png

Change the value to your desired value and once satisfied with the new look, exit vertex mode by selecting the selection tool ( Shift+S).

Final Product.
Note.pngNote:Hit Alt+P to make sure your brush isn't reported as an invalid brush structure.

Creating A 90-Degree Tunnel Curve

Note.pngNote:Before going further, enable "Arrow keys nudge selected object/vertex" in the Options.
This is a must have to make your life easier on the long run.
Note.pngNote:This shows how to do a 90-degree tunnel curve, but this method can be applied to any brushwork you'd like to have a curve for as seen in the first four screenshots.

This example will use two tunnels created using the arch primitive. To demonstrate the effectiveness of this technique, a couple of brushes that will act as detail has been added to the tunnels.

Two arches to connect.

Finding the correct rotation size

In order to properly connect those two arches, we need to find the proper size. Make a copy of a tube (in this example, the top one) and place it accordingly so that the finished product connects perfectly with the existing arches.

We have to use the distance from one tube to the other *2. More simply, (2 * 128 units) + (2 * 128 units) because there are 2 squares of 128 units big until the two arrows connect.
Note.pngNote:The number of sides is determined by the rotation number you input in the transform dialog box. In order to make sure that the finished product is 100% aligned and have a 360 degree rotation, you need to divide 360 by whichever number you want. The smaller the degree rotation number is, the more detailed the final product will look like, but the more expensive on brushsides it will be. Use it sparingly. Make use of a calculator. This example will make use of 15-degree rotations - thus creating 24 sides.

Select the top and bottom tubes. Hit Ctrl+M to open the transform dialog box. Rotate them by 7.5 degrees on the Z axis.

Rotating Brushes.png

Split the brushes in the exact center of the boundary box, then open the transform dialog box again and rotate 15 degrees the other way. Split the brushes in the exact center of the boundary box once again. Finally, rotate everything back into position by opening the transform dialog box and inputting 7.5 degrees.

Rotating 15 degrees.png
Second Split.png
Putting everything back into position.png
More Splitting.png

Remove the left and right sides of each brush.

Removing excess.png

Now comes the time to paste rotated copies of these. Unfortunately, we cannot use paste special for this as pasted copies will not rotate around the center axis. This is why "Arrow keys nudge selected object/vertex" needs to be enabled in the options. Select both copies, hit Shift+ to create a copy, then release the Shift key and press the key to put it back in the same spot. Hit Ctrl+M and input a 15 degree rotation on the Z axis. You will notice that the copy will connect perfectly vertex wise with the first set of brushes.

Copying Brushes.png
Notice how both set of brushes are perfectly connected together. No micro leaks either.

Then, using the newly pasted copy, copy and keep pasting using a 15-degree rotation until you get a full circle. Once you have your entire circle done, select everything, open the transform dialog box and rotate the entire brushwork by 7.5 degrees on the Z axis.

Final rotation.png
Almost done. Notice that the size of it is off by a few Hammer units. This is not a problem here as it will be resized without any grid snapping issue.

Slightly resize the entire brushwork using the corner handles until it's perfectly on grid.

Final Product.

The last thing you need to do is tie this entire group of brushes to a func_detail.

Final Product tied to a func_detail.

Wrapping Things Up

If you'd like to get your hands on a sample of what's been explained on this page, you may grab such sample here.

See also