Instancing is the re-use of model data across a map in order to save memory and improve performance. When a model is placed several times in a map, its triangle data is saved for each occurrence. However if the model is instanced, its data is saved out just once and shared between each instance in the map. This results in a smaller map file and less data to manage.
Models are also instanced if they are placed inside LOD Groups with set to .
Generally, any model that is reused many many times in a map - such as trees or rocks - benefit from being instanced. The screenshot below shows Slipgate with instanced models turned on and turned off. Note how the craggy, pointed rock models and some Strogg structures that feature heavily in the map are instanced to save memory.
Very generally, instancing is something that is safe to forget about unless your map has an unusually large number of models, and starts to shows signs of slowdown or excessive memory usage. Basic maps will rarely require tweaking of instanced models, and common sense is the key to maintaining good performance without much effort (i.e. realising that a model that appears 500 times should be instanced)
Since instanced models share both their rendered mesh and their collision mesh data, there is a small performance cost for the reduced memory use. However, an instanced model can be made to output its own collision data by using the key on the entity, which results in faster collision testing at the cost of higher memory usage.
- r_skipInstances - turning this on prevents instanced models from being rendered.