XR_ANDROID_global_passthrough_dimming
Name String
XR_ANDROID_global_passthrough_dimming
Extension Type
Instance extension
Registered Extension Number
797
Revision
1
Ratification Status
Not ratified
Extension and Version Dependencies
Last Modified Date
2026-03-10
IP Status
No known IP claims.
Contributors
Brian Chen, Google
Kyle Chen, Google
Nihav Jain, Google
Spencer Quin, Google
Overview
As optical see-through devices are introduced, it’s important to not only allow applications to adjust the darkness of the passthrough in order to provide the best blending with the app context to the user, but also let system undim the passthrough for safety reasons.
This extension provides two functions for apps to set and get the current dimming level, as well as an event to broadcast when the dimming level changes.
Inspect system capability
The XrSystemGlobalDimmingPropertiesANDROID structure is defined as:
typedef struct XrSystemGlobalDimmingPropertiesANDROID {
XrStructureType type;
void* next;
XrBool32 supportsGlobalDimming;
} XrSystemGlobalDimmingPropertiesANDROID;
Member Descriptions
typeis the XrStructureType of this structure.nextisNULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension. No such structures are defined in core OpenXR or this extension.supportsGlobalDimmingis anXrBool32, indicating if the current system supports global dimming.
An application can inspect whether the system supports global dimming by chaining an XrSystemGlobalDimmingPropertiesANDROID structure to the XrSystemProperties when calling xrGetSystemProperties .
If the runtime returns XR_FALSE for supportsGlobalDimming , the runtime must return XR_ERROR_FEATURE_UNSUPPORTED when xrGetGlobalDimmingLevelANDROID is called.
Valid Usage (Implicit)
- The
XR_ANDROID_global_passthrough_dimmingextension must be enabled prior to using XrSystemGlobalDimmingPropertiesANDROID -
typemust beXR_TYPE_SYSTEM_GLOBAL_DIMMING_PROPERTIES_ANDROID -
nextmust beNULLor a valid pointer to the next structure in a structure chain
Enumerate supported global dimming levels
The xrEnumerateSupportedGlobalDimmingLevelsANDROID structure is defined as:
XrResult xrEnumerateSupportedGlobalDimmingLevelsANDROID(
XrInstance instance,
XrSystemId systemId,
uint32_t supportedGlobalDimmingLevelCapacityInput,
uint32_t* supportedGlobalDimmingLevelCountOutput,
float* supportedGlobalDimmingLevels);
Member Descriptions
instanceis the instance from whichsystemIdwas retrieved.systemIdis theXrSystemIdwhose supported levels will be enumerated.supportedGlobalDimmingLevelCapacityInputis the capacity of thesupportedGlobalDimmingLevelsarray, or 0 to indicate a request to retrieve the required capacity.supportedGlobalDimmingLevelCountOutputis a pointer to the count ofsupportedGlobalDimmingLevelswritten, or a pointer to the required capacity in the case thatsupportedGlobalDimmingLevelCapacityInputis insufficient.supportedGlobalDimmingLevelsis a pointer to an array of supported levels, but can be NULL ifsupportedGlobalDimmingLevelCapacityInputis 0.
If returned supportedGlobalDimmingLevelCountOutput is 0, all global dimming levels between 0.0 and 1.0 are supported.
xrEnumerateSupportedGlobalDimmingLevelsANDROID enumerates the global dimming levels supported by the XrSystemId . The supported levels must not change during the lifetime of its XrInstance . The returned list of levels must be sorted in ascending order.
Runtimes must always return identical buffer contents from this enumeration for the given systemId and for the lifetime of the instance .
Valid Usage (Implicit)
- The
XR_ANDROID_global_passthrough_dimmingextension must be enabled prior to calling xrEnumerateSupportedGlobalDimmingLevelsANDROID -
instancemust be a valid XrInstance handle -
supportedGlobalDimmingLevelCountOutputmust be a pointer to auint32_tvalue - If
supportedGlobalDimmingLevelCapacityInputis not0,supportedGlobalDimmingLevelsmust be a pointer to an array ofsupportedGlobalDimmingLevelCapacityInputfloatvalues
Return Codes
XR_SUCCESS
XR_ERROR_FUNCTION_UNSUPPORTEDXR_ERROR_HANDLE_INVALIDXR_ERROR_INSTANCE_LOSTXR_ERROR_RUNTIME_FAILUREXR_ERROR_SIZE_INSUFFICIENTXR_ERROR_SYSTEM_INVALIDXR_ERROR_VALIDATION_FAILURE
Configure Global Dimming Level
The XrGlobalDimmingFrameEndInfoANDROID structure is defined as:
typedef struct XrGlobalDimmingFrameEndInfoANDROID {
XrStructureType type;
const void* next;
float globalDimmingLevel;
} XrGlobalDimmingFrameEndInfoANDROID;
Parameter Descriptions
typeis the XrStructureType of this structure.nextisNULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.globalDimmingLevelis a value between 0.0 (transparent) and 1.0 (opaque). The runtime may map this value to the closest supported global dimming level. The application can set this value to -1.0 to indicate that the current dimming level is preferred.
The globalDimmingLevel value specifies the percentage of light being blocked, where a value of 0.0 corresponds to 0% light blocking and 1.0 corresponds to 100% light blocking. The percentage of blocked light can be represented in general as:
100% - Light Transmittance%
The percentage of light transmittance, according to ISO 8980-3:2022 , can be measured as the ratio of transmitted radiant flux to incident radiant flux at wavelengths of visible light (380nm to 780nm).
The XrGlobalDimmingFrameEndInfoANDROID is a structure that an application can chain in XrFrameEndInfo to request a preferred global dimming level.
The runtime must honor the requested dimming level if the requested dimming level is different from the current dimming level.
The runtime will have control of the global dimming level and may disregard the preferred global dimming level for safety reasons.
Valid Usage (Implicit)
- The
XR_ANDROID_global_passthrough_dimmingextension must be enabled prior to using XrGlobalDimmingFrameEndInfoANDROID -
typemust beXR_TYPE_GLOBAL_DIMMING_FRAME_END_INFO_ANDROID -
nextmust beNULLor a valid pointer to the next structure in a structure chain
The xrGetGlobalDimmingLevelANDROID function is defined as:
XrResult xrGetGlobalDimmingLevelANDROID(
XrSession session,
float* dimmingLevel);
Parameter Descriptions
sessionis a valid XrSession handle.dimmingLevelis a pointer to the current dimming level.
The returned dimmingLevel must be between 0.0 and 1.0 while 0.0 means fully transparent and 1.0 means fully dimmed.
If the dimming level has not been set, the runtime must set the dimming level to 0.0 when passthrough is enabled and 1.0 when passthrough is disabled.
Valid Usage (Implicit)
- The
XR_ANDROID_global_passthrough_dimmingextension must be enabled prior to calling xrGetGlobalDimmingLevelANDROID -
sessionmust be a valid XrSession handle -
dimmingLevelmust be a pointer to afloatvalue
Return Codes
XR_SUCCESSXR_SESSION_LOSS_PENDING
XR_ERROR_FUNCTION_UNSUPPORTEDXR_ERROR_HANDLE_INVALIDXR_ERROR_INSTANCE_LOSTXR_ERROR_RUNTIME_FAILUREXR_ERROR_SESSION_LOSTXR_ERROR_VALIDATION_FAILURE
Dimming Level Changed Event
The XrEventDataGlobalDimmingLevelChangedANDROID structure is defined as:
typedef struct XrEventDataGlobalDimmingLevelChangedANDROID {
XrStructureType type;
const void* next;
XrSession session;
} XrEventDataGlobalDimmingLevelChangedANDROID;
Member Descriptions
typeis the XrStructureType of this structure.nextisNULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.sessionis a valid XrSession handle.
The application can retrieve this event by using xrPollEvent . This event will be sent when the dimming level is changed by either apps or physical buttons on devices.
This event will not be sent when focused app switches to another.
The application should respond to the event by calling xrGetGlobalDimmingLevelANDROID to get the new dimming level and update XrGlobalDimmingFrameEndInfoANDROID :: globalDimmingLevel accordingly. Responding to the event guarantees the runtime will be signaled when the application changes preferred dimming level.
Valid Usage (Implicit)
- The
XR_ANDROID_global_passthrough_dimmingextension must be enabled prior to using XrEventDataGlobalDimmingLevelChangedANDROID -
typemust beXR_TYPE_EVENT_DATA_GLOBAL_DIMMING_LEVEL_CHANGED_ANDROID -
nextmust beNULLor a valid pointer to the next structure in a structure chain
Example code
Check system capability & Enumerate supported global dimming levels
The following example code demonstrates how to check if the global dimming is supported.
XrInstance instance; // previously initialized
XrSystemId systemId; // previously initialized
// The function pointers are previously initialized using xrGetInstanceProcAddr.
PFN_xrEnumerateSupportedGlobalDimmingLevelsANDROID xrEnumerateSupportedGlobalDimmingLevelsANDROID;
XrSystemGlobalDimmingPropertiesANDROID dimmingControlSystemProperties { XR_TYPE_SYSTEM_GLOBAL_DIMMING_PROPERTIES_ANDROID };
XrSystemProperties systemProperties; // Chain dimmingControlSystemProperties
// ...
// Run xrGetSystemProperties()
// ...
if (!dimmingControlSystemProperties.supportsGlobalDimming) {
// The system does not support global dimming
return;
}
// Enumerate supported levels
uint32_t count = 0;
CHK_XR(xrEnumerateSupportedGlobalDimmingLevelsANDROID(instance, systemId, count, &count, nullptr));
std::vector<float> supportedLevels(count);
CHK_XR(xrEnumerateSupportedGlobalDimmingLevelsANDROID(instance, systemId, count, &count, supportedLevels.data()));
Poll Dimming Level Changed Event
The following example code demonstrates how to poll the dimming level changed event.
XrEventDataBuffer event{ XR_TYPE_EVENT_DATA_BUFFER };
// ...
// Run xrPollEvent()
// ...
switch (event.type) {
// This event will not be sent when focused app switches
case XR_TYPE_EVENT_DATA_GLOBAL_DIMMING_LEVEL_CHANGED_ANDROID:
{
const XrEventDataGlobalDimmingLevelChangedANDROID &dimmingLevelChangedEvent =
*reinterpret_cast<XrEventDataGlobalDimmingLevelChangedANDROID *>(&event);
// Query new dimming level using xrGetGlobalDimmingLevelANDROID()
}
}
New Commands
New Structures
- XrEventDataGlobalDimmingLevelChangedANDROID
Extending XrFrameEndInfo :
Extending XrSystemProperties :
New Enum Constants
XR_ANDROID_GLOBAL_PASSTHROUGH_DIMMING_EXTENSION_NAMEXR_ANDROID_global_passthrough_dimming_SPEC_VERSIONExtending XrStructureType :
XR_TYPE_EVENT_DATA_GLOBAL_DIMMING_LEVEL_CHANGED_ANDROIDXR_TYPE_GLOBAL_DIMMING_FRAME_END_INFO_ANDROIDXR_TYPE_SYSTEM_GLOBAL_DIMMING_PROPERTIES_ANDROID
Issues
Version History
Revision 1, 2025-10-07 (Brian Chen)
- Initial extension description.