Shadows

Traditional methods of shadow mapping are computationally intensive on mobile device. This causes a serious decrease in performance, as shadow maps require extra frame buffers and render passes.

Therefore, shadow buffers on mobile devices are often low resolution and do not use any filtering. In turn, the shadows often introduce large amounts of aliasing, damaging the realism of the simulation due to artifacts such as shadow acne and hard shadows.

The following screenshot demonstrates the comparison between a typical shadow, on the left, and a blob shadow, on the right:

Another technique worth considering is the use of baked shadows. Unlike with shadow mapping, shadow baking does not require any additional render passes. Instead, high quality shadows are baked into the textures that they cast shadows on.

Mitigation technique - Blob shadows

The recommended practice in VR is to avoid rendering shadows where possible. But, if a shadow is required, such as underneath a player, then blob shadows can be rendered underneath objects. Blob shadows produce considerably less aliasing than using typical shadow mapping techniques while providing an improvement to performance.

Implementing blob shadows in Unity

Blob shadows are available as a scene component in Unity for free from the Asset Store.

To implement blob shadows:

  1. Import the Unity Standard Assets from the Unity asset store.
  2. Navigate to the BlobShadowProject prefab within Assets > StandardAssets > Effects Projects > Prefabs.
  3. Drag the BlobShadowProject prefab into the Hierarchy as a child of the object that requires a blob shadow.

When completed, a blob shadow appears. To finish setting up blob shadows:

  1. Edit the prefab options. Make sure that you include the location of the blob shadow that is relative to the object that must be casting the shadow.
  2. Select the object that is casting the shadow and then set the Cast Shadows option to Off.

Previous Next