I have this occlusion shader that also can receive shadows from objects, it works alright in all platforms FIgmin XR supports but in Magic Leap 2 when I actually record footage it just shows everything black:
What you see in the video is a black plane, that is the floor, it should just occlude but it renders black. The same issue occurs in our other occlusion shader that doesn't use shadows at all.
Just to be extra clear: the issue is only visible in video recordings, it's alright through the device though it gets messed up if i enable the segmented dimmer
Can you try making the following change to your shader?
To exclude a GameObject from having the Segmented Dimmer applied to it using this method, you can disable ZWrite in the shader used by the object’s material. This will prevent the renderer from writing to the depth buffer, effectively opting out of the Segmented Dimmer. This would be useful if you want to exclude your visualization prefabs for MLMeshing or MLPlanes from Segmented Dimmer.
In the following example shader code, the ZWrite value is exposed as a property which can be set on the Material inspector and also via C# code at runtime:
Aha, thank you for that clarification. From my testing, It looks like drawing to the depth and color buffer causes the object to render as opaque. I'll talk to the multi media team and see if they can give some insight on how the 3rd eye capture works.
Hey @ababilinski@kbabilinski I've noticed a few magic leap 2 videos on social media where the real world is very dark, I'm pretty sure it's the same problem. They have spatial mapping on but are recording without alpha override so the black just tints everything instead.
I had a strange behaviour - so all polygons produced a flipped y-axis mirrored clone of itself in 100% black
Finally I found out, magic leap renderer couldn't handle the depth texture...
Would be nice to have working depth textures to occlude objects - so is there a way?