API reference
API reference
Select your platform
No SDKs available
No versions available

OVROverlayCanvas Class

Renders UI as VR overlays composited by the VR runtime at native resolution for improved quality and performance.
Supports dynamic resolution scaling, frustum culling, and both flat and curved surfaces.

Fields

compositionMode : CompositionMode
Defines how the overlay is composited with with the scene layer.
Punch-A-Hole creates a transparent hole in the scene, where the layer is rendered behind and peeks through the hole. Depth Tested renders in front of the scene, using the scene depth to determine where the layer has been occluded.
Signature
CompositionMode compositionMode
curveRadius : float
Radius of the cylindrical surface when shape is set to Curved.
Larger values create less pronounced curves. Only affects curved overlays.
Signature
float curveRadius
layer : int
Unity layer used for rendering overlay content.
Objects on this layer will be included in the overlay rendering. Default is layer 5.
Signature
int layer
manualRedraw : bool
When true, disables automatic rendering and requires manual calls to trigger updates.
Use this for UI that changes infrequently to optimize performance.
Signature
bool manualRedraw
maxTextureSize : int
Maximum texture resolution (width or height) used for the overlay render texture.
Higher values provide better quality but consume more memory and performance. Actual resolution may be lower based on dynamic scaling and aspect ratio.
Signature
int maxTextureSize
opacity : DrawMode
Defines how the overlay is rendered and composited with transparency handling.
Controls whether content is opaque, transparent, or uses alpha clipping.
Signature
DrawMode opacity
overlapMask : bool
When enabled, creates an overlap mask to handle interactions between multiple overlays.
Helps prevent visual artifacts when overlays intersect.
Signature
bool overlapMask
rectTransform : RectTransform
The RectTransform component that defines the canvas size and positioning.
Must be on the same GameObject as the OVROverlayCanvas component.
Signature
RectTransform rectTransform
renderInterval : int
Interval between render updates in frames.
Higher values reduce performance cost but make animations less smooth. Set to 1 for every frame, 2 for every other frame, etc.
Signature
int renderInterval
renderIntervalFrameOffset : int
Frame offset for render interval timing.
Allows staggering updates across multiple overlay canvases to distribute performance load more evenly.
Signature
int renderIntervalFrameOffset
shape : CanvasShape
Geometric shape of the overlay surface.
Flat creates a rectangular quad, while Curved creates a cylindrical surface with configurable radius.
Signature
CanvasShape shape
superSample : bool
Enables super sampling for improved visual quality at the cost of performance.
Renders at 2x resolution internally, then scales down for sharper results. Use sparingly and only when visual quality is critical.
Signature
bool superSample

Protected Properties

rectTransformWorldCenter : Vector3
[Get]
Signature
Vector3 rectTransformWorldCenter

Properties

CanvasDepth : int
[Get]
Signature
virtual int CanvasDepth
expensive : bool
[Get][Set]
Signature
bool expensive
IsCanvasPriority : bool
[Get]
Signature
virtual bool IsCanvasPriority
Overlay : OVROverlay
[Get]
Signature
OVROverlay Overlay
overlayEnabled : bool
[Get][Set]
Signature
bool overlayEnabled
[Get][Set]
Signature
OVROverlay.OverlayType overlayType
ShouldShowImposter : bool
[Get]
Signature
bool ShouldShowImposter

Protected Methods

ShouldRender ()
Signature
virtual bool ShouldRender()
Returns
bool

Methods

GetViewDistance ()
Signature
float? GetViewDistance()
Returns
float?
GetViewPriorityScore ()
Signature
float? GetViewPriorityScore()
Returns
float?
GetWorldIntersectionFromCanvas ( canvasInstersectionPosition , intersectionPosition , intersectionNormal )
Signature
void GetWorldIntersectionFromCanvas(Vector3 canvasInstersectionPosition, out Vector3 intersectionPosition, out Vector3 intersectionNormal)
Parameters
canvasInstersectionPosition: Vector3
intersectionPosition: out Vector3
intersectionNormal: out Vector3
Returns
void
SetCanvasLayer ( layer , forceUpdate )
Signature
void SetCanvasLayer(int layer, bool forceUpdate)
Parameters
layer: int
forceUpdate: bool
Returns
void
SetFrameDirty ()
Signature
void SetFrameDirty()
Returns
void
TransformRay ( ray )
Signature
override Ray TransformRay(Ray ray)
Parameters
ray: Ray
Returns
override Ray
UpdateOverlaySettings ()
Signature
void UpdateOverlaySettings()
Returns
void

Inner Enums

DrawMode Enum

Defines how the overlay content is rendered and composited with the scene.
Controls transparency handling, clipping behavior, and alpha processing.

Enumeration Constants

MemberValueDescription
Opaque
0
Renders content as fully opaque without transparency support.
OpaqueWithClip
1
Renders opaque content with alpha clipping support for sharp edges.
Transparent
2
Renders content with full transparency and alpha blending support.
TransparentDefaultAlpha
2
Legacy transparency mode. Use Transparent instead.
TransparentCorrectAlpha
3
Legacy transparency mode with corrected alpha. Use Transparent instead.
AlphaToMask
4
Converts alpha values to binary mask for sharp transparency cutoffs.

CanvasShape Enum

Defines the geometric shape of the overlay surface.

Enumeration Constants

MemberDescription
Flat
Renders on a flat rectangular surface.
Curved
Renders on a curved cylindrical surface with configurable radius.

CompositionMode Enum

Defines how the overlay is composited with the scene geometry.
Controls depth testing behavior and rendering order.

Enumeration Constants

MemberValueDescription
PunchAHole
OVROverlay.OverlayType.Underlay
Creates a hole in the scene where the overlay appears, allowing overlay content to show through. This composition mode is more efficient on the GPU, and handles occlusion by transparent objects more correctly, however artifacts may appear around the edges of the layer, and fine edge details will be lost.
DepthTested
OVROverlay.OverlayType.Overlay
Renders overlay with depth testing against the scene's depth buffer, The appearance of this layer's edges will be crisper without artifacts, however, the GPU cost is slightly higher, and occlusions by objects in the scene may show aliased edges and MSAA artifacts. Additionally, transparent objects will either not occlude the layer, or not blend correctly, depending on whether they write depth.