Segmented Dimming no longer working in the Headset

Has anyone else noticed that Segmented Dimming is no longer working in the display of the headset??? At first I thought that I had it configured incorrectly in Unity. But then I noticed when using Device Stream that the Objects that I have duplicated for dimming show up as solid in the device stream view of my app, while the items that don't have a dimmer clone show up as transparent, exactly as expected. However, when I look through the headset itself, everything is transparent. I verified that segmented dimming is enabled in the OS settings. I also verified that older apps compiled months ago that feature segmented dimming still function. However, apps that I compile today with the latest SDKs do not function properly.

Unity Editor version: 2022.2.5f1
ML2 OS version: 1.3.1 (???) Though, I think this is a typo and that it should be 1.3.0 based on previously having 1.3.0-dev1/2 and prior naming conventions having the dev1/2 released followed by the non-dev release
MLSDK version: 1.3.0
Host OS: (Windows/MacOS) macOS Ventura 13.1

Error messages from logs (syntax-highlighting is supported via Markdown): None

Hi @rscanlo2,

It seems that I cannot reproduce this issue. Are you seeing this behavior in the Unity SDK example project?



Hi @etucker,

I built the SDK Example project. The Segmented Dimmer scene in that project behaves appropriately. I dug into the code for that scene and it turns out that the example scene only uses the "Simple Usecase" of activating the segmented dimmer for all contents. I am using the "Advanced Usecase" where I utilize the SegmentedDimmer material on game objects to dim only specific objects. This use case appears to not be working. Both usecases are outlined here. The advanced usecase worked in the past. That is how I originally implemented segmented dimming.

Apologies for my misunderstanding. Let me take a look at the advanced use case.

I noticed you mentioned that this happened when using Device Stream. What about when using the headset without using device stream? Is that functioning properly?

It is the same result when not using the device stream. It was simply that in using device stream I realized that it wasn't a real issue with my code or project configuration because device stream displayed everything properly.

I did a little more testing yesterday and discovered something curious. If I follow the instructions for the simple usecase in conjunction with all of the changes I made for the advanced usecase. The segmented dimming actually works as intended. This is to say that when I've created the URP assets and all the settings required for the advanced usecase, when I call MLSegmentedDimmer.Activate() segmented dimming gets enabled, not for ALL meshes, but instead only for the meshes where I have assigned the SegmentedDimmer material to the MeshRenderer.material. So in a stroke of luck, this is either a workaround, until the bug is fixed. Or this is the intended new functionality (everyone has to call MLSegmentedDimmer.Activate() to get Segmented Dimming to work anywhere). I need you to check with the development team. If the latter is the case, then the documentation in the link from my original post needs to be updated to reflect this ASAP.

Thank you for bringing this workaround to our attention. I'll go ahead and test this out. When using this workaround, are the objects that do not have the segmented dimming material not displaying segmented dimming as intended?

Yes. That is correct. Only the objects that segmented dimming material trigger the segmented dimming on the headset. The rest do not display segmented dimming. I have verified this by creating a script that iterates over the "shadow" dimmer objects that have the SegmentedDimming material in my scene and toggle activation of these objects. When deactivated the primary objects that the other objects "shadow" appear transparent. When activated, the primary objects appear solid. So the workaround presents full intended functionality.

It seems that this may be an issue with the documentation/examples itself. MLSegmentedDimmer.Activate() should always be called whether you're using the simple use case or the advanced use case. Thank you for bringing this issue to our attention and we will be sure to make the necessary changes to remove confusion.