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.

Member Enumerations

Enumeration DrawMode

Defines how the overlay content is rendered and composited with the scene.
Controls transparency handling, clipping behavior, and alpha processing.
Opaque
Renders content as fully opaque without transparency support.
OpaqueWithClip
Renders opaque content with alpha clipping support for sharp edges.
Transparent
Renders content with full transparency and alpha blending support.
TransparentDefaultAlpha
Legacy transparency mode. Use Transparent instead.
TransparentCorrectAlpha
Legacy transparency mode with corrected alpha. Use Transparent instead.
AlphaToMask
Converts alpha values to binary mask for sharp transparency cutoffs.

Enumeration CanvasShape

Defines the geometric shape of the overlay surface.
Flat
Renders on a flat rectangular surface.
Curved
Renders on a curved cylindrical surface with configurable radius.

Enumeration CompositionMode

Defines how the overlay is composited with the scene geometry.
Controls depth testing behavior and rendering order.
PunchAHole
Creates a hole in the scene where the overlay appears, allowing overlay content to show through.
DepthTested
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.

Properties

int CanvasRenderLayer[Get]
bool ShouldScaleViewport[Get]
int PixelBorder[Get]
bool expensive[Get]
OVROverlay.OverlayType overlayType[Get]
bool IsCanvasPriority[Get]
int CanvasDepth[Get]
bool ShouldShowImposter[Get]
bool overlayEnabled[Get]
Vector3 rectTransformWorldCenter[Get]
OVROverlay Overlay[Get]

Fields

The RectTransform component that defines the canvas size and positioning.
Must be on the same GameObject as the OVROverlayCanvas component.
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.
When true, disables automatic rendering and requires manual calls to trigger updates.
Use this for UI that changes infrequently to optimize performance.
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.
Frame offset for render interval timing.
Allows staggering updates across multiple overlay canvases to distribute performance load more evenly.
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.
Unity layer used for rendering overlay content.
Objects on this layer will be included in the overlay rendering. Default is layer 5.
Defines how the overlay is rendered and composited with transparency handling.
Controls whether content is opaque, transparent, or uses alpha clipping.
Geometric shape of the overlay surface.
Flat creates a rectangular quad, while Curved creates a cylindrical surface with configurable radius.
Radius of the cylindrical surface when shape is set to Curved.
Larger values create less pronounced curves. Only affects curved overlays.
When enabled, creates an overlap mask to handle interactions between multiple overlays.
Helps prevent visual artifacts when overlays intersect.
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.

Member Functions

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

Protected Functions

virtual bool ShouldRender ( )
Did you find this page helpful?