Cull Distance Volumes
Document Summary: A reference for cull distance volumes in Unreal Engine 3.
Document Changelog: Created by Daniel Vogel.
Overview
This document contains an overview of how to use cull distance volumes. It assumes the reader is already familiar with the basics of volume placement described in the Using BSP Brushes page.
Cull distance volumes offer a convenient way to set, and easily tweak, the cull distance on a variety of objects. The main intention for implementation was to optimize the case of large outdoor maps with detailed indoor bases, as is common in Unreal Tournament 3.
Setting up Cull Distance Volumes
To create a cull distance volume, you can right-click on the volume button and select CullDistanceVolume to create a cull distance volume the size of the current builder brush.
All primitives with center points being encompassed by the cull distance volume that have bAllowCullDistanceVolume set to TRUE (default value) will have their used cull distance updated based on the settings of the CullDistances array. It is worth noting that manually setting the cull distance on a primitive will work in conjunction with cull distance volumes as the code internally picks the lower value, unless it is 0. The CullDistances array is a mapping of size (diameter of the objects bounding sphere) to a cull distance to use for this size group and the code will find the closes match and assign the associated cull distance.
The default setting for cull distance volumes is to have two entries, Size=0, CullDistance=0 and Size=10000, CullDistance=0. By setting the first CullDistance to 1000 all objects with center points inside the volume that have a bounding sphere diameter of less than 5000 will get an effective cull distance of 1000 and all above will have a cull distance of 0, aka no distance culling. Using a best fit approach was chosen to allow entry of the least amount of data without having to worry about order of array entries. The code doesn't linearly interpolate between cull distances in order to not require inserting dummy points on the high end at which to disable culling without affecting the cull distance for smaller objects.
In the case of overlapping cull distance volumes, the engine will pick the most aggressive setting (lowest bigger than 0) for a primitive.