Offline occlusion culling (optimisation)

Problem

Our artists were struggling to meet the Environment vertex budgets.

  • Vertex counts were too high, and we were becoming vertex bound on the GPU

  • We had budgeted for 100,000 vertices on each Environment, and they were approaching 300,000 vertices


Solution

We took advantage of the limited camera view directions in the game - we had two main view directions, one for each direction of play on the map ( playing as Imperial, or Rebel ).

We developed an offline process that baked a unique version of the Environment geometry for each view direction. Each version included only the geometry faces visible from that direction.

Offline process :

  • For each view direction, all hidden faces were removed from the geometry

  • Visible faces were determined by scanning the camera over the playable area in that view direction, capturing 100's of images

  • Each face was rendered as a unique color to identify it in the images

  • Generated images were then analysed, and a map of visible visible faces was built

  • Environment geometry then reconstructed - any faces not found in the map were culled

Runtime :

  • When the camera view changed, we swapped to the Environment geometry for that camera view.


Results

We found that this system reduced the Environment geometry by 60-70%. It stripped not only geometry which faced away from the camera, but also all geometry outside of the camera view frustum. This was a big win for the Art effort.