Passthrough Best Practices
This topic describes several best practices that are useful when integrating the Passthrough API.
Enable and disable passthrough
The API supports enabling and disabling passthrough layers through OVRPassthroughLayer.enabled
or the entire passthrough capability through OVRManager.isInsightPassthroughEnabled
at runtime. Disabling destroys objects that are within the scope of the respective components, such as layers and projection meshes, which must be recreated when re-enabled. This is a good way to save resources when passthrough layers or the entire feature are not needed for an extended period and can be enabled at a moment when a short creation delay can be tolerated, such as when changing scenes.
Hide passthrough layers when unused
Layers can be hidden individually by using the property OVRPassthroughLayer.hidden
. It is always a good idea to do that when a layer is not visible. The system stops rendering the layer and frees up the GPU resources.
Note: Hiding the layer by setting the opacity to zero does not save any resources, neither in terms of computation nor memory.
Minimize the number of passthrough layers
App can create multiple passthrough layers. This is necessary in certain situations, for example when layers should differ in compositing order, where one is on top and one beneath the app’s projection layer, or style. But every layer incurs a non-trivial performance overhead to the system, which is why apps should use the fewest layers possible. To avoid an excessive performance impact, the system currently limits an app to three active passthrough layers at any given time.
Use system recommendation to choose between MR and VR
Keep passthrough cameras in sync with the display
To maximize the smoothness of passthrough, it is recommended to use a 72Hz refresh rate for your application. In flicker-free lighting conditions, passthrough will synchronize the cameras with the display, ensuring stable latency and eliminating judder. The feature is only available on Quest3/Quest3S devices.