Global Dimmer Getter?

Is there a plan to bring back the getter for the global dimmer? I'm 99% sure I had access to it when I first began the project and an update sometime last year removed it. It creates a mismatch from our app and the OS since we have to assume its at 0% when we set the new value.

Unity Editor version: 2022.3.11f1
ML2 OS version: 1.4.1
MLSDK version: 1.4.0
Host OS: (Windows)

Hi @nathan,

Thank you for reaching out regarding this question. I have consulted our team and I will report back as soon as I learn more.



Could you please provide more details on what you mean by this?

Currently there is a MLGlobalDimmer.SetValue(float value) is there a plan on having access to the value currently set: Example "float value MLGlobalDimmer.GetValue()"

Since someone can set the dimmer value outside the app while the app has no way of knowing or getting the current dimmer value.

Currently, we do not provide a getter for the Global dimmer per application. However, you should be able to track the value inside your app using something like Unity's player prefs

I understand that the Global Dimmer is not per application. My issue isn't the fact that we want to save this value in between sessions, we have our own user cache we could use if so.

There is only one Global Dimmer and is managed on the OS level from my understanding. We can currently set this value but we cant get that value.

Lets imagine a scenario... The user turns on the Magic Leap and in the OS menu they change the dimmer to 50%, they then open our app. We have no way of getting this value (50%) currently. We would like to reflect the current device dimmer value through our app.

Unfortunately that function isn't supported, and is unlikely to be added at this time. With OpenXR it is possible, but there are currently compatibility issues between OpenXR and MRTK, so I would recommend a workaround, such as storing a user preference, which you restore the global dimmer value to at startup, or something similar until your team is ready to upgrade to OpenXR .

Alright sounds good, is there examples or documentation on the OpenXR way?

I believe renderFeature.globalDimmerValue should give you the value. For more information on the global dimmer OpenXR implementation you can check out

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