KatsBits
Creating 3D models, meshes & game content
3D modelling & meshing, level editing and textures making
Hints, tips and tutorials for 3D modelling & content creation

[back]Creating a terrain in Doom 3 using patch meshes

Contents ^
What's this about? ^

This tutorial is a follow up on the previous article about what you need to keep in mind when making a terrain in Doom 3 from patch mesh objects. This tutorial continues the 'optimising' theme a lays out some information about an approach that can be used to create terrain's that are as optimised as possible.

Models, terrain & too many polygons ^

In creating your terrain you may have noticed that, depending on it's size, it still contained a lot of triangles, probably because you may have laid out the terrain object as one big mesh. Now there is another way to create an interesting terrain but it's a 'compromise'; you'll get fewer triangles being used at the expense of 'boarders' between areas appearing which aren't too much of a problem to sort out.

Basically instead of creating one big mesh with a high 'primary' subdivision (see previous article) what you do is break the terrain down into individual component's that each have their own subdivision resolution. What this means is that the terrain is constructed from sub component's; a hill section, a river bed section, flat plane section and so on, all of which are then placed together to form the larger overall picture of the terrain.

What this does is allow better control over the whole terrain; objects that are far away or unreachable by the player can have much lower subdivision resolution than other areas because polygon detail isn't needed as it won't be seen. That's the basic concept, obviously how you work with it depends on the kind of details and feature you want on you terrain.

Using more than one patch mesh ^

The following images below show the basic principle involved in this method; separate patch mesh object manipulated into various shapes and forms and them placed together - in the case below; a simple mound and a slightly curved plane (ground).

Mesh No.1 - flat plain
Mesh No.1 - flat plain

It's noticeable in the shots above and below that each mesh object is using a different level of subdivision, obviously the 'type' of terrain effect you're trying to achieve will effect the level of subdivision you use; a river bed for instance, will use a different level of subdivision next to a rock outcrop.

Mesh No.2 - 'hill'
Mesh No.2 - 'hill'

Once you've got all your objects created they just need to be placed together in such a way as to bury part of the mesh - this prevents light leaks and cracks from showing up (see below).

There is one advantage to this approach; you can play around with the placement if the terrain objects, fine tuning gameplay and visual's. It's also easy to copy/paste sections to create new areas of interest.

Mesh 1 and 2 selected from underneath
Mesh 1 and 2 selected from underneath

Design note : don't forget that you need to encase or block out the patch mesh area in caulk covered brushwork otherwise the map will 'leak'. Patches do not seal the map against the void.

Completed terrain from meshes
Completed terrain from meshes
Patches & vertex texture blending ^

As was mentioned briefly above, there is one one big disadvantage - well two really;

  • You can't texture blend - because you can't vertex paint patch mesh objects (vertex painting is necessary for Doom 3's texture blending system to work).

  • You get 'seams' where sudden changes in texture type occur - as shown in the image above.

There's nothing you can do about the 1st, but the 2nd can be dealt with by placing smaller objects around any 'seams'; rocks, debris, walls etc., anything that breaks the appearance of the seams, basically by 'hiding' them.

If it's a real concern that the seams can be seen (and you'd rather not get you hands dirty in a modelling app) then what you could do is make a new texture in a photo editing app which blends together two textures. This can then be applied to another mesh and strategically placed over a seam giving the appearance of merging two or more objects together. Keep in mind that if you do this you'll need to create new textures that also blend the local (normal), height and specular maps as well as creating a new material file.

© 2008 KatsBits - All Rights reserved.
No part of this web site may be reproduced (unless for personal use) without prior written consent from KatsBits.com