static void Register()
        {
            if (!Api.AtLeast13_0())
            {
                return;
            }

            const string k_SubsystemId = "ARKit-Occlusion";

            bool supportsHumanSegmentationStencilImage = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationStencil();
            bool supportsHumanSegmentationDepthImage   = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationDepth();

            if (supportsHumanSegmentationStencilImage || supportsHumanSegmentationDepthImage)
            {
                XROcclusionSubsystemCinfo occlusionSubsystemCinfo = new XROcclusionSubsystemCinfo()
                {
                    id = k_SubsystemId,
                    implementationType = typeof(ARKitOcclusionSubsystem),
                    supportsHumanSegmentationStencilImage = supportsHumanSegmentationStencilImage,
                    supportsHumanSegmentationDepthImage   = supportsHumanSegmentationDepthImage,
                };

                if (!XROcclusionSubsystem.Register(occlusionSubsystemCinfo))
                {
                    Debug.Log($"Cannot register the {k_SubsystemId} subsystem");
                }
            }
        }
Beispiel #2
0
        static void Register()
        {
            if (!Api.platformAndroid || !Api.loaderPresent)
            {
                return;
            }

            const string k_SubsystemId = "ARCore-Occlusion";

            XROcclusionSubsystemCinfo occlusionSubsystemCinfo = new XROcclusionSubsystemCinfo()
            {
                id = k_SubsystemId,
#if UNITY_2020_2_OR_NEWER
                providerType          = typeof(ARCoreOcclusionSubsystem.ARCoreProvider),
                subsystemTypeOverride = typeof(ARCoreOcclusionSubsystem),
#else // UNITY_2020_2_OR_NEWER
                implementationType = typeof(ARCoreOcclusionSubsystem),
#endif // UNITY_2020_2_OR_NEWER
                supportsHumanSegmentationStencilImage = false,
                supportsHumanSegmentationDepthImage   = false,
                queryForSupportsEnvironmentDepthImage = NativeApi.UnityARCore_OcclusionProvider_DoesSupportEnvironmentDepth,
            };

            if (!XROcclusionSubsystem.Register(occlusionSubsystemCinfo))
            {
                Debug.Log($"Cannot register the {k_SubsystemId} subsystem");
            }
        }
        static void Register()
        {
            if (!Api.AtLeast13_0())
            {
                return;
            }

            const string k_SubsystemId = "ARKit-Occlusion";

            bool supportsHumanSegmentationStencilImage = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationStencil();
            bool supportsHumanSegmentationDepthImage   = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationDepth();

            XROcclusionSubsystemCinfo occlusionSubsystemCinfo = new XROcclusionSubsystemCinfo()
            {
                id = k_SubsystemId,
#if UNITY_2020_2_OR_NEWER
                providerType          = typeof(ARKitOcclusionSubsystem.ARKitProvider),
                subsystemTypeOverride = typeof(ARKitOcclusionSubsystem),
#else
                implementationType = typeof(ARKitOcclusionSubsystem),
#endif
                supportsHumanSegmentationStencilImage           = supportsHumanSegmentationStencilImage,
                supportsHumanSegmentationDepthImage             = supportsHumanSegmentationDepthImage,
                queryForSupportsEnvironmentDepthImage           = NativeApi.UnityARKit_OcclusionProvider_DoesSupportEnvironmentDepth,
                queryForSupportsEnvironmentDepthConfidenceImage = NativeApi.UnityARKit_OcclusionProvider_DoesSupportEnvironmentDepth,
            };

            XROcclusionSubsystem.Register(occlusionSubsystemCinfo);
        }
        static void Register()
        {
            if (!Api.platformAndroid || !Api.loaderPresent)
            {
                return;
            }

            const string k_SubsystemId = "ARCore-Occlusion";

            var occlusionSubsystemCinfo = new XROcclusionSubsystemCinfo()
            {
                id                    = k_SubsystemId,
                providerType          = typeof(ARCoreOcclusionSubsystem.ARCoreProvider),
                subsystemTypeOverride = typeof(ARCoreOcclusionSubsystem),
                environmentDepthImageSupportedDelegate = NativeApi.UnityARCore_OcclusionProvider_DoesSupportEnvironmentDepth,
                // Confidence and smoothing is implicitly supported if environment depth is supported.
                environmentDepthConfidenceImageSupportedDelegate   = NativeApi.UnityARCore_OcclusionProvider_DoesSupportEnvironmentDepth,
                environmentDepthTemporalSmoothingSupportedDelegate = NativeApi.UnityARCore_OcclusionProvider_DoesSupportEnvironmentDepth,
            };

            if (!XROcclusionSubsystem.Register(occlusionSubsystemCinfo))
            {
                Debug.Log($"Cannot register the {k_SubsystemId} subsystem");
            }
        }
Beispiel #5
0
 internal static void Register()
 {
     XROcclusionSubsystem.Register(new XROcclusionSubsystemCinfo
     {
         id                    = typeof(UnityXRMockOcclusionSubsystem).FullName,
         providerType          = typeof(MockProvider),
         subsystemTypeOverride = typeof(UnityXRMockOcclusionSubsystem),
         queryForSupportsEnvironmentDepthConfidenceImage = () => true,
         queryForSupportsEnvironmentDepthImage           = () => true,
         supportsHumanSegmentationDepthImage             = true,
         supportsHumanSegmentationStencilImage           = true
     });
 }
        static void Register()
        {
#if UNITY_EDITOR
            const string k_SubsystemId     = "ARKit-Occlusion-Remote";
            XROcclusionSubsystemCinfo info = new XROcclusionSubsystemCinfo()
            {
                id = k_SubsystemId,
                implementationType = typeof(ARKitOcclusionRemoteSubsystem),
                supportsHumanSegmentationStencilImage = true,
                supportsHumanSegmentationDepthImage   = true,
            };

            if (!XROcclusionSubsystem.Register(info))
            {
                Debug.LogErrorFormat("Cannot register the {0} subsystem", k_SubsystemId);
            }
            else
            {
                Debug.LogFormat("Registered the {0} subsystem", k_SubsystemId);
            }
#endif // UNITY_EDITOR
        }
        static void Register()
        {
            if (!Api.AtLeast13_0())
            {
                return;
            }

            const string k_SubsystemId = "ARKit-Occlusion";

            var occlusionSubsystemCinfo = new XROcclusionSubsystemCinfo()
            {
                id                    = k_SubsystemId,
                providerType          = typeof(ARKitOcclusionSubsystem.ARKitProvider),
                subsystemTypeOverride = typeof(ARKitOcclusionSubsystem),
                humanSegmentationStencilImageSupportedDelegate     = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationStencil,
                humanSegmentationDepthImageSupportedDelegate       = NativeApi.UnityARKit_OcclusionProvider_DoesSupportBodySegmentationDepth,
                environmentDepthImageSupportedDelegate             = NativeApi.UnityARKit_OcclusionProvider_DoesSupportEnvironmentDepth,
                environmentDepthConfidenceImageSupportedDelegate   = NativeApi.UnityARKit_OcclusionProvider_DoesSupportEnvironmentDepth,
                environmentDepthTemporalSmoothingSupportedDelegate = NativeApi.UnityARKit_OcclusionProvider_DoesSupportEnvironmentDepthTemporalSmoothing
            };

            XROcclusionSubsystem.Register(occlusionSubsystemCinfo);
        }