Read and write global dimming OS values from within the app

We're trying to modify and persist Global Dimmer values from within our app, such as:

  1. We'd like to be able to read the value of Global Dimmer (that was set in OS) on the application startup
  2. We'd like to manipulate that value from within the app and persist so that even when user leaves the app, the Global Dimmer value would be reflected within OS

We're using MLGlobalDimmer.SetValue() at the moment but it only gives us possibility to set Global Dimming while within the app, without possibilities to persist the value within OS.

We tried using

var renderFeature = OpenXRSettings.Instance.GetFeature<MagicLeapRenderingExtensionsFeature>();

and reading the value of renderFeature.GlobalDimmerValue during the application startup, but it always gives 0, no matter what value we'd set in the OS for the Global Dimmer.

Is there a way to achieve what I stated in the above points 1 and 2 with the API available?

Hi @rafal.legiedz,

I have reached out to our team regarding this issue and I will report back as soon as I learn more.

Also, just to make sure please confirm you have Magic Leap 2 Rendering Extensions checked in the OpenXR settings.

Thank @etucker for chiming in. I have the following checked:

And still:

renderFeature = OpenXRSettings.Instance.GetFeature<MagicLeapRenderingExtensionsFeature>(); gives me 0 for renderFeature.GlobalDimmerValue

Question regarding your application, are you using the OpenXR loader from the XR Plugin Management settings?

Are you setting the Global dimmer value using the OpenXR APIs as well?

I guess you mean this:

Then I think not. Shall I try with it on?

Correct, you will need to use the OpenXR loader to use the OpenXR APIs. Currently the MLSDK does not provide a way to read the global dimming value.

Note, you will need to migrate your project to OpenXR from MLSDK XR.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.