Change how your content looks based on the display type

Applicable XR devices
This guidance helps you build experiences for these types of XR devices.
XR Headsets
Wired XR Glasses
Audio &
Display Glasses

Different types of devices have different types of display characteristics. Your app can check the display characteristics of the device it is running on to adapt your content to make sure it is displayed in the best possible way.

The types of display blend modes

A DisplayBlendMode value describes how the imagery is overlaid on top of the real world. The display technology fundamentally changes how digital content blends with the physical world.

Additive blending

When the current display blend mode is ADDITIVE, black pixels appear transparent. This is often used by devices with transparent lenses that directly allow the user's environment to pass through to the user's eyes. The device can only add more light to the surface.

Concretely, this means that virtual content is added to the real world by adding the pixel values for each of red, green, and blue components. Alpha is ignored, and black pixels appear see-through.

Alpha blending

When the current display blend mode is ALPHA_BLEND, virtual content is added to the real world by alpha blending the pixel values based on the alpha component. This is the case with XR headsets, which use an opaque display to render content. The brightness of each pixel can be controlled and pixels can be set to appear black. Depending on the active spatial environment, these pixels might represent the real world through a camera stream, or a digital environment.

No display

When the current display blend mode is NO_DISPLAY, the device cannot display any pixels.

Obtain the current DisplayBlendMode

To check the active DisplayBlendMode, use XrDevice.getPreferredDisplayBlendMode:

val preferredDisplayBlendMode =
    XrDevice.getCurrentDevice(session).getPreferredDisplayBlendMode()
when (preferredDisplayBlendMode) {
    ADDITIVE -> {
        // Virtual content is added to the real world by adding the pixel values for each of
        // Red, Green, and Blue components. Alpha is ignored. Black pixels will appear transparent.
    }

    ALPHA_BLEND -> {
        // Virtual content is added to the real world by alpha blending the pixel values based
        // on the Alpha component.
    }

    NO_DISPLAY -> {
        // Device doesn't have a display.
    }
}

Learn more