docs.unity3d.com
    Show / Hide Table of Contents

    Class XREnvironmentProbeSubsystem

    Defines an interface for interacting with environment probe functionality for creating realistic lighting and environment texturing in AR scenes.

    Inheritance
    Object
    Subsystem
    Subsystem<XREnvironmentProbeSubsystemDescriptor>
    XRSubsystem<XREnvironmentProbeSubsystemDescriptor>
    TrackingSubsystem<XREnvironmentProbe, XREnvironmentProbeSubsystemDescriptor>
    XREnvironmentProbeSubsystem
    Inherited Members
    TrackingSubsystem<XREnvironmentProbe, XREnvironmentProbeSubsystemDescriptor>.GetChanges(Allocator)
    XRSubsystem<XREnvironmentProbeSubsystemDescriptor>.running
    XRSubsystem<XREnvironmentProbeSubsystemDescriptor>.OnDestroy()
    XRSubsystem<XREnvironmentProbeSubsystemDescriptor>.Start()
    XRSubsystem<XREnvironmentProbeSubsystemDescriptor>.Stop()
    Subsystem<XREnvironmentProbeSubsystemDescriptor>.SubsystemDescriptor
    Subsystem.Destroy()
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class XREnvironmentProbeSubsystem : TrackingSubsystem<XREnvironmentProbe, XREnvironmentProbeSubsystemDescriptor>, ISubsystem

    Constructors

    XREnvironmentProbeSubsystem()

    Constructs an XREnvironmentProbeSubsystem. Do not create this directly. Call Create on an XREnvironmentProbeSubsystemDescriptor obtained from the SubsystemManager.

    Declaration
    public XREnvironmentProbeSubsystem()

    Properties

    automaticPlacementEnabled

    Specifies whether the AR session will automatically place environment probes in the scene.

    Declaration
    public bool automaticPlacementEnabled { get; }
    Property Value
    Type Description
    Boolean
    See Also
    automaticPlacementRequested

    automaticPlacementRequested

    Specifies whether the AR session should automatically place environment probes in the scene.

    Declaration
    public bool automaticPlacementRequested { get; set; }
    Property Value
    Type Description
    Boolean

    true if automatic placement of environment probes is enabled. Otherwise, false.

    Remarks

    If both manual and automatic placement of environment probes are supported, manually placed environment probes may be specified via TryAddEnvironmentProbe(Pose, Vector3, Vector3, out XREnvironmentProbe) regardless of whether automatic placement is enabled or not.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when setting this value to true for implementations that do not support automatic placement.

    environmentTextureHDREnabled

    Queries whether HDR environment textures are enabled.

    Declaration
    public bool environmentTextureHDREnabled { get; }
    Property Value
    Type Description
    Boolean

    environmentTextureHDRRequested

    Specifies whether the environment textures should be returned as HDR textures.

    Declaration
    public bool environmentTextureHDRRequested { get; set; }
    Property Value
    Type Description
    Boolean

    true if the environment textures should be returned as HDR textures. Otherwise, false.

    provider

    The provider created by the implementation that contains the required environment probe functionality.

    Declaration
    protected XREnvironmentProbeSubsystem.Provider provider { get; }
    Property Value
    Type Description
    XREnvironmentProbeSubsystem.Provider

    Methods

    CreateProvider()

    Must create an implementation of XREnvironmentProbeSubsystem.Provider, the provider-specific implementation of this subsystem.

    Declaration
    protected abstract XREnvironmentProbeSubsystem.Provider CreateProvider()
    Returns
    Type Description
    XREnvironmentProbeSubsystem.Provider

    An instance of a derived XREnvironmentProbeSubsystem.Provider.

    GetChanges(Allocator)

    Declaration
    public override TrackableChanges<XREnvironmentProbe> GetChanges(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator
    Returns
    Type Description
    TrackableChanges<XREnvironmentProbe>
    Overrides
    UnityEngine.XR.ARSubsystems.TrackingSubsystem<UnityEngine.XR.ARSubsystems.XREnvironmentProbe, UnityEngine.XR.ARSubsystems.XREnvironmentProbeSubsystemDescriptor>.GetChanges(Unity.Collections.Allocator)

    OnDestroyed()

    Destroys the subsystem and any internal state.

    Declaration
    protected sealed override void OnDestroyed()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XREnvironmentProbeSubsystemDescriptor>.OnDestroyed()

    OnStart()

    Starts the subsystem. If automaticPlacementEnabled is true, environment probes will be created automatically.

    Declaration
    protected sealed override void OnStart()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XREnvironmentProbeSubsystemDescriptor>.OnStart()

    OnStop()

    Stops the subsystem. This does not remove existing environment probes, but it stops automatically placing them, and manually placed probes will not be updated until OnStart() is called again.

    Declaration
    protected sealed override void OnStop()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XREnvironmentProbeSubsystemDescriptor>.OnStop()

    Register(XREnvironmentProbeSubsystemCinfo)

    Registers a subsystem implementation based on the given subystem parameters.

    Declaration
    public static bool Register(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
    Parameters
    Type Name Description
    XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo

    The parameters defining the environment probe functionality implemented by the subsystem provider.

    Returns
    Type Description
    Boolean

    true if the subsystem implementation is registered. Otherwise, false.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the values specified in the environmentProbeSubsystemCinfo parameter are invalid. Typically, this will occur

    • if id is null or empty
    • if implementationType is null
    • if implementationType does not derive from the XREnvironmentProbeSubsystem class

    RemoveEnvironmentProbe(TrackableId)

    Asynchronously removes the environment probe matching the trackable ID from the AR session.

    Declaration
    public bool RemoveEnvironmentProbe(TrackableId trackableId)
    Parameters
    Type Name Description
    TrackableId trackableId

    Trackable ID of the environment probe to be removed from the AR session.

    Returns
    Type Description
    Boolean

    true if the environment probe is found in the current AR session and will be removed. Otherwise, false.

    Remarks

    RemoveEnvironmentProbe may be used to remove both manually-placed and automatically-placed environment probes if the implementation supports such removals, as indicated by the descriptor properties supportsRemovalOfManual and supportsRemovalOfAutomatic.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the environment probe subsystem is not running and this method is called to an add environment probe.

    NotSupportedException

    Thrown for platforms that do not support removal of the type of environment probe.

    TryAddEnvironmentProbe(Pose, Vector3, Vector3, out XREnvironmentProbe)

    Tries to create an environment probe.

    Declaration
    public bool TryAddEnvironmentProbe(Pose pose, Vector3 scale, Vector3 size, out XREnvironmentProbe environmentProbe)
    Parameters
    Type Name Description
    Pose pose

    The position and rotation at which to create the environment probe.

    Vector3 scale

    The scale at which to create the environment probe.

    Vector3 size

    The size (dimensions) of the environment probe to create.

    XREnvironmentProbe environmentProbe

    If successful, populated with the newly created environment probe. Otherwise, it will contain default values.

    Returns
    Type Description
    Boolean

    true if the environment probe was successfully added, otherwise false.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the environment probe subsystem is not running and this method is called to an add environment probe.

    NotSupportedException

    Thrown for platforms that do not support manual placement of environment probes.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023