Blender

Mesh Topology in Game Assets

Estimated reading: 4 minutes 662 views

This is a very large topic, and I recommend searching for more content about mesh topology on the World Wide Web and social media. It’s also about personal preferences and performance when it comes to assets made for game engines. In some cases, there’s a dependency/relationship between topology and assigned materials, especially when it comes to UV mapping and the use of texture maps.

Activating Stats Inside The Blender Viewport

In the image above, we see what is obviously a street with several lanes. This mesh is textured with five different surface materials, with each material assigned to faces between the red lines. Such lines are known as edges. Between each line there’s a face.
The face has a diagonal line that usually isn’t visible unless we triangulate selected faces.

In Blender, we can also enable stats that are displayed for the selected mesh. The stats in the image above show the following data:

  • Objects: 1/1 – number of selected objects
  • Vertices: 264/264 – total number of vertex points
  • Edges: 566/566 – total number of edges
  • Faces: 304/304 – total number of faces
  • Triangles: 502/502 – total number of triangles (faces with diagonals)

The last one (triangles) is the one we should focus on when optimising mesh objects for use in game engines. In this case, this mesh alone is considered to be low poly – see https://en.wikipedia.org/wiki/Low_poly

So how do we activate the stats?

In the Viewport Overlay Panel, we can turn on Statistics to view counts of objects, vertices, edges, faces, and triangles in the scene. Triangles are the important ones when working with game assets.

Asset’s Topology

The topology is the overall mesh structure of a 3D object, later exported for use as an asset in a game engine. It’s important to have a topology that is optimised and clean, with all edges connected to each other without edge/face/vertex overlaps, since these can affect shading and UVs.
In some cases, we can also triangulate faces to make it easier for the game engine to read the mesh topology. When exporting to other file formats, we can also triangulate faces (see image below).

UV Mapping And Topology

If we look at the UVs for some selected faces in Blender, we’ll see that the faces don’t cover the entire texture. This isn’t necessarily a bad thing, since the texture would look stretched when faces are rectangular and not quadratic.
On the other side, we could subdivide the faces to get quadratic faces. We could also scale up the selected face(s) in the Blender UV Editor (on the left side of the image) to cover more of the texture.
However, this is a seamless noise texture, and the noise (small, darker dots) would become smaller.

If we are going to apply normal maps or other fancy maps to the material in a game engine, we could adjust the topology, other texture maps, or UVs.

The texture in the left viewport is quadratic because it’s a power-of-2 texture, meaning 512 x 512 pixels.

Triangulating Faces Manually

To change the mesh topology, we can go into Edit Mode, then Vertex Mode, using the shortcut keys 1, 2, or 3 on the keyboard (not the NumPad). Next, select two vertex points and press J to join.
Before joining, we need to be absolutely sure that the two vertices are not loose and that all edges connect them.

Now we have a new diagonal edge between the two pink vertices. This is how we can manually triangulate the faces.

The other method is to select a face by first switching to Face Mode, and then hitting CTRL + T, and we get the same result.

Another alternative method is to use the triangulate modifier. But this modifier triangulates all faces of a mesh object. And as usual, most modifiers inside Blender can be assigned when we are in Object Mode.

And we can now apply the modifier if necessary.
This modifier also makes the diagonal edges visible when not applied, when we move back to Edit Mode. This can be useful when we want to see the triangles when manipulating a mesh object.