Strip Unused Shaders

Unity offers three graphics tiers, Tier 1, Tier 2, and Tier 3, to customize the built-in shader compilation and rendering quality, and they correspond to target platforms for which you’re developing apps.

Understand Shader Stripping

Android apps developed in Unity, by default, load shaders from only Tier 2. Though shaders from Tier 1 and Tier 3 are built, which increases the build time, the app does not load any shaders from those tiers. The shader stripping mechanism lets you easily skip unused shaders from compilation to significantly reduce the player build time.

If you choose to strip unused shaders, at the time of shader compilation, the system starts by checking the Oculus device platform. If Android, it modifies the list of shaders to remove Tier 1 and Tier 3 shaders and compiles shaders from only Tier 2.

Enable Shader Stripping

The shader stripping feature is only available for Oculus devices that run on Android and supported on Unity versions 2018.2 and higher. Make sure that the target platform is set to Android.

  1. From Hierarchy View, select OVRCameraRig. If you’re using OVRPlayerController, expand it, and then select OVRCameraRig. For more information about using the OVRCameraRig prefab, go to the Add Camera Rig using OVRCameraRig topic.
  2. From Inspector View, in the OVR Manager script, under Android Build Settings, select Skip Unneeded Shaders.