You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AssertionException: Shader named 'Meta/EnvironmentDepth/DepthMask' wasn't found in Resources folder.
Assertion failure. Value was Null
Expected: Value was not Null
UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <0652bf0e14024522b5c92574ad0ef550>:0)
UnityEngine.Assertions.Assert.IsNotNull (UnityEngine.Object value, System.String message) (at <0652bf0e14024522b5c92574ad0ef550>:0)
UnityEngine.Assertions.Assert.IsNotNull[T] (T value, System.String message) (at <0652bf0e14024522b5c92574ad0ef550>:0)
Meta.XR.EnvironmentDepth.EnvironmentDepthManager+Mask..ctor (System.Int32 width, System.Int32 height, System.Single bias) (at ./Library/PackageCache/com.meta.xr.sdk.core@71.0.0/Scripts/EnvironmentDepth/EnvironmentDepthManager.cs:410)
Meta.XR.EnvironmentDepth.EnvironmentDepthManager.TryFetchDepthTexture (UnityEngine.Matrix4x4 trackingSpaceWorldToLocal) (at ./Library/PackageCache/com.meta.xr.sdk.core@71.0.0/Scripts/EnvironmentDepth/EnvironmentDepthManager.cs:369)
Meta.XR.EnvironmentDepth.EnvironmentDepthManager.Update () (at ./Library/PackageCache/com.meta.xr.sdk.core@71.0.0/Scripts/EnvironmentDepth/EnvironmentDepthManager.cs:296)
I'm getting this error when I try to send a mesh filter to the EnvironmentDepthManager. Im using everything from meta's all in one sdk. Ive included URP shaders from the git url mentioned in this repo. Nowhere on the internet I could find this issue or this DepthMask shader. Please help!
Hello,
This feature was just delivered in v71 but unfortunately we mistakenly didn't push the preprocessing shader to production. We caught this quite late, we'll update the docs with known issues and v72 will have the fix once it lands sometime next month. In the meantime, I'll share the solution there for v71. The feature is looking for a specific shader in the Resources folder, so simply create a shader file and place this code inside it :
This shader works for both URP and BiRP. v72 is finally out and it has the fix, so simply updating your core package will now just have the shader in there. This repo will receive an update soon to v72 and will contain an example scene on how to use the feature.
Edit: v72 is out now and contains the shader in core sdk. Updating to this version no longer requires the use of the workaround highlighted in this thread. Samples and documentation have been updated with an example scene utilizing Depth Mask. If you still have questions, I recommend starting a new issue rather than posting here, visibility is better that way.
Activity
TudorJude commentedon Nov 27, 2024
Hello,
This feature was just delivered in v71 but unfortunately we mistakenly didn't push the preprocessing shader to production. We caught this quite late, we'll update the docs with known issues and v72 will have the fix once it lands sometime next month. In the meantime, I'll share the solution there for v71. The feature is looking for a specific shader in the Resources folder, so simply create a shader file and place this code inside it :
We're sorry for the mix-up, once this feature is fixed in v72, we'll deliver a sample to show a common use-case as well.
deepansh96 commentedon Nov 27, 2024
Thank you so much! I spent hours looking through docs again and again and trying to find that shader. I just tried it and it works great. Can't wait for v72. Also one more thing while I have you here, is there any utility prefab available using which I can see the grayscale processed depth map like its shown in this video? https://developers.meta.com/horizon/documentation/unity/unity-depthapi-occlusions-advanced-usage#using-the-depth-mask-feature
TudorJude commentedon Nov 27, 2024
It'll be part of the sample update in v72. Until then, here's the shader. Just create a material with it and place it on a quad:
Auryg commentedon Jan 23, 2025
I don't suppose you could post a shader that works in URP as well? Unless that one should and I simply screwed up implementation.
TudorJude commentedon Jan 24, 2025
This shader works for both URP and BiRP. v72 is finally out and it has the fix, so simply updating your core package will now just have the shader in there. This repo will receive an update soon to v72 and will contain an example scene on how to use the feature.
Edit: v72 is out now and contains the shader in core sdk. Updating to this version no longer requires the use of the workaround highlighted in this thread. Samples and documentation have been updated with an example scene utilizing Depth Mask. If you still have questions, I recommend starting a new issue rather than posting here, visibility is better that way.