Wartorn Tech | Geometry Occlusion Culling

A sample showing unit-based geometry culling. Environmental assets blocking a custom trace channel will automatically fade out when it is detected that a player unit is being visually occluded.

Side-by-side view of geometry occlusion culling disabled (left) and enabled (right).

Side-by-side view of geometry occlusion culling disabled (left) and enabled (right).

A sample showing cursor-based geometry culling. This was added in addition to the automatic unit-based culling to assist in sending move orders to units where environmental geometry would otherwise block cursor input.

Flipbook showing an object at 5 different culling values [0.0, 0.25, 0.5, 0.75, 1.0].

Flipbook showing an object at 5 different culling values [0.0, 0.25, 0.5, 0.75, 1.0].

The object type that the camera culling component creates instances of to keep track of what environmental geometry is being affected, as well as the function used to update the dynamic material instance.

The object type that the camera culling component creates instances of to keep track of what environmental geometry is being affected, as well as the function used to update the dynamic material instance.

The custom trace channel used for detecting geometry.

The custom trace channel used for detecting geometry.

Wartorn Tech | Geometry Occlusion Culling

Because Wartorn primarily uses a fixed-angle camera, there are unavoidable instances where either your player units or something you are attempting to interact with (an item, an enemy, etc.) is visually obscured by environmental geometry. This can be particularly frustrating in an RTS style game where it is critically important to be able to visually identify your units at a glance, as well as react to enemies attacking or damage being taken.

To solve this Wartorn implements a custom component attached to the game-camera that continually raycasts from the camera position to each unit position, detecting colliding geometry via a custom trace channel and fading out any relevant mesh components. Because there is the potential for a very large number of units to be visible on the screen at any given time adding a not-insignificant performance overhead, a queuing system was added to throttle the number of units processed on any given frame.

The visual effect itself is entirely material-based and simply uses temporal dithering combined with an opacity mask to either fade in or fade out the relevant geometry.

More artwork