Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

XRCameraSubsystem

class in UnityEngine.Experimental.XR

/

Inherits from:Experimental.Subsystem

/

Implemented in:UnityEngine.XRModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Provides access to a device's camera.

The XRCameraSubsystem links a Unity Camera to a device camera for video overlay (pass-thru rendering). It also allows developers to query for environmental light estimation, when available.

Properties

CameraSet current Camera component within the app to be used by this XRCameraInstance.
LastUpdatedFrameThe frame during which the camera subsystem was last successfully updated.
LightEstimationRequestedTrue if the XRCameraSubsystem should try to provide light estimation.
MaterialSet current Material to be used while rendering to the render target.

Public Methods

GetTexturesFills the provided texturesOut with the texture(s) associated with the XRCameraSubsystem.
TryGetAverageBrightnessProvides brightness for the whole image as an average of all pixels' brightness.
TryGetAverageColorTemperatureProvides color temperature for the whole image as an average of all pixels' color temperature.
TryGetDisplayMatrixProvides display matrix defining how texture is being rendered on the screen.
TryGetProjectionMatrixProvides projection matrix used by camera subsystem.
TryGetShaderNameProvides shader name used by Camera subsystem to render texture.
TryGetTimestampProvides timestamp.

Events

FrameReceivedEvent raised when a new camera frame is received.

Inherited Members

Public Methods

DestroyDestroys this instance of a subsystem.
StartStarts an instance of a subsystem.
StopStops an instance of a subsystem.

Did you find this page useful? Please give it a rating: