When designing the occlusion subsystem, optimization was a constant consideration, integral to every feature. A primary goal was to reduce the number of unnecessary line-cast calls as much as possible. This was achieved through the use of multiple pre-occlusion checks, determining the state of the ‘Dynamic Occlusion State‘. The second and fourth images below depict the “Clear” and “Blocked” states of the Dynamic Occlusion State optimization, respectively.
The Dynamic Occlusion State status is updated when an emitter is currently using either Ultra or High quality occlusion. The “Blocked” state occurs when all line traces are occluded, whereas the “Clear” state is determined when either of the two line traces, cast as part of the Blocked state, cease being occluded. This ENUM instance can be accessed to modify the behaviour of the occlusion or other subsystems for lower resource overhead.
In addition to this feature, many other options for tweaking the quality/cost of the propagation system are available. Current optimizations are as follows:
- Occlusion update frequency: Frequency at which occlusion is updated, in seconds.
- Occlusion quality: Quality preset, representing the number of line traces performed per update.
- Attenuation culling: Audio engine dependent optimization, prevents occlusion from being updated when outside of attenuation (audible) range.
- Location change tolerance: Tolerance to which occlusion is updated when either the player or the emitter have moved positions. If neither move, occlusion is not updated.
- Dynamic occlusion state (for high and ultra qualities): Automated optimization that reduces occlusion traces to two when the listener is either completely occluded or completely non-occluded. Extra traces are re-enabled as soon as the listener becomes partially occluded.
A significant optimization used with occlusion, and that will be used with the future obstruction feature, is the “Location Change Tolerance”. This check does not allow execution unless either the listener or emitter has moved the distance specified by the tolerance parameter. A potential drawback of this optimization would be the introduction of a dynamically changing environment, where an occluding body could move between the emitter and listener without either of them moving. Detection for this scenario is outside the scope of this project; therefore, this optimization can be disabled at the developer’s discretion.