Vertex Editing Tutorial

From Oldunreal-Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Vertex Editing is the very base of using brushes. It simply is a question of selecting and moving the vertices of the brush you have selected.

Simple Vertex Editing

The first thing you have to do is create a brush and select it. Once this is done, there are two ways to move the vertices. The basic version is moving them one by one. To do this, click on one of the vertices of your brush. This will make this vertex the brush's pivot. The selected vertex should become a cross instead of a simple point.

Once this is done, hold the left alt key and the LMB down, and move your mouse. The selected vertex will move accordingly.

Advanced vertex Editing

How to proceed

Simple vertex editing as described above will do the trick if you only need to move a couple of vertices on a very simple brush. If you need to move a lot of vertices (say you're using the terrain brush builder), you have a better tool to use: the Vertex Editing tool (the top-right tool of the left toolbar in UnrealEd).

Select a brush and select this tool. Your mouse will change to a white square with two lines connecting it to two black squares. To select some vertices, hold LMB and the left ctrl + alt keys down (or AltGr on some keyboards) and draw a square around the vertices you want to move in one of the 2D viewports. Once you have all the vertices you want inside the square, let it go. The vertices you selected are now white. Notice that if several vertices are on the same place in the 2D viewports, all the vertices under the one you included will be selected. This is a different behaviour from the simple vertex editing, where you could only select the first vertex in front of you.

Once you have selected the vertices, hold down ctrl and LMB and move the vertices you want.

Troubleshooting

Two dangerous things can happen. The first one is putting two vertices at the exact same place (for instance, making a prism out of a cube). This will get you a general protection fault crash with the message FPoly::Finalize<-FPoly: Not enough Vertices (0). Since 227i, the Editor will display warnings with this message but will not crash.

The other thing that could go wrong only happens if your faces are not triangles. It requires a little knowledge in 3D geometry:

  • A plane can be defined by three points.
  • A set of two or more points on a plane are called coplanar.
  • A square brush face has four coplanar vertices.
  • Hence, if you move one of the four vertices of a square brush face out of the plane defined by the other three, you can create BSP errors because you're profaning geometry!

Let's say I have a square, horizontal sheet of paper. If I pull one of the corners up, somewhere, the sheet has to be folded. This creates a line where the folding happens.

In 3D, the folding lines are the edges of your brush. The problem is that if you pull up the corner of a sheet that does not have a folding line (read : a square brush face that isn't split into two triangles with a diagonal edge), you will have a problem: the engine has to "guess" a non-existing edge. This appears as a visual error in-game.

If you really need to vertex edit a square brush face, split the brush (creates two brushes), tesselate the brush face (UEd2.1), or use a tesselated cube.

Nonplanar surface vertex.png

Experiments

The BSP error caused by vertex editing a non-triangular brush face so that its vertices are non-coplanar is relatively simple to create.

Base Geometry

  • Start the editor and subtract a non-tesselated cube. (click cube, click subtract) This will create a 256*256*256 "room" using the default cube brush.
  • In 3D view, select a wall surface, then right-click -> select all, ctrl-click the top surface (ceiling) to deselect it, right-click a wall -> tesselate surface
  • In the top view you should see a square subdivided into two triangles. In the front and side views you should see a square subdivided into four triangles. Each face of the cube has been changed from a square face to two triangles, except the top surface. This can be verified by getting rid of the builder brush by moving it or changing it to a different shape, then selecting the cube that was created. In 3D view the brush edges can be seen and individual surfaces selected.
  • Add a player start on the floor and a light near the middle of the room. Build all.
  • Save the map as v.e.clean.unr. At this point the square top face has coplanar vertices and should not generate visual BSP errors.

Break the Geometry

  • Save the map as v.e.broken.unr. Using the simple vertex editing technique outlined above, move one of the top vertices upwards by about half of the room height (i.e. 150%) using the side or front view.
  • Build all. Save the map as v.e.broken.unr. Play. At this point the "square" top face has one non-coplanar vertex and should generate an obvious visual BSP error as you look around the ceiling.

Stretched Geometry

  • Reload v.e.clean.unr. Save the map as v.e.stretch.unr.
  • Using the simple vertex editing technique outlined above, move one of the top vertices outwards by about half of the room width (i.e. 150%) using the top view.
  • Build all. Save the map as v.e.stretch.unr. Play. At this point the top face (ceiling) is not square, but all it's vertices should be coplanar and should not generate visual BSP errors.

Considerations

There are several places in UnrealEd 2.x where non-tesselated geometry can be created. All of the standard brush builders except the Sphere and BSP Terrain have at least one non-triangular (four-sided) face and only the cube has a Tesselated option. The 2D builder extrude option creates a shape where the sides are non-tesselated. The point is, when vertex editing be aware of the geometry and keep vertices of non-triangular faces coplanar to avoid BSP errors.

Note

To draw a square around vertices (multi-select or lasso) hold Ctrl + Alt + LMB and drag the pointer.