Class ARFoundationBackgroundRenderer
Uses command buffers to blit an image to a camera's background.
Namespace: UnityEngine.XR.ARFoundation
Syntax
public class ARFoundationBackgroundRenderer
Fields
m_BackgroundMaterial
The Material
to blit to the camera's background.
Declaration
protected Material m_BackgroundMaterial
Field Value
Type | Description |
---|---|
Material |
m_BackgroundTexture
A Texture
to use with the material. If no texture is set,
the m_BackgroundMaterial's _MainTex
texture is used.
Declaration
protected Texture m_BackgroundTexture
Field Value
Type | Description |
---|---|
Texture |
m_Camera
The Camera
to render the background to.
Declaration
protected Camera m_Camera
Field Value
Type | Description |
---|---|
Camera |
Properties
backgroundMaterial
Get or set the Material
used during background rendering.
Declaration
public Material backgroundMaterial { get; set; }
Property Value
Type | Description |
---|---|
Material |
backgroundTexture
The texture to use during background rendering. If no texture is set,
the backgroundMaterial's _MainTex
texture is used.
Declaration
public Texture backgroundTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
camera
The Camera
to render the background to.
Declaration
public Camera camera { get; set; }
Property Value
Type | Description |
---|---|
Camera |
mode
Get or set the ARRenderMode.
Declaration
public ARRenderMode mode { get; set; }
Property Value
Type | Description |
---|---|
ARRenderMode |
Methods
DisableARBackgroundRendering()
Invoked to indicate background rendering should stop.
Removes command buffers and returns the Camera
to its previous state.
Declaration
protected virtual void DisableARBackgroundRendering()
EnableARBackgroundRendering()
Invoked to indicate background rendering should begin. Use this to setup the camera's properties and the command buffers used for background rendering.
Declaration
protected virtual bool EnableARBackgroundRendering()
Returns
Type | Description |
---|---|
Boolean |
|
Events
backgroundRendererChanged
Invoked when one of the properties of this class changes.
Declaration
public event Action<ARFoundationBackgroundRendererChangedEventArgs> backgroundRendererChanged
Event Type
Type | Description |
---|---|
Action<ARFoundationBackgroundRendererChangedEventArgs> |