Extruding your models
One of the biggest problems in games is repetition. Creating new content is a time-consuming task, and when you have to face thousands of enemies, chances are that they will all look the same. A relatively cheap technique to add variation to your models is using a shader that alters their basic geometry. This recipe will show you a technique called normal extrusion, which can be used to create a chubbier or skinnier version of a model, as shown in the following screenshot of a soldier from the Unity camp demo:
For ease of use, I have provided a prefab of the soldier in the example code for this book under the Chapter 07
| Prefabs
folder.
Getting ready
For this recipe, you need to have access to the shader used by the model that you want to alter. Once you have it, we duplicate it so that we can edit it safely. This is how it can be done:
- Find the...